diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index e93b8b24..ab6a77f9 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -17,6 +17,10 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 + - name: Prepare Datagen + uses: eskatos/gradle-command-action@v1 + with: + arguments: rundatagen - name: Publish Modrinth Jar env: MODRINTH_KEY: ${{ secrets.MODRINTH_KEY }} diff --git a/assets/models/body.png b/assets/models/body.png new file mode 100644 index 00000000..99e38ba2 Binary files /dev/null and b/assets/models/body.png differ diff --git a/assets/models/cork.png b/assets/models/cork.png new file mode 100644 index 00000000..c87771fa Binary files /dev/null and b/assets/models/cork.png differ diff --git a/assets/models/hanging_sandbag.bbmodel b/assets/models/hanging_sandbag.bbmodel new file mode 100644 index 00000000..463a3f37 --- /dev/null +++ b/assets/models/hanging_sandbag.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.9","model_format":"modded_entity","box_uv":true},"name":"hanging_sandbag","model_identifier":"","modded_entity_version":"Fabric 1.17+","modded_entity_flip_y":true,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"timeline_setups":[],"unhandled_root_fields":{},"resolution":{"width":32,"height":32},"elements":[{"name":"rope","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-0.5,-9,-0.5],"to":[0.5,0,0.5],"autouv":0,"color":7,"origin":[0,-22,0],"uv_offset":[16,19],"faces":{"north":{"uv":[17,20,18,29],"texture":0},"east":{"uv":[16,20,17,29],"texture":0},"south":{"uv":[19,20,20,29],"texture":0},"west":{"uv":[18,20,19,29],"texture":0},"up":{"uv":[18,20,17,19],"texture":0},"down":{"uv":[19,19,18,20],"texture":0}},"type":"cube","uuid":"023a3320-18c3-d968-3a13-56914da8e6f0"},{"name":"cube","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-3,-17,-3],"to":[3,-10,3],"autouv":0,"color":5,"origin":[0,-9,0],"faces":{"north":{"uv":[6,6,12,13],"texture":0},"east":{"uv":[0,6,6,13],"texture":0},"south":{"uv":[18,6,24,13],"texture":0},"west":{"uv":[12,6,18,13],"texture":0},"up":{"uv":[12,6,6,0],"texture":0},"down":{"uv":[18,0,12,6],"texture":0}},"type":"cube","uuid":"1ca3a675-33f5-744f-58f9-cf14867dcfb1"},{"name":"cube","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[0,-22,-2],"to":[0,-18,2],"autouv":0,"color":9,"rotation":[0,-45,0],"origin":[0,-10,0],"uv_offset":[0,14],"faces":{"north":{"uv":[4,18,4,22],"texture":0},"east":{"uv":[0,18,4,22],"texture":0},"south":{"uv":[8,18,8,22],"texture":0},"west":{"uv":[4,18,8,22],"texture":0},"up":{"uv":[4,18,4,14],"texture":0},"down":{"uv":[4,14,4,18],"texture":0}},"type":"cube","uuid":"5cc3052b-c843-eec8-9326-2bfd1b1fd435"},{"name":"cube","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[0,-22,-2],"to":[0,-18,2],"autouv":0,"color":9,"rotation":[0,45,0],"origin":[0,-10,0],"uv_offset":[0,14],"faces":{"north":{"uv":[4,18,4,22],"texture":0},"east":{"uv":[0,18,4,22],"texture":0},"south":{"uv":[8,18,8,22],"texture":0},"west":{"uv":[4,18,8,22],"texture":0},"up":{"uv":[4,18,4,14],"texture":0},"down":{"uv":[4,14,4,18],"texture":0}},"type":"cube","uuid":"9a732bc0-bf4d-cc97-85fb-674e15c88c5c"},{"name":"cube","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-2,-10,-2],"to":[2,-9,2],"autouv":0,"color":5,"origin":[0,-9,0],"uv_offset":[12,14],"faces":{"north":{"uv":[16,18,20,19],"texture":0},"east":{"uv":[12,18,16,19],"texture":0},"south":{"uv":[24,18,28,19],"texture":0},"west":{"uv":[20,18,24,19],"texture":0},"up":{"uv":[20,18,16,14],"texture":0},"down":{"uv":[24,14,20,18],"texture":0}},"type":"cube","uuid":"90ba7ded-8e83-43de-e4da-bb237f43bdd7"},{"name":"cube","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-2,-18,-2],"to":[2,-17,2],"autouv":0,"color":5,"origin":[0,-9,0],"uv_offset":[0,13],"faces":{"north":{"uv":[4,17,8,18],"texture":0},"east":{"uv":[0,17,4,18],"texture":0},"south":{"uv":[12,17,16,18],"texture":0},"west":{"uv":[8,17,12,18],"texture":0},"up":{"uv":[8,17,4,13],"texture":0},"down":{"uv":[12,13,8,17],"texture":0}},"type":"cube","uuid":"741187ae-e05b-4c69-1555-99303f3e9f04"}],"outliner":[{"name":"root","origin":[0,0,0],"color":0,"uuid":"ee7748d0-5b3e-59a3-7df5-d010791b2142","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["023a3320-18c3-d968-3a13-56914da8e6f0",{"name":"bag","origin":[0,-9,0],"color":0,"uuid":"ca7f77db-f514-0ae5-d753-742da3da9103","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["1ca3a675-33f5-744f-58f9-cf14867dcfb1","90ba7ded-8e83-43de-e4da-bb237f43bdd7","741187ae-e05b-4c69-1555-99303f3e9f04","5cc3052b-c843-eec8-9326-2bfd1b1fd435","9a732bc0-bf4d-cc97-85fb-674e15c88c5c"]}]}],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/assets/models/hanging_sandbag.png","name":"hanging_sandbag.png","folder":"block","namespace":"","id":"0","width":32,"height":32,"uv_width":32,"uv_height":32,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"b9376c08-3fa3-5dae-fbe1-2efee48a6e4b","relative_path":"../hanging_sandbag.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABEJJREFUWEftlktPW0cUx//GMTUYCLYxvn6AX7HBOA0hYAPqolLbtKqiqKpYRF100U9QqZGqLKp+gKpdpNu2yrqVomwatYryUFoEBuM6DY/EUBPbubavL2CDH4QEbFczrl3bwb4hKekms7l37plzzm/O/GfmilCnLd7zFYiJZVno9fryqMQmB5PRVuUV41g4h94U1YvV6Htdp1g8VJAc/TcxCbK7xSKX38NXF69Uxfz80w+h11heDsCsZxo3JtnDByBLoDadqEoUWpoFGw1BqTLjpyu/lW2HUoH9AOotwcfnnP+9BgiAQqFAMBiC0WhAIpGgM97eSdFnNBKDVqcpV+G5RXh76ipV++5jQNbajie5NLgYTwObLUZsJbehYbTYfryJaISDvFOOXkMPNtYy6FYrsBpcxmYyBWlzG6SyJnTJtXTnkHcS59zEJw3FKfrx8qXC2LgLybUsVIwCTU0AG45DLD4CZXcbTaTvYSA5IoXvjhe53BOYzRbw8TVIX5NBoWpDJMwhmebRbzsOlVIDr8+Dk4OnMDVzE2dOf9QYwPuHu6DtUeHBagjHrBY6kznvDFpbZLDbB7Cy4ofV2ofNNI8VfxBSqRSOgeO471+E1WpFLp9DlI2D53n0O8xYDYQh71CivbMFyY0MRk6NNwa4futqweUcw+LSn3AMDCKZ4rDOpdEkFoHRdiEcjsBkMiCX20Mssk6XRt/LgH3I0co0S1qxsHAX2cw2XC4XUtl1CjE85ML09BTeO31WGMBqNVNatVYBWUsnZj1uNDeL0W+3I/KQg+6fJZif90EslsAx8Dr8K/fRb7NTUd69s0TBSAU6ZF2YX/JBp9U9WwWoBkbfoAEy6Sw6jrZR8YhEIsiV7VjnE+jrsyOd2QIf36Dj1BoleC6BRzuZIoz/HoLhVbzz1vuYm/PQMSMjTly/+YuwCEu7gDiRxIymmwYgyh4cPIFUegsRNkq/6fRaqhXyvbKRMZO/u6FUyjHqGqemmdlp+hTcBVWRAPy8EKLbstTUu0FomOKd8CKXTm2eUv8pgRCAsWPFhO6/WMjTATRLxWX/2gOHVLCyct9+d6sq1+VLXzcW4X4VqAQ4qdyjMy+1egDErlHrcPGHa9CpGTo8EufwXAC1S1DZ3w+A2EV5CXoNvTj/5fcHA2BjgYLX68HwsJPOlKx3KBiCwWgoCo8x49FOmr63SNsx6f61qmj5Qr6cnBgIQGV7pgosL/sLNltfea08vtuFepcLuaQq/5JMRgsCgQAsFgvN+yAYoHcBaZV/UiUfh32oShO0QwDIk0CUkk9MfDB64YvP3Bc0c1UzusGcf0pUocQ16m9QvHvgv6J9HQgECUiq8Db3TWFMXTwb3HEetQCl5CXKg0IIEgsBZHfZqnNDJtELxqwsqeBgAlDp8NIrUHtO1PYPvQJCAIeuASGAVxV4VQEhjQjZBc8BoQAvav/fAf4GYEkKP0m+kyEAAAAASUVORK5CYII="}],"fabricOptions":{"header":"package com.example.mod;","entity":"Entity","render":"","members":""}} \ No newline at end of file diff --git a/assets/models/hanging_sandbag.java b/assets/models/hanging_sandbag.java new file mode 100644 index 00000000..00cf4263 --- /dev/null +++ b/assets/models/hanging_sandbag.java @@ -0,0 +1,33 @@ +// Made with Blockbench 4.9.4 +// Exported for Minecraft version 1.17+ for Yarn +// Paste this class into your mod and generate all required imports +public class hanging_sandbag extends EntityModel { + private final ModelPart root; + private final ModelPart bag; + private final ModelPart cube_r1; + private final ModelPart cube_r2; + public hanging_sandbag(ModelPart root) { + this.root = root.getChild("root"); + } + public static TexturedModelData getTexturedModelData() { + ModelData modelData = new ModelData(); + ModelPartData modelPartData = modelData.getRoot(); + ModelPartData root = modelPartData.addChild("root", ModelPartBuilder.create().uv(16, 19).cuboid(-0.5F, 0.0F, -0.5F, 1.0F, 9.0F, 1.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 24.0F, 0.0F)); + + ModelPartData bag = root.addChild("bag", ModelPartBuilder.create().uv(0, 0).cuboid(-3.0F, 1.0F, -3.0F, 6.0F, 7.0F, 6.0F, new Dilation(0.0F)) + .uv(12, 14).cuboid(-2.0F, 0.0F, -2.0F, 4.0F, 1.0F, 4.0F, new Dilation(0.0F)) + .uv(0, 13).cuboid(-2.0F, 8.0F, -2.0F, 4.0F, 1.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 9.0F, 0.0F)); + + ModelPartData cube_r1 = bag.addChild("cube_r1", ModelPartBuilder.create().uv(0, 14).cuboid(0.0F, 8.0F, -2.0F, 0.0F, 4.0F, 4.0F, new Dilation(0.0F)), ModelTransform.of(0.0F, 1.0F, 0.0F, 0.0F, -0.7854F, 0.0F)); + + ModelPartData cube_r2 = bag.addChild("cube_r2", ModelPartBuilder.create().uv(0, 14).cuboid(0.0F, 8.0F, -2.0F, 0.0F, 4.0F, 4.0F, new Dilation(0.0F)), ModelTransform.of(0.0F, 1.0F, 0.0F, 0.0F, 0.7854F, 0.0F)); + return TexturedModelData.of(modelData, 32, 32); + } + @Override + public void setAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { + } + @Override + public void render(MatrixStack matrices, VertexConsumer vertexConsumer, int light, int overlay, float red, float green, float blue, float alpha) { + root.render(matrices, vertexConsumer, light, overlay, red, green, blue, alpha); + } +} \ No newline at end of file diff --git a/assets/models/hanging_sandbag.png b/assets/models/hanging_sandbag.png new file mode 100644 index 00000000..fdee304f Binary files /dev/null and b/assets/models/hanging_sandbag.png differ diff --git a/assets/models/hay_bale.json b/assets/models/hay_bale.json deleted file mode 100644 index a2ce1538..00000000 --- a/assets/models/hay_bale.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "textures": { - "top": "blocks/hay_block_top", - "particle": "blocks/hay_block_side", - "side": "blocks/hay_block_side" - }, - "elements": [ - { - "name": "bottom_south_east", - "from": [8, 0, 8], - "to": [16, 8, 16], - "faces": { - "north": {"uv": [0, 8, 8, 16], "texture": "#top"}, - "east": {"uv": [0, 8, 8, 16], "texture": "#side"}, - "south": {"uv": [8, 8, 16, 16], "texture": "#side"}, - "west": {"uv": [8, 8, 16, 16], "texture": "#top"}, - "up": {"uv": [8, 8, 16, 16], "texture": "#top"}, - "down": {"uv": [8, 0, 16, 8], "texture": "#top"} - } - }, - { - "name": "top_south_east", - "from": [8, 8, 8], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 8, 8], "texture": "#top"}, - "east": {"uv": [0, 0, 8, 8], "texture": "#side"}, - "south": {"uv": [8, 0, 16, 8], "texture": "#side"}, - "west": {"uv": [8, 0, 16, 8], "texture": "#top"}, - "up": {"uv": [8, 8, 16, 16], "texture": "#top"}, - "down": {"uv": [8, 0, 16, 8], "texture": "#top"} - } - }, - { - "name": "bottom_north_east", - "from": [8, 0, 0], - "to": [16, 8, 8], - "faces": { - "north": {"uv": [0, 8, 8, 16], "texture": "#side"}, - "east": {"uv": [8, 8, 16, 16], "texture": "#side"}, - "south": {"uv": [8, 8, 16, 16], "texture": "#top"}, - "west": {"uv": [0, 8, 8, 16], "texture": "#top"}, - "up": {"uv": [8, 0, 16, 8], "texture": "#top"}, - "down": {"uv": [8, 8, 16, 16], "texture": "#top"} - } - }, - { - "name": "top_north_east", - "from": [8, 8, 0], - "to": [16, 16, 8], - "faces": { - "north": {"uv": [0, 0, 8, 8], "texture": "#side"}, - "east": {"uv": [8, 0, 16, 8], "texture": "#side"}, - "south": {"uv": [8, 0, 16, 8], "texture": "#top"}, - "west": {"uv": [0, 0, 8, 8], "texture": "#top"}, - "up": {"uv": [8, 0, 16, 8], "texture": "#top"}, - "down": {"uv": [8, 8, 16, 16], "texture": "#top"} - } - }, - { - "name": "bottom_south_west", - "from": [0, 0, 8], - "to": [8, 8, 16], - "faces": { - "north": {"uv": [8, 8, 16, 16], "texture": "#top"}, - "east": {"uv": [0, 8, 8, 16], "texture": "#top"}, - "south": {"uv": [0, 8, 8, 16], "texture": "#side"}, - "west": {"uv": [8, 8, 16, 16], "texture": "#side"}, - "up": {"uv": [0, 8, 8, 16], "texture": "#top"}, - "down": {"uv": [0, 0, 8, 8], "texture": "#top"} - } - }, - { - "name": "top_south_west", - "from": [0, 8, 8], - "to": [8, 16, 16], - "faces": { - "north": {"uv": [8, 0, 16, 8], "texture": "#top"}, - "east": {"uv": [0, 0, 8, 8], "texture": "#top"}, - "south": {"uv": [0, 0, 8, 8], "texture": "#side"}, - "west": {"uv": [8, 0, 16, 8], "texture": "#side"}, - "up": {"uv": [0, 8, 8, 16], "texture": "#top"}, - "down": {"uv": [0, 0, 8, 8], "texture": "#top"} - } - }, - { - "name": "bottom_north_west", - "from": [0, 0, 0], - "to": [8, 8, 8], - "faces": { - "north": {"uv": [8, 8, 16, 16], "texture": "#side"}, - "east": {"uv": [8, 8, 16, 16], "texture": "#top"}, - "south": {"uv": [0, 8, 8, 16], "texture": "#top"}, - "west": {"uv": [0, 8, 8, 16], "texture": "#side"}, - "up": {"uv": [0, 0, 8, 8], "texture": "#top"}, - "down": {"uv": [0, 8, 8, 16], "texture": "#top"} - } - }, - { - "name": "top_north_west", - "from": [0, 8, 0], - "to": [8, 16, 8], - "faces": { - "north": {"uv": [8, 0, 16, 8], "texture": "#side"}, - "east": {"uv": [8, 0, 16, 8], "texture": "#top"}, - "south": {"uv": [0, 0, 8, 8], "texture": "#top"}, - "west": {"uv": [0, 0, 8, 8], "texture": "#side"}, - "up": {"uv": [0, 0, 8, 8], "texture": "#top"}, - "down": {"uv": [0, 8, 8, 16], "texture": "#top"} - } - } - ] -} \ No newline at end of file diff --git a/assets/models/jar.bbmodel b/assets/models/jar.bbmodel new file mode 100644 index 00000000..39fe3bb8 --- /dev/null +++ b/assets/models/jar.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.9","model_format":"java_block","box_uv":false},"name":"jar","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[4,0,4],"to":[12,12,12],"autouv":0,"color":3,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,8,12],"texture":0},"east":{"uv":[0,0,8,12],"texture":0},"south":{"uv":[0,0,8,12],"texture":0},"west":{"uv":[0,0,8,12],"texture":0},"up":{"uv":[8,0,16,8],"texture":0},"down":{"uv":[8,0,16,8],"texture":0}},"type":"cube","uuid":"c02d32c0-74ac-27ba-627e-83de2a9500f7"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,13,6],"to":[10,16,10],"autouv":0,"color":3,"origin":[0,0,0],"faces":{"north":{"uv":[0,4,4,7],"texture":1},"east":{"uv":[0,4,4,7],"texture":1},"south":{"uv":[0,4,4,7],"texture":1},"west":{"uv":[0,4,4,7],"texture":1},"up":{"uv":[0,0,4,4],"texture":1},"down":{"uv":[4,0,8,4],"texture":1}},"type":"cube","uuid":"147c96d5-ae15-7e40-dcb7-c635e6e80eed"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[5,13,5],"to":[11,14,11],"autouv":0,"color":3,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,8,1],"texture":0},"east":{"uv":[0,0,8,1],"texture":0},"south":{"uv":[0,0,8,1],"texture":0},"west":{"uv":[0,0,8,1],"texture":0},"up":{"uv":[8,0,16,8],"texture":0},"down":{"uv":[8,0,16,8],"texture":0}},"type":"cube","uuid":"7642fef8-ce7e-d79f-f450-01de2526fca5"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,12,6],"to":[10,13,10],"autouv":0,"color":3,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,8,1],"texture":0},"east":{"uv":[0,0,8,1],"texture":0},"south":{"uv":[0,0,8,1],"texture":0},"west":{"uv":[0,0,8,1],"texture":0},"up":{"uv":[8,0,16,8],"texture":0},"down":{"uv":[8,0,16,8],"texture":0}},"type":"cube","uuid":"e1e878a3-7fdb-79f6-e2c8-b591a94cec41"}],"outliner":["c02d32c0-74ac-27ba-627e-83de2a9500f7","7642fef8-ce7e-d79f-f450-01de2526fca5","e1e878a3-7fdb-79f6-e2c8-b591a94cec41","147c96d5-ae15-7e40-dcb7-c635e6e80eed"],"textures":[{"path":"","name":"body","folder":"block","namespace":"","id":"0","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":true,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":false,"uuid":"c3fc3ff5-2bb6-a5d1-88ff-7d0d48a4200c","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAKxJREFUOE/Nk70NxCAMhe0qiCKCCRiA/UdhAFgARIGg8sknJbpI/CS6K47Sz/54fggkIoLJCSHAvu+glLp0pZQg5wwYYyStNfYYrHGdhxHx0sMXM+QEHIVPGAN6w8dlPHMCek4eAUYrLB1478kYM8zga8AyxJkD1hgwfcYVYLTekRk658ha281gpv0WUEqBWiu01t7gbdtACAFSShi5Ox3M/sEdrbv7ncH/cfACoGWX3cV5e7AAAAAASUVORK5CYII="},{"path":"","name":"cork","folder":"block","namespace":"","id":"1","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":false,"uuid":"1faf1369-230e-ed4a-f210-037c1820f194","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAFJJREFUOE9jXDwj8z8DHhCbMZ0RnzwjyABRYW6wmtdvv4JpZD59DKDICztWl6CEgUdoD14/o1sGDgNkQUJ+pr4B+PxPjBxJ/sVm4KgBDAzDIAwAlBIoEQohE0IAAAAASUVORK5CYII="}]} \ No newline at end of file diff --git a/assets/models/jar_body.png b/assets/models/jar_body.png new file mode 100644 index 00000000..99e38ba2 Binary files /dev/null and b/assets/models/jar_body.png differ diff --git a/assets/models/jar_cloud.bbmodel b/assets/models/jar_cloud.bbmodel new file mode 100644 index 00000000..eafb6e23 --- /dev/null +++ b/assets/models/jar_cloud.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.9","model_format":"java_block","box_uv":false},"name":"jar_cloud","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[5,6,5],"to":[10,9,9],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"e15b3907-6195-1f3b-0c48-23c6b4642fc6"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,4,7],"to":[12,7,11],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"e61fcd01-8143-912a-1b70-663d7f7ec80b"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,8,7],"to":[10,10,10],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"f61cf32c-8485-4809-93a4-7eca7767fc5f"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,7,8],"to":[11,9,11],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"a073f455-b48b-6520-5323-081195bb2d1c"}],"outliner":["e15b3907-6195-1f3b-0c48-23c6b4642fc6","e61fcd01-8143-912a-1b70-663d7f7ec80b","f61cf32c-8485-4809-93a4-7eca7767fc5f","a073f455-b48b-6520-5323-081195bb2d1c"],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/assets/models/body.png","name":"body.png","folder":"","namespace":"","id":"0","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":true,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"c3fc3ff5-2bb6-a5d1-88ff-7d0d48a4200c","relative_path":"../body.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAKxJREFUOE/Nk70NxCAMhe0qiCKCCRiA/UdhAFgARIGg8sknJbpI/CS6K47Sz/54fggkIoLJCSHAvu+glLp0pZQg5wwYYyStNfYYrHGdhxHx0sMXM+QEHIVPGAN6w8dlPHMCek4eAUYrLB1478kYM8zga8AyxJkD1hgwfcYVYLTekRk658ha281gpv0WUEqBWiu01t7gbdtACAFSShi5Ox3M/sEdrbv7ncH/cfACoGWX3cV5e7AAAAAASUVORK5CYII="},{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/assets/models/cork.png","name":"cork.png","folder":"","namespace":"","id":"1","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"1faf1369-230e-ed4a-f210-037c1820f194","relative_path":"../cork.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAFJJREFUOE9jXDwj8z8DHhCbMZ0RnzwjyABRYW6wmtdvv4JpZD59DKDICztWl6CEgUdoD14/o1sGDgNkQUJ+pr4B+PxPjBxJ/sVm4KgBDAzDIAwAlBIoEQohE0IAAAAASUVORK5CYII="},{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/src/main/resources/assets/unicopia/textures/block/cloud.png","name":"cloud.png","folder":"block","namespace":"unicopia","id":"2","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"4b51168a-586d-848e-b665-d127c0ae4c59","relative_path":"../../../src/main/resources/assets/unicopia/textures/block/cloud.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAhdJREFUOE8tk9tu3DAMRIc3OQ36/5+YAt3nNLZ4K6gEC+waWmpInhnT/XX/JaYwMasuUBNICHEHmtpRABjU3HrZBSRQ86FyFTVy95ffDhFxWUIM1hGYi02N7vaf/01FAQVih+tSmxq6v+4XAFxvl+eTAE2TBIPnGBWFlkZmCjA/iWtdtK6lR6CiXqe2gO3buxvMjGULn/8+Rxh1F9bvZRGB+75dVfXN3ggNUHj8FRaasZr6jElEszciw/feeH9/n2Fsvvbe4e4tJDZMqLM/Gg1/nMzs7D+bjzoIIzxgU990VsBMUVXu26GmdlYgJi+vAaTuTpdeh8WcsfGZBgmHfE/h7gfuPFM88WeA7dg9HUmolyx79oPruhAemLUGXiL9wMupBB5/mqrqYxTXWqM+VVJZEYg2Ma2uMRNMjKw8nY3NzhkzqHa9PP1buUAQIJ5wEpL0TL10LOVCMYNpnFJWY+Xj3EB8RURkZ49y1eSxYlJ2nqpcSPDEg4WFkjrTUJNiDBsBAD32DFUW7ngiVNVmz0M+A5XlUXG4nMA1EAhQer6mk7IO7dx7zyJYuqyrkZ0Qlv76/Irr18UiInP5uR/fvkGZ+TovzITRy8cyXToFZmaoXZHI7mzQomOjsJxMT2rPy9QDgLoO1SYWFex71wnTCJqio42MhslpNraeKP8EKbuaJwZjzxRN0tg4qCbXkHHjXAAdJsSEgfsfRk6kufetOaoAAAAASUVORK5CYII="}]} \ No newline at end of file diff --git a/assets/models/jar_cork.png b/assets/models/jar_cork.png new file mode 100644 index 00000000..c87771fa Binary files /dev/null and b/assets/models/jar_cork.png differ diff --git a/assets/models/jar_lightning.bbmodel b/assets/models/jar_lightning.bbmodel new file mode 100644 index 00000000..f39c2696 --- /dev/null +++ b/assets/models/jar_lightning.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.9","model_format":"java_block","box_uv":false},"name":"jar","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"cube","box_uv":false,"rescale":true,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,1,7.5],"to":[11,11,7.5],"autouv":0,"color":5,"rotation":[0,-45,0],"origin":[8,5,7],"faces":{"north":{"uv":[3,0,13,16],"texture":0},"east":{"uv":[0,0,0,8],"texture":0},"south":{"uv":[3,0,13,16],"texture":0},"west":{"uv":[0,0,0,8],"texture":0},"up":{"uv":[0,0,6,0],"texture":0},"down":{"uv":[0,0,6,0],"texture":0}},"type":"cube","uuid":"52fdb109-7055-1f3c-d1a1-788daf976643"},{"name":"cube","box_uv":false,"rescale":true,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[5,1,7.5],"to":[10,11,7.5],"autouv":0,"color":5,"rotation":[0,45,0],"origin":[8,5,7],"faces":{"north":{"uv":[3,0,13,16],"texture":0},"east":{"uv":[0,0,0,8],"texture":0},"south":{"uv":[3,0,13,16],"texture":0},"west":{"uv":[0,0,0,8],"texture":0},"up":{"uv":[0,0,6,0],"rotation":180,"texture":0},"down":{"uv":[0,0,6,0],"rotation":180,"texture":0}},"type":"cube","uuid":"67ba2407-52e4-4b13-579c-0e7675265bb9"}],"outliner":["52fdb109-7055-1f3c-d1a1-788daf976643","67ba2407-52e4-4b13-579c-0e7675265bb9"],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/src/main/resources/assets/unicopia/textures/block/lightning_jar_filling.png","name":"lightning_jar_filling.png","folder":"block","namespace":"unicopia","id":"2","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"2c8fdd18-9bd4-2276-cdc1-d86d0605d22d","relative_path":"../../../src/main/resources/assets/unicopia/textures/block/lightning_jar_filling.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAN9JREFUOE9jZCASOH7T/L+f6zojunIMAWzmObxR/c/IxcJAlgE+3/X+f/j7l4GV6R/pBnh/0vv/59d/hl9cf7BqBrkWrxdABnxj+Y1TM14DQJq//vrOwMfLz7CJ/QxOi7BKgEKc5wcLw3u2fwxHeK6C1YDEuP6wMqC7CKcB2GIDZMBWvksoejAMANmErBnkEhD4zP6bgZGRESM88BoA1/zvBzi8D4jcwp+QkG0HJRrfd7pg14DCgqh0ADMApBnEZvsGcT5Z6QBXqBOVF9C9gi+/4Y1GbJmHoAuQw4GYnA4AMBBxEZobGUEAAAAASUVORK5CYII="}]} \ No newline at end of file diff --git a/assets/models/jar_storm.bbmodel b/assets/models/jar_storm.bbmodel new file mode 100644 index 00000000..3ee878d8 --- /dev/null +++ b/assets/models/jar_storm.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.9","model_format":"java_block","box_uv":false},"name":"jar_storm_filling","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[4,3,4],"to":[12,12,12],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"e15b3907-6195-1f3b-0c48-23c6b4642fc6"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7,11,6],"to":[13,14,10],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"e61fcd01-8143-912a-1b70-663d7f7ec80b"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,10,7],"to":[10,12,10],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"f61cf32c-8485-4809-93a4-7eca7767fc5f"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,11,9],"to":[11,13,12],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"a073f455-b48b-6520-5323-081195bb2d1c"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,2,5],"to":[11,3,11],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"270a4b70-37c8-136b-85d0-e186bd708f62"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[11,10,9],"to":[13,12,11],"autouv":0,"color":4,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"3a116052-9d62-8f73-d2d8-837d1d62034d"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[3,10,7],"to":[9,13,11],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"b44d335b-bf61-43f1-716a-96162ec518e1"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[3,9,10],"to":[5,11,12],"autouv":0,"color":4,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"1ff98e2a-8af2-ce16-f77f-722bfbd4e54d"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[9,13,7],"to":[11,15,9],"autouv":0,"color":4,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"82323752-a2cf-00dd-ded9-484b51159718"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[5,13,7],"to":[7,15,9],"autouv":0,"color":4,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"371b718c-e1ab-72e8-dd9b-d371f2376c2d"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[3,8,5],"to":[5,10,7],"autouv":0,"color":4,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"74432963-3560-b367-6fc7-5b692d8d346d"}],"outliner":["e15b3907-6195-1f3b-0c48-23c6b4642fc6","270a4b70-37c8-136b-85d0-e186bd708f62","e61fcd01-8143-912a-1b70-663d7f7ec80b","1ff98e2a-8af2-ce16-f77f-722bfbd4e54d","b44d335b-bf61-43f1-716a-96162ec518e1","3a116052-9d62-8f73-d2d8-837d1d62034d","82323752-a2cf-00dd-ded9-484b51159718","371b718c-e1ab-72e8-dd9b-d371f2376c2d","74432963-3560-b367-6fc7-5b692d8d346d","f61cf32c-8485-4809-93a4-7eca7767fc5f","a073f455-b48b-6520-5323-081195bb2d1c"],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/assets/models/body.png","name":"body.png","folder":"","namespace":"","id":"0","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":true,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"c3fc3ff5-2bb6-a5d1-88ff-7d0d48a4200c","relative_path":"../body.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAKxJREFUOE/Nk70NxCAMhe0qiCKCCRiA/UdhAFgARIGg8sknJbpI/CS6K47Sz/54fggkIoLJCSHAvu+glLp0pZQg5wwYYyStNfYYrHGdhxHx0sMXM+QEHIVPGAN6w8dlPHMCek4eAUYrLB1478kYM8zga8AyxJkD1hgwfcYVYLTekRk658ha281gpv0WUEqBWiu01t7gbdtACAFSShi5Ox3M/sEdrbv7ncH/cfACoGWX3cV5e7AAAAAASUVORK5CYII="},{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/assets/models/cork.png","name":"cork.png","folder":"","namespace":"","id":"1","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"1faf1369-230e-ed4a-f210-037c1820f194","relative_path":"../cork.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAFJJREFUOE9jXDwj8z8DHhCbMZ0RnzwjyABRYW6wmtdvv4JpZD59DKDICztWl6CEgUdoD14/o1sGDgNkQUJ+pr4B+PxPjBxJ/sVm4KgBDAzDIAwAlBIoEQohE0IAAAAASUVORK5CYII="},{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/src/main/resources/assets/unicopia/textures/block/cloud.png","name":"cloud.png","folder":"block","namespace":"unicopia","id":"2","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"4b51168a-586d-848e-b665-d127c0ae4c59","relative_path":"../../../src/main/resources/assets/unicopia/textures/block/cloud.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAhdJREFUOE8tk9tu3DAMRIc3OQ36/5+YAt3nNLZ4K6gEC+waWmpInhnT/XX/JaYwMasuUBNICHEHmtpRABjU3HrZBSRQ86FyFTVy95ffDhFxWUIM1hGYi02N7vaf/01FAQVih+tSmxq6v+4XAFxvl+eTAE2TBIPnGBWFlkZmCjA/iWtdtK6lR6CiXqe2gO3buxvMjGULn/8+Rxh1F9bvZRGB+75dVfXN3ggNUHj8FRaasZr6jElEszciw/feeH9/n2Fsvvbe4e4tJDZMqLM/Gg1/nMzs7D+bjzoIIzxgU990VsBMUVXu26GmdlYgJi+vAaTuTpdeh8WcsfGZBgmHfE/h7gfuPFM88WeA7dg9HUmolyx79oPruhAemLUGXiL9wMupBB5/mqrqYxTXWqM+VVJZEYg2Ma2uMRNMjKw8nY3NzhkzqHa9PP1buUAQIJ5wEpL0TL10LOVCMYNpnFJWY+Xj3EB8RURkZ49y1eSxYlJ2nqpcSPDEg4WFkjrTUJNiDBsBAD32DFUW7ngiVNVmz0M+A5XlUXG4nMA1EAhQer6mk7IO7dx7zyJYuqyrkZ0Qlv76/Irr18UiInP5uR/fvkGZ+TovzITRy8cyXToFZmaoXZHI7mzQomOjsJxMT2rPy9QDgLoO1SYWFex71wnTCJqio42MhslpNraeKP8EKbuaJwZjzxRN0tg4qCbXkHHjXAAdJsSEgfsfRk6kufetOaoAAAAASUVORK5CYII="}]} \ No newline at end of file diff --git a/assets/models/jar_zap.bbmodel b/assets/models/jar_zap.bbmodel new file mode 100644 index 00000000..e0feb017 --- /dev/null +++ b/assets/models/jar_zap.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.9","model_format":"java_block","box_uv":false},"name":"jar","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[4,0,4],"to":[12,10,12],"autouv":0,"color":4,"inflate":-0.09999999999999964,"origin":[0,0,0],"faces":{"north":{"uv":[0,2,8,12],"texture":2},"east":{"uv":[0,6,8,16],"texture":2},"south":{"uv":[8,6,16,16],"texture":2},"west":{"uv":[8,0,16,10],"texture":2},"up":{"uv":[4,3,12,11],"texture":2},"down":{"uv":[8,4,16,12],"texture":2}},"type":"cube","uuid":"e15b3907-6195-1f3b-0c48-23c6b4642fc6"}],"outliner":["e15b3907-6195-1f3b-0c48-23c6b4642fc6"],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/assets/models/body.png","name":"body.png","folder":"","namespace":"","id":"0","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":true,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"c3fc3ff5-2bb6-a5d1-88ff-7d0d48a4200c","relative_path":"../body.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAKxJREFUOE/Nk70NxCAMhe0qiCKCCRiA/UdhAFgARIGg8sknJbpI/CS6K47Sz/54fggkIoLJCSHAvu+glLp0pZQg5wwYYyStNfYYrHGdhxHx0sMXM+QEHIVPGAN6w8dlPHMCek4eAUYrLB1478kYM8zga8AyxJkD1hgwfcYVYLTekRk658ha281gpv0WUEqBWiu01t7gbdtACAFSShi5Ox3M/sEdrbv7ncH/cfACoGWX3cV5e7AAAAAASUVORK5CYII="},{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/assets/models/cork.png","name":"cork.png","folder":"","namespace":"","id":"1","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"1faf1369-230e-ed4a-f210-037c1820f194","relative_path":"../cork.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAFJJREFUOE9jXDwj8z8DHhCbMZ0RnzwjyABRYW6wmtdvv4JpZD59DKDICztWl6CEgUdoD14/o1sGDgNkQUJ+pr4B+PxPjBxJ/sVm4KgBDAzDIAwAlBIoEQohE0IAAAAASUVORK5CYII="},{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Unicopia/src/main/resources/assets/unicopia/textures/item/jar_filling_zap.png","name":"jar_filling_zap.png","folder":"item","namespace":"unicopia","id":"2","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":false,"uuid":"62c06d20-77c5-befb-bb95-8e5da5394d9c","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAudJREFUOE8dkUlrXWUYgJ/3G849J7dJSxZuG2s6aMDaUsWWNjVpBS2luHDtyp1UcOhfEKTZ1LYIURQXjQYkEkwduhVd6S8oxUXAJpCBeO/NGb7hlfgPnkHOmvfUiMepBwJ3ph0ej3YRPew5+9UnSN9CY4gnL0FpcBo5vzjCeEHOmA9UJaBJuTftKHAUGeoqc/7BPTgUyPsgJ+boTEEkU6rj3OJTysIiZ/37moPly5mSnjEgBYN2n5d/+RSXgAQ5QDw5R2GFQWOZ/WIL6Ql2lJFz9iNdfM4zsg3jFAy6louP7kMRyZ2AgfqZWXAlRlsuLw7wpdDEQH10Ffnj+C31PY+2LT4Lp79fgBIkQZICfeEyQSsYNlxZ3mX4b83EkYqm6Rge/wn569SHqjZRq+fC6gK66Vgff5ep9A3MzLLTBY5UgVcXa1KKRBImQH5xDVGH/Pn8LTUkXvr5M1I0uKbj73yTZ48/IfmEsZFXvt6jGAniDYOwTz72A9rvQzbI76c+1gs/3icMa/wERAE3dYOailwPmFvbxu5kJBz0F0ZnVkl1S9Xr0wWD6GOUCCogCvnYWxjfgkZeX27Y3tzDO0cMGTPzkNh3tHVNUULvtbtIfoKKeNLUVYwYJEW6kePGbyM2Hm9RVI5oDGlqhewMgsWKoXd1gUiH1GFeSyvQjJGrhjeWO/55uoVTh+9bjGTs9K80YmhDTRk69PodnPW0MSIarimu4NrKiO31baJP9IqCHJV4Yol8gC8lsR5Qjo1Tzt2mIRNjwHhF3vzuinaaECvs7uxgjaE6+pCNPGRsYpxcJ9QbNAYmr37Org7pmTFaavyB8vzSrDpbsbe5RVNF3NEVovXQtPjeIVpa3t7cYO2dbzHqyKYhqSekfUpXIReXLqlJke3JB7geqHdIryDWSmkjxlYcnr/NXmhIVrCq/H/NZBwVcvrRunYSKLGkImOi4LynDcrk9bsMm33koIFrKUIP1Y7sWqz0ydLyH7DGczPZHbGfAAAAAElFTkSuQmCC","relative_path":"../../../src/main/resources/assets/unicopia/textures/item/jar_filling_zap.png"}]} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2f3e4ae1..d2fa4e91 100644 --- a/build.gradle +++ b/build.gradle @@ -27,18 +27,13 @@ archivesBaseName = project.name loom { mixin.defaultRefmapName = 'unicopia.mixin.refmap.json' accessWidenerPath = file('src/main/resources/unicopia.aw') - runs { - datagen { - server() - name "Data Generation" - vmArg "-Dfabric-api.datagen" - vmArg "-Dfabric-api.datagen.modid=unicopia" - vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}" - runDir "build/datagen" - } +} + +fabricApi { + configureDataGeneration { + modId = 'unicopia' } } -//assemble.dependsOn(runDatagen) reckon { scopeFromProp() @@ -48,13 +43,15 @@ reckon { repositories { mavenLocal() flatDir { dirs 'lib' } - maven { name 'entity-reach-attributes'; url 'https://maven.jamieswhiteshirt.com/libs-release' } + maven { name 'entity-reach-attributes'; url 'https://maven.jamieswhiteshirt.com/libs-release'; content { includeGroup "com.jamieswhiteshirt" } } maven { name 'trinkets'; url 'https://maven.ladysnake.org/releases' } maven { name 'mod-menu'; url 'https://maven.terraformersmc.com/' } maven { name 'minelp-snapshot'; url 'https://repo.minelittlepony-mod.com/maven/snapshot' } maven { name 'minelp-releases'; url 'https://repo.minelittlepony-mod.com/maven/release' } maven { name 'TerraformersMC'; url 'https://maven.terraformersmc.com/' } maven { name 'Nodium'; url 'https://maven.cafeteria.dev/releases/' } + maven { name 'Greenhouse Maven For Farmers delight'; url 'https://maven.greenhouseteam.dev/releases/' } + maven { name 'Porting Lib For Farmers delight'; url = 'https://mvn.devos.one/releases/' } maven { name 'Modrinth'; url 'https://api.modrinth.com/maven' } maven { name 'JitPack'; url 'https://jitpack.io'; content { includeGroup "com.github.Virtuoel" } } } @@ -86,11 +83,13 @@ dependencies { modImplementation "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraformer_api_version}" include "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraformer_api_version}" - + modImplementation "me.luligabi:NoIndium:${project.nodium_version}" include "me.luligabi:NoIndium:${project.nodium_version}" - //modCompileOnly "maven.modrinth:farmers-delight-fabric:${project.farmers_delight_version}", { exclude group: "net.fabricmc.fabric-api" } + //modImplementation "vectorwing:FarmersDelight-Refabricated:${project.farmers_delight_version}", { + // exclude group: "net.fabricmc" + //} if (project.use_pehkui == '1') { modCompileOnly "maven.modrinth:pehkui:${project.pehkui_version}", { exclude group: "net.fabricmc.fabric-api" } modCompileOnly "com.github.Virtuoel:KanosConfig:0.4.1", { exclude group: "net.fabricmc.fabric-api" } @@ -109,12 +108,8 @@ dependencies { } } -sourceSets { - main { - resources { - srcDirs += [ "src/main/generated" ] - } - } +remapJar { + addNestedDependencies = true } processResources { diff --git a/gradle.properties b/gradle.properties index f377da28..0427e604 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,7 +33,7 @@ org.gradle.daemon=false use_pehkui=0 use_sodium=1 - farmers_delight_version=1.4.3 + farmers_delight_version=1.20.1-2.0.9 pehkui_version=3.7.8+1.14.4-1.20.4 iris_version=1.6.17+1.20.4 sodium_version=mc1.20.4-0.5.8 diff --git a/src/main/java/com/minelittlepony/unicopia/Debug.java b/src/main/java/com/minelittlepony/unicopia/Debug.java index 8cc8847e..2e3533df 100644 --- a/src/main/java/com/minelittlepony/unicopia/Debug.java +++ b/src/main/java/com/minelittlepony/unicopia/Debug.java @@ -51,7 +51,7 @@ public interface Debug { )).forEach((namespace, entries) -> { @SuppressWarnings("deprecation") var unregistered = entries.stream() - .filter(entry -> !entry.getValue().getRegistryEntry().isIn(UTags.HAS_NO_TRAITS) && SpellTraits.of(entry.getValue()).isEmpty()) + .filter(entry -> !entry.getValue().getRegistryEntry().isIn(UTags.Items.HAS_NO_TRAITS) && SpellTraits.of(entry.getValue()).isEmpty()) .map(entry -> { String id = entry.getKey().getValue().toString(); diff --git a/src/main/java/com/minelittlepony/unicopia/EquineContext.java b/src/main/java/com/minelittlepony/unicopia/EquineContext.java index bea77626..d9dd0a9f 100644 --- a/src/main/java/com/minelittlepony/unicopia/EquineContext.java +++ b/src/main/java/com/minelittlepony/unicopia/EquineContext.java @@ -22,14 +22,19 @@ public interface EquineContext { } default boolean collidesWithClouds() { - return getCompositeRace().any(Race::canInteractWithClouds); + return getCompositeRace().canInteractWithClouds(); + } + + default boolean hasFeatherTouch() { + return false; } static EquineContext of(ShapeContext context) { if (context == ShapeContext.absent()) { return Unicopia.SIDE.getPony().map(EquineContext.class::cast).orElse(ABSENT); } - return context instanceof EquineContext c ? c : ABSENT; + EquineContext result = context instanceof Container c ? c.get() : ABSENT; + return result == null ? ABSENT : result; } static EquineContext of(ItemUsageContext context) { @@ -42,4 +47,8 @@ public interface EquineContext { } return MoreObjects.firstNonNull(Equine.of(entity).orElse(null), ABSENT); } + + interface Container { + EquineContext get(); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java index 6286b123..2e67d2c2 100644 --- a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java +++ b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java @@ -20,7 +20,7 @@ public interface EquinePredicates { Predicate BAT = physicalRaceMatches(Race.BAT::equals); Predicate CHANGELING = physicalRaceMatches(Race.CHANGELING::equals); - Predicate RACE_INTERACT_WITH_CLOUDS = raceMatches(Race::canInteractWithClouds); + Predicate RACE_CAN_INFLUENCE_WEATHER = raceMatches(Race::canInfluenceWeather); Predicate RAGING = IS_PLAYER.and(SpellType.RAGE::isOn); Predicate PLAYER_EARTH = IS_PLAYER.and(ofRace(Race.EARTH)); @@ -28,7 +28,6 @@ public interface EquinePredicates { Predicate PLAYER_UNICORN = IS_PLAYER.and(raceMatches(Race::canCast)); Predicate PLAYER_CHANGELING = IS_PLAYER.and(ofRace(Race.CHANGELING)); Predicate PLAYER_KIRIN = IS_PLAYER.and(ofRace(Race.KIRIN)); - Predicate PLAYER_PEGASUS = IS_PLAYER.and(e -> ((PlayerEntity)e).getAbilities().creativeMode || RACE_INTERACT_WITH_CLOUDS.test(e)); Predicate PLAYER_SEAPONY = IS_PLAYER.and(raceMatches(Race::isFish)); Predicate PLAYER_CAN_USE_EARTH = IS_PLAYER.and(raceMatches(Race::canUseEarth)); diff --git a/src/main/java/com/minelittlepony/unicopia/InteractionManager.java b/src/main/java/com/minelittlepony/unicopia/InteractionManager.java index 7c60d0d5..e0848e1a 100644 --- a/src/main/java/com/minelittlepony/unicopia/InteractionManager.java +++ b/src/main/java/com/minelittlepony/unicopia/InteractionManager.java @@ -14,6 +14,8 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.PacketByteBuf; import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; import net.minecraft.world.World; public class InteractionManager { @@ -90,4 +92,8 @@ public class InteractionManager { public void sendPlayerLookAngles(PlayerEntity player) { } + + public void addBlockBreakingParticles(BlockPos pos, Direction direction) { + + } } diff --git a/src/main/java/com/minelittlepony/unicopia/Race.java b/src/main/java/com/minelittlepony/unicopia/Race.java index a6d73d72..dd3bf4d9 100644 --- a/src/main/java/com/minelittlepony/unicopia/Race.java +++ b/src/main/java/com/minelittlepony/unicopia/Race.java @@ -80,7 +80,7 @@ public record Race (Supplier compositeSupplier, Availability availabi } public boolean hasIronGut() { - return !isHuman() && this != CHANGELING; + return !isHuman(); } public boolean isUnset() { @@ -108,9 +108,17 @@ public record Race (Supplier compositeSupplier, Availability availabi } public boolean canInteractWithClouds() { + return canFly() && this != CHANGELING; + } + + public boolean canInfluenceWeather() { return canFly() && this != CHANGELING && this != BAT && this != HIPPOGRIFF; } + public boolean hasPersistentWeatherMagic() { + return canInfluenceWeather(); + } + public Identifier getId() { return REGISTRY.getId(this); } @@ -225,6 +233,18 @@ public record Race (Supplier compositeSupplier, Availability availabi return any(Race::canCast); } + public boolean canInteractWithClouds() { + return any(Race::canInteractWithClouds); + } + + public boolean canInfluenceWeather() { + return any(Race::canInfluenceWeather); + } + + public boolean hasPersistentWeatherMagic() { + return any(Race::hasPersistentWeatherMagic); + } + public FlightType flightType() { if (pseudo() == null) { return physical().flightType(); diff --git a/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java b/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java index e1a0a0b1..6b54e607 100644 --- a/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java +++ b/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java @@ -7,32 +7,64 @@ import net.minecraft.registry.tag.TagKey; import net.minecraft.util.Identifier; public interface UConventionalTags { - TagKey APPLES = item("apples"); - TagKey ACORNS = item("acorns"); - TagKey PINECONES = item("pinecones"); - TagKey PINEAPPLES = item("pineapples"); - TagKey BANANAS = item("bananas"); - TagKey STICKS = item("sticks"); - TagKey SEEDS = item("seeds"); - TagKey GRAIN = item("grain"); - TagKey NUTS = item("nuts"); - TagKey MUSHROOMS = item("mushrooms"); - TagKey MUFFINS = item("muffins"); - TagKey MANGOES = item("mangoes"); - TagKey OEATMEALS = item("oatmeals"); + interface Blocks { + TagKey CONCRETE_POWDERS = block("concrete_powders"); + TagKey CONCRETES = block("concretes"); + TagKey GLAZED_TERRACOTTAS = block("glazed_terracottas"); + TagKey CORAL_BLOCKS = block("coral_blocks"); + TagKey CORAL_FANS = block("coral_fans"); + TagKey CORALS = block("corals"); - TagKey FRUITS = item("fruits"); - - TagKey COOKED_FISH = item("cooked_fish"); - - TagKey CROPS_PEANUTS = item("crops/peanuts"); - TagKey TOOL_KNIVES = item("tools/knives"); - - static TagKey item(String name) { - return TagKey.of(RegistryKeys.ITEM, new Identifier("c", name)); + private static TagKey block(String name) { + return TagKey.of(RegistryKeys.BLOCK, new Identifier("c", name)); + } } - static TagKey block(String name) { - return TagKey.of(RegistryKeys.BLOCK, new Identifier("c", name)); + interface Items { + TagKey CONCRETE_POWDERS = item("concrete_powders"); + TagKey CONCRETES = item("concretes"); + TagKey GLAZED_TERRACOTTAS = item("glazed_terracottas"); + TagKey CORAL_BLOCKS = item("coral_blocks"); + TagKey CORAL_FANS = item("coral_fans"); + TagKey CORALS = item("corals"); + + TagKey APPLES = item("apples"); + TagKey ACORNS = item("acorns"); + TagKey PINECONES = item("pinecones"); + TagKey PINEAPPLES = item("pineapples"); + TagKey BANANAS = item("bananas"); + TagKey STICKS = item("sticks"); + TagKey SEEDS = item("seeds"); + TagKey GRAIN = item("grain"); + TagKey NUTS = item("nuts"); + TagKey MUSHROOMS = item("mushrooms"); + TagKey MUFFINS = item("muffins"); + TagKey MANGOES = item("mangoes"); + TagKey OATMEALS = item("oatmeals"); + TagKey COOKIES = item("cookies"); + + TagKey FRUITS = item("fruits"); + TagKey WORMS = item("worms"); + TagKey ROCKS = item("rocks"); + + TagKey RAW_INSECT = item("raw_insect"); + TagKey COOKED_INSECT = item("cooked_insect"); + TagKey ROTTEN_INSECT = item("rotten_insect"); + + TagKey RAW_FISH = item("raw_fish"); + TagKey COOKED_FISH = item("cooked_fish"); + TagKey ROTTEN_FISH = item("rotten_fish"); + TagKey RAW_MEAT = item("raw_meat"); + TagKey COOKED_MEAT = item("cooked_meat"); + TagKey ROTTEN_MEAT = item("rotten_meat"); + TagKey DESSERTS = item("desserts"); + TagKey CANDY = item("candy"); + + TagKey CROPS_PEANUTS = item("crops/peanuts"); + TagKey TOOL_KNIVES = item("tools/knives"); + + private static TagKey item(String name) { + return TagKey.of(RegistryKeys.ITEM, new Identifier("c", name)); + } } } diff --git a/src/main/java/com/minelittlepony/unicopia/UTags.java b/src/main/java/com/minelittlepony/unicopia/UTags.java index f15c228e..83e9cb37 100644 --- a/src/main/java/com/minelittlepony/unicopia/UTags.java +++ b/src/main/java/com/minelittlepony/unicopia/UTags.java @@ -11,54 +11,6 @@ import net.minecraft.util.Identifier; import net.minecraft.world.dimension.DimensionType; public interface UTags { - TagKey FRESH_APPLES = item("fresh_apples"); - - TagKey FALLS_SLOWLY = item("falls_slowly"); - TagKey PIES = item("pies"); - TagKey CAN_CUT_PIE = item("can_cut_pie"); - - TagKey MAGIC_FEATHERS = item("magic_feathers"); - - TagKey SHADES = item("shades"); - TagKey CHANGELING_EDIBLE = item("food_types/changeling_edible"); - TagKey SPOOKED_MOB_DROPS = item("spooked_mob_drops"); - TagKey HAS_NO_TRAITS = item("has_no_traits"); - TagKey IS_DELIVERED_AGGRESSIVELY = item("is_delivered_aggressively"); - TagKey FLOATS_ON_CLOUDS = item("floats_on_clouds"); - TagKey COOLS_OFF_KIRINS = item("cools_off_kirins"); - TagKey LOOT_BUG_HIGH_VALUE_DROPS = item("loot_bug_high_value_drops"); - - TagKey SHELLS = item("food_types/shells"); - - TagKey POLEARMS = item("polearms"); - TagKey HORSE_SHOES = item("horse_shoes"); - TagKey APPLE_SEEDS = item("apple_seeds"); - - TagKey BASKETS = item("baskets"); - TagKey BADGES = item("badges"); - TagKey BED_SHEETS = item("bed_sheets"); - TagKey CLOUD_JARS = item("cloud_jars"); - - TagKey FRAGILE = block("fragile"); - TagKey INTERESTING = block("interesting"); - TagKey CATAPULT_IMMUNE = block("catapult_immune"); - - TagKey CRYSTAL_HEART_BASE = block("crystal_heart_base"); - TagKey CRYSTAL_HEART_ORNAMENT = block("crystal_heart_ornament"); - TagKey UNAFFECTED_BY_GROW_ABILITY = block("unaffected_by_grow_ability"); - TagKey KICKS_UP_DUST = block("kicks_up_dust"); - - TagKey POLEARM_MINEABLE = block("mineable/polearm"); - - TagKey> TRANSFORMABLE_ENTITIES = entity("transformable"); - - TagKey PINEAPPLE_EFFECTS = effect("pineapple_effects"); - - TagKey BREAKS_SUNGLASSES = damage("breaks_sunglasses"); - TagKey SPELLBOOK_IMMUNE_TO = damage("spellbook_immune_to"); - - TagKey HAS_NO_ATMOSPHERE = dimension("has_no_atmosphere"); - interface Items { TagKey ZAP_LOGS = item("zap_logs"); TagKey WAXED_ZAP_LOGS = item("waxed_zap_logs"); @@ -68,6 +20,67 @@ public interface UTags { TagKey CLOUD_STAIRS = item("cloud_stairs"); TagKey CLOUD_BLOCKS = item("cloud_blocks"); TagKey CHITIN_BLOCKS = item("chitin_blocks"); + + TagKey FRESH_APPLES = item("fresh_apples"); + + TagKey FALLS_SLOWLY = item("falls_slowly"); + TagKey PIES = item("pies"); + TagKey CAN_CUT_PIE = item("can_cut_pie"); + + TagKey MAGIC_FEATHERS = item("magic_feathers"); + + TagKey SHADES = item("shades"); + TagKey SPOOKED_MOB_DROPS = item("spooked_mob_drops"); + TagKey HAS_NO_TRAITS = item("has_no_traits"); + TagKey IS_DELIVERED_AGGRESSIVELY = item("is_delivered_aggressively"); + TagKey CONTAINER_WITH_LOVE = item("container_with_love"); + TagKey FLOATS_ON_CLOUDS = item("floats_on_clouds"); + TagKey COOLS_OFF_KIRINS = item("cools_off_kirins"); + TagKey LOOT_BUG_COMMON_DROPS = item("loot_bug_common_drops"); + TagKey LOOT_BUG_RARE_DROPS = item("loot_bug_rare_drops"); + TagKey LOOT_BUG_EPIC_DROPS = item("loot_bug_epic_drops"); + + TagKey SHELLS = item("shells"); + TagKey SPECIAL_SHELLS = item("special_shells"); + TagKey ROCK_STEWS = item("rock_stews"); + TagKey BAKED_GOODS = item("baked_goods"); + + TagKey HIGH_QUALITY_SEA_VEGETABLES = item("food_types/high_quality_sea_vegetables"); + TagKey LOW_QUALITY_SEA_VEGETABLES = item("food_types/low_quality_sea_vegetables"); + + TagKey POLEARMS = item("polearms"); + TagKey HORSE_SHOES = item("horse_shoes"); + TagKey APPLE_SEEDS = item("apple_seeds"); + + TagKey BASKETS = item("baskets"); + TagKey BADGES = item("badges"); + TagKey WOOL_BED_SHEETS = item("wool_bed_sheets"); + TagKey BED_SHEETS = item("bed_sheets"); + TagKey CLOUD_JARS = item("cloud_jars"); + + TagKey GROUP_FORAGING = item("groups/foraging"); + TagKey GROUP_EARTH_PONY = item("groups/earth_pony"); + TagKey GROUP_UNICORN = item("groups/unicorn"); + TagKey GROUP_PEGASUS = item("groups/pegasus"); + TagKey GROUP_BAT_PONY = item("groups/bat_pony"); + TagKey GROUP_SEA_PONY = item("groups/sea_pony"); + TagKey GROUP_CHANGELING = item("groups/changeling"); + + TagKey FORAGE_BLINDING = item("forage/blinding"); + TagKey FORAGE_DANGEROUS = item("forage/dangerous"); + TagKey FORAGE_FILLING = item("forage/filling"); + TagKey FORAGE_SAFE = item("forage/safe"); + TagKey FORAGE_NAUSEATING = item("forage/nauseating"); + TagKey FORAGE_PRICKLY = item("forage/prickly"); + TagKey FORAGE_GLOWING = item("forage/glowing"); + TagKey FORAGE_RISKY = item("forage/risky"); + TagKey FORAGE_STRENGHENING = item("forage/strenghtening"); + TagKey FORAGE_SEVERE_NAUSEATING = item("forage/severe/nauseating"); + TagKey FORAGE_SEVERE_PRICKLY = item("forage/severe/prickly"); + + private static TagKey item(String name) { + return TagKey.of(RegistryKeys.ITEM, Unicopia.id(name)); + } } interface Blocks { @@ -79,29 +92,58 @@ public interface UTags { TagKey CLOUD_STAIRS = block("cloud_stairs"); TagKey CLOUD_BLOCKS = block("cloud_blocks"); TagKey CHITIN_BLOCKS = block("chitin_blocks"); + + TagKey FRAGILE = block("fragile"); + TagKey INTERESTING = block("interesting"); + TagKey CATAPULT_IMMUNE = block("catapult_immune"); + TagKey JARS = block("jars"); + + TagKey CRYSTAL_HEART_BASE = block("crystal_heart_base"); + TagKey CRYSTAL_HEART_ORNAMENT = block("crystal_heart_ornament"); + TagKey UNAFFECTED_BY_GROW_ABILITY = block("unaffected_by_grow_ability"); + TagKey KICKS_UP_DUST = block("kicks_up_dust"); + + TagKey POLEARM_MINEABLE = block("mineable/polearm"); + + TagKey BUTTERFLIES_SPAWNABLE_ON = block("butterflies_spawn_on"); + + private static TagKey block(String name) { + return TagKey.of(RegistryKeys.BLOCK, Unicopia.id(name)); + } } - static TagKey item(String name) { - return TagKey.of(RegistryKeys.ITEM, Unicopia.id(name)); + interface Entities { + TagKey> TRANSFORMABLE = entity("transformable"); + + private static TagKey> entity(String name) { + return TagKey.of(RegistryKeys.ENTITY_TYPE, Unicopia.id(name)); + } } - static TagKey block(String name) { - return TagKey.of(RegistryKeys.BLOCK, Unicopia.id(name)); + interface DamageTypes { + TagKey BREAKS_SUNGLASSES = damage("breaks_sunglasses"); + TagKey SPELLBOOK_IMMUNE_TO = damage("spellbook_immune_to"); + TagKey FROM_ROCKS = damage("from_rocks"); + TagKey FROM_HORSESHOES = damage("from_horseshoes"); + + private static TagKey damage(String name) { + return TagKey.of(RegistryKeys.DAMAGE_TYPE, Unicopia.id(name)); + } } - static TagKey> entity(String name) { - return TagKey.of(RegistryKeys.ENTITY_TYPE, Unicopia.id(name)); + interface DimensionTypes { + TagKey HAS_NO_ATMOSPHERE = dimension("has_no_atmosphere"); + + private static TagKey dimension(String name) { + return TagKey.of(RegistryKeys.DIMENSION_TYPE, new Identifier("c", name)); + } } - static TagKey effect(String name) { - return TagKey.of(RegistryKeys.STATUS_EFFECT, Unicopia.id(name)); - } + interface StatusEffects { + TagKey PINEAPPLE_EFFECTS = effect("pineapple_effects"); - static TagKey damage(String name) { - return TagKey.of(RegistryKeys.DAMAGE_TYPE, Unicopia.id(name)); - } - - static TagKey dimension(String name) { - return TagKey.of(RegistryKeys.DIMENSION_TYPE, new Identifier("c", name)); + private static TagKey effect(String name) { + return TagKey.of(RegistryKeys.STATUS_EFFECT, Unicopia.id(name)); + } } } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ChangeFormAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ChangeFormAbility.java index 64fabfa4..67aa667f 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ChangeFormAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ChangeFormAbility.java @@ -9,6 +9,7 @@ import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.data.Hit; +import com.minelittlepony.unicopia.advancement.UCriteria; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.FriendshipBraceletItem; @@ -79,6 +80,7 @@ public class ChangeFormAbility implements Ability { Race actualRace = isTransforming ? target.getSpecies() : Race.UNSET; target.setSpecies(supressed.or(player.getCompositeRace().potential())); target.setSuppressedRace(actualRace); + UCriteria.SEAPONY_TRANSITION.trigger(target.asEntity()); } }); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java index b491bed3..7a4e1f76 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java @@ -2,26 +2,22 @@ package com.minelittlepony.unicopia.ability; import java.util.List; import java.util.Optional; -import java.util.stream.Collectors; +import java.util.function.Predicate; +import java.util.stream.Stream; import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.data.Hit; -import com.minelittlepony.unicopia.entity.damage.UDamageTypes; +import com.minelittlepony.unicopia.ability.magic.spell.ChangelingFeedingSpell; +import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; import com.minelittlepony.unicopia.entity.player.Pony; -import com.minelittlepony.unicopia.particle.FollowingParticleEffect; -import com.minelittlepony.unicopia.particle.ParticleUtils; -import com.minelittlepony.unicopia.particle.UParticles; import com.minelittlepony.unicopia.util.TraceHelper; import com.minelittlepony.unicopia.util.VecHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.damage.DamageSource; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.mob.HostileEntity; import net.minecraft.entity.passive.CowEntity; import net.minecraft.entity.passive.MerchantEntity; @@ -34,6 +30,13 @@ import net.minecraft.particle.ParticleTypes; * Changeling ability to restore health from mobs */ public class ChangelingFeedAbility implements Ability { + private static final Predicate TARGET_PREDICATE = e -> (e instanceof LivingEntity) + && (e instanceof CowEntity + || e instanceof MerchantEntity + || e instanceof PlayerEntity + || e instanceof SheepEntity + || e instanceof PigEntity + || e instanceof HostileEntity); @Override public int getWarmupTime(Pony player) { @@ -42,7 +45,7 @@ public class ChangelingFeedAbility implements Ability { @Override public int getCooldownTime(Pony player) { - return canFeed(player) ? 15 : 80; + return !SpellType.FEED.isOn(player) && ChangelingFeedingSpell.canFeed(player) ? 15 : 80; } @Override @@ -53,22 +56,7 @@ public class ChangelingFeedAbility implements Ability { @Nullable @Override public Optional prepare(Pony player) { - return Hit.of(canFeed(player) && !getTargets(player).isEmpty()); - } - - private boolean canFeed(Pony player) { - return player.asEntity().getHealth() < player.asEntity().getMaxHealth() - || player.asEntity().canConsume(false); - } - - private boolean canDrain(Entity e) { - return (e instanceof LivingEntity) - && (e instanceof CowEntity - || e instanceof MerchantEntity - || e instanceof PlayerEntity - || e instanceof SheepEntity - || e instanceof PigEntity - || e instanceof HostileEntity); + return Hit.of(ChangelingFeedingSpell.canFeed(player) && !getTargets(player).findAny().isEmpty()); } @Override @@ -76,16 +64,6 @@ public class ChangelingFeedAbility implements Ability { return Hit.SERIALIZER; } - protected List getTargets(Pony player) { - List list = VecHelper.findInRange(player.asEntity(), player.asWorld(), player.getOriginVector(), 3, this::canDrain); - - TraceHelper.findEntity(player.asEntity(), 17, 1, - looked -> looked instanceof LivingEntity && !list.contains(looked) && canDrain(looked)) - .ifPresent(list::add); - - return list.stream().map(i -> (LivingEntity)i).collect(Collectors.toList()); - } - @Override public double getCostEstimate(Pony player) { return 0; @@ -93,7 +71,7 @@ public class ChangelingFeedAbility implements Ability { @Override public boolean apply(Pony iplayer, Hit data) { - if (!canFeed(iplayer)) { + if (!ChangelingFeedingSpell.canFeed(iplayer)) { return false; } @@ -103,64 +81,25 @@ public class ChangelingFeedAbility implements Ability { int maximumFoodGain = player.canConsume(false) ? (20 - player.getHungerManager().getFoodLevel()) : 0; if (maximumHealthGain > 0 || maximumFoodGain > 0) { + List targets = getTargets(iplayer).map(LivingEntity.class::cast).toList(); - float healAmount = 0; + if (targets.size() > 0) { + new ChangelingFeedingSpell(targets, maximumHealthGain, maximumFoodGain).apply(iplayer); - for (LivingEntity i : getTargets(iplayer)) { - healAmount += drainFrom(iplayer, i); + iplayer.playSound(USounds.ENTITY_PLAYER_CHANGELING_FEED, 0.1F, iplayer.getRandomPitch()); + return true; } - - int foodAmount = (int)Math.floor(Math.min(healAmount / 3, maximumFoodGain)); - - if (foodAmount > 0) { - healAmount -= foodAmount; - } - player.getHungerManager().add(Math.max(1, foodAmount), 0.125f); - - player.heal(Math.max(1, Math.min(healAmount, maximumHealthGain))); - } - - - if (!canFeed(iplayer)) { - iplayer.playSound(USounds.Vanilla.ENTITY_PLAYER_BURP, 1, (float)player.getWorld().random.nextTriangular(1F, 0.2F)); - } else { - iplayer.playSound(USounds.ENTITY_PLAYER_CHANGELING_FEED, 0.1F, iplayer.getRandomPitch()); } + iplayer.playSound(USounds.Vanilla.ENTITY_PLAYER_BURP, 1, (float)player.getWorld().random.nextTriangular(1F, 0.2F)); return true; } - public float drainFrom(Pony changeling, LivingEntity living) { - - DamageSource d = changeling.damageOf(UDamageTypes.LOVE_DRAINING, changeling); - - float damage = living.getHealth()/2; - - if (damage > 0) { - living.damage(d, damage); - } - - ParticleUtils.spawnParticles(UParticles.CHANGELING_MAGIC, living, 7); - ParticleUtils.spawnParticles(new FollowingParticleEffect(UParticles.HEALTH_DRAIN, changeling.asEntity(), 0.2F), living, 1); - - if (changeling.asEntity().hasStatusEffect(StatusEffects.NAUSEA)) { - StatusEffectInstance effect = changeling.asEntity().getStatusEffect(StatusEffects.NAUSEA); - changeling.asEntity().removeStatusEffect(StatusEffects.NAUSEA); - living.addStatusEffect(effect); - } else if (changeling.asWorld().random.nextInt(2300) == 0) { - living.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, 20, 1)); - } - - if (living instanceof PlayerEntity) { - damage ++; - damage *= 1.6F; - - if (!changeling.asEntity().hasStatusEffect(StatusEffects.HEALTH_BOOST)) { - changeling.asEntity().addStatusEffect(new StatusEffectInstance(StatusEffects.HEALTH_BOOST, 13000, 1)); - } - } - - return damage; + protected Stream getTargets(Pony player) { + return Stream.concat( + VecHelper.findInRange(player.asEntity(), player.asWorld(), player.getOriginVector(), 3, TARGET_PREDICATE).stream(), + TraceHelper.findEntity(player.asEntity(), 17, 1, TARGET_PREDICATE).stream() + ).distinct(); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java index ec910617..a4883de9 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java @@ -10,10 +10,10 @@ import com.minelittlepony.unicopia.ability.data.Hit; import com.minelittlepony.unicopia.ability.data.Pos; import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.entity.player.Pony; -import com.minelittlepony.unicopia.item.TransformCropsRecipe; -import com.minelittlepony.unicopia.item.URecipes; import com.minelittlepony.unicopia.particle.MagicParticleEffect; import com.minelittlepony.unicopia.particle.ParticleUtils; +import com.minelittlepony.unicopia.recipe.TransformCropsRecipe; +import com.minelittlepony.unicopia.recipe.URecipes; import com.minelittlepony.unicopia.server.world.BlockDestructionManager; import com.minelittlepony.unicopia.util.TraceHelper; import com.minelittlepony.unicopia.util.VecHelper; @@ -108,7 +108,7 @@ public class EarthPonyGrowAbility implements Ability { } } - if (w.getBlockState(pos).isIn(UTags.UNAFFECTED_BY_GROW_ABILITY)) { + if (w.getBlockState(pos).isIn(UTags.Blocks.UNAFFECTED_BY_GROW_ABILITY)) { return 0; } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java index b702400f..285266c9 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java @@ -162,7 +162,7 @@ public class EarthPonyStompAbility implements Ability { ParticleUtils.spawnParticle(player.getWorld(), UParticles.GROUND_POUND, player.getX(), player.getY() - 1, player.getZ(), 0, 0, 0); BlockState steppingState = player.getSteppingBlockState(); - if (steppingState.isIn(UTags.KICKS_UP_DUST)) { + if (steppingState.isIn(UTags.Blocks.KICKS_UP_DUST)) { ParticleUtils.spawnParticle(player.getWorld(), new BlockStateParticleEffect(UParticles.DUST_CLOUD, steppingState), player.getBlockPos().down().toCenterPos(), Vec3d.ZERO); } @@ -227,7 +227,7 @@ public class EarthPonyStompAbility implements Ability { w.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(state)); } - if (state.isIn(UTags.KICKS_UP_DUST)) { + if (state.isIn(UTags.Blocks.KICKS_UP_DUST)) { if (w.random.nextInt(4) == 0 && w.isAir(pos.up()) && w.getFluidState(pos.up()).isEmpty()) { ParticleUtils.spawnParticle(w, new BlockStateParticleEffect(UParticles.DUST_CLOUD, state), pos.up().toCenterPos(), VecHelper.supply(() -> w.random.nextTriangular(0, 0.1F))); } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/PegasusCaptureStormAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/PegasusCaptureStormAbility.java index 3bbdd31f..b02579df 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/PegasusCaptureStormAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/PegasusCaptureStormAbility.java @@ -35,7 +35,7 @@ public class PegasusCaptureStormAbility implements Ability { @Override public boolean canUse(Race race) { - return race.canInteractWithClouds(); + return race.canInfluenceWeather(); } @Nullable diff --git a/src/main/java/com/minelittlepony/unicopia/ability/PegasusRainboomAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/PegasusRainboomAbility.java index bbe7256e..606cd65f 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/PegasusRainboomAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/PegasusRainboomAbility.java @@ -28,7 +28,7 @@ public class PegasusRainboomAbility implements Ability { @Override public boolean canUse(Race race) { - return race.canInteractWithClouds(); + return race.canInfluenceWeather(); } @Nullable diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java index e5500e2d..b4dc2eb4 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java @@ -110,7 +110,7 @@ public class ScreechAbility implements Ability { if (living.getWorld().random.nextInt(MOB_SPOOK_PROBABILITY) == 0) { - RegistryUtils.pickRandom(living.getWorld(), UTags.SPOOKED_MOB_DROPS).ifPresent(drop -> { + RegistryUtils.pickRandom(living.getWorld(), UTags.Items.SPOOKED_MOB_DROPS).ifPresent(drop -> { living.dropStack(drop.getDefaultStack()); living.playSound(USounds.Vanilla.ENTITY_ITEM_PICKUP, 1, 0.1F); UCriteria.SPOOK_MOB.trigger(player.asEntity()); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java index 513552ac..8b64862f 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java @@ -27,6 +27,7 @@ import net.minecraft.sound.SoundCategory; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.World; @@ -89,8 +90,10 @@ public class UnicornTeleportAbility implements Ability { return trace.getBlockOrEntityPos().map(pos -> { final BlockPos originalPos = pos; + Direction globalUp = player.getPhysics().isGravityNegative() ? Direction.DOWN : Direction.UP; + boolean originalPosHasSupport = exception(w, pos, player.asEntity()); - boolean originalPosValid = enterable(w, pos.up()) && enterable(w, pos.up(2)); + boolean originalPosValid = enterable(w, pos.offset(globalUp)) && enterable(w, pos.offset(globalUp, 2)); if (w.getBlockState(pos).isOf(Blocks.POWDER_SNOW) && !PowderSnowBlock.canWalkOnPowderSnow(player.asEntity())) { return null; @@ -111,11 +114,11 @@ public class UnicornTeleportAbility implements Ability { if (pos.getX() != originalPos.getX() || pos.getZ() != originalPos.getZ()) { // check support int steps = 0; - while (enterable(w, pos.down())) { - pos = pos.down(); + while (enterable(w, pos.offset(globalUp.getOpposite()))) { + pos = pos.offset(globalUp.getOpposite()); if (++steps > 2) { if (originalPosValid) { - pos = originalPos.up(); + pos = originalPos.offset(globalUp); break; } else { return null; @@ -125,7 +128,7 @@ public class UnicornTeleportAbility implements Ability { } if ((!enterable(w, pos) && exception(w, pos, player.asEntity())) - || (!enterable(w, pos.up()) && exception(w, pos.up(), player.asEntity()))) { + || (!enterable(w, pos.offset(globalUp)) && exception(w, pos.offset(globalUp), player.asEntity()))) { return null; } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java index 2d662cb1..dc6f4ec3 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java @@ -14,12 +14,14 @@ import com.minelittlepony.unicopia.entity.damage.UDamageSources; import com.minelittlepony.unicopia.particle.ParticleSource; import com.minelittlepony.unicopia.server.world.Ether; import com.minelittlepony.unicopia.server.world.ModificationType; +import com.minelittlepony.unicopia.server.world.OfflinePlayerCache; import com.minelittlepony.unicopia.util.SoundEmitter; import com.minelittlepony.unicopia.util.VecHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.GameRules; @@ -67,10 +69,18 @@ public interface Caster extends } if (getMaster() instanceof PlayerEntity player) { - if (!asWorld().canPlayerModifyAt(player, pos)) { + if (!player.canModifyBlocks() || !asWorld().canPlayerModifyAt(player, pos)) { return false; } } else { + if (asWorld() instanceof ServerWorld sw) { + @Nullable + PlayerEntity player = OfflinePlayerCache.getOfflinePlayer(sw, getMasterId().orElse(null)); + if (player != null && !player.canModifyBlocks() || !sw.canPlayerModifyAt(player, pos)) { + return false; + } + } + if (!asWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) { return false; } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/ChangelingFeedingSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/ChangelingFeedingSpell.java new file mode 100644 index 00000000..1bae80a1 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/ChangelingFeedingSpell.java @@ -0,0 +1,162 @@ +package com.minelittlepony.unicopia.ability.magic.spell; + +import java.util.List; +import java.util.stream.Collectors; + +import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.ability.Abilities; +import com.minelittlepony.unicopia.ability.magic.Caster; +import com.minelittlepony.unicopia.ability.magic.spell.effect.AbstractSpell; +import com.minelittlepony.unicopia.ability.magic.spell.effect.CustomisedSpellType; +import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; +import com.minelittlepony.unicopia.entity.EntityReference; +import com.minelittlepony.unicopia.entity.damage.UDamageTypes; +import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.particle.FollowingParticleEffect; +import com.minelittlepony.unicopia.particle.ParticleUtils; +import com.minelittlepony.unicopia.particle.UParticles; + +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; +import net.minecraft.util.math.MathHelper; + +public class ChangelingFeedingSpell extends AbstractSpell { + private List> targets = List.of(); + private int nextTargetIndex; + + private float healthToDrain; + private int foodToDrain; + + private float damageThisTick; + + public ChangelingFeedingSpell(CustomisedSpellType type) { + super(type); + setHidden(true); + } + + public ChangelingFeedingSpell(List feedTarget, float healthToDrain, int foodToDrain) { + this(SpellType.FEED.withTraits()); + this.targets = feedTarget.stream().map(EntityReference::new).collect(Collectors.toList() /* make mutable */); + this.healthToDrain = healthToDrain; + this.foodToDrain = foodToDrain; + } + + @Override + public boolean tick(Caster source, Situation situation) { + if (!(source instanceof Pony changeling) || situation != Situation.BODY || !source.canUse(Abilities.FEED)) { + return false; + } + + PlayerEntity player = changeling.asEntity(); + if (!canFeed(changeling)) { + changeling.playSound(USounds.Vanilla.ENTITY_PLAYER_BURP, 1, (float)player.getWorld().random.nextTriangular(1F, 0.2F)); + return false; + } + + float tickDrain = Math.min(0.05F, healthToDrain); + damageThisTick += tickDrain; + + if (damageThisTick > 1) { + damageThisTick--; + + float healAmount = drain(changeling, 1); + float foodAmount = Math.min(healAmount / 3F, foodToDrain); + if (foodAmount > 0) { + healAmount -= foodAmount; + } + + foodAmount = MathHelper.clamp(foodAmount, 0, foodToDrain); + healAmount = MathHelper.clamp(healAmount, 0, healthToDrain); + + int shanks = MathHelper.floor(foodAmount); + player.getHungerManager().add(shanks, foodAmount - shanks); + player.heal(healAmount); + + if (!canFeed(changeling)) { + changeling.playSound(USounds.Vanilla.ENTITY_PLAYER_BURP, 1, (float)player.getWorld().random.nextTriangular(1F, 0.2F)); + } else { + changeling.playSound(USounds.ENTITY_PLAYER_CHANGELING_FEED, 0.1F, changeling.getRandomPitch()); + } + + foodToDrain -= foodAmount; + healthToDrain -= healAmount; + } + + return !targets.isEmpty() && (healthToDrain > 0 || foodToDrain > 0); + } + + private float drain(Pony changeling, float max) { + List> targets = this.targets; + while (!targets.isEmpty()) { + int index = MathHelper.clamp(nextTargetIndex, 0, targets.size()); + LivingEntity l = targets.get(index).getOrEmpty(changeling.asWorld()).orElse(null); + if (l != null && !l.isRemoved() && l.distanceTo(changeling.asEntity()) < 4) { + nextTargetIndex = (nextTargetIndex + 1) % targets.size(); + return drainFrom(changeling, l, max); + } else { + targets.remove(index); + } + } + return 0; + } + + public float drainFrom(Pony changeling, LivingEntity living, float damage) { + DamageSource d = changeling.damageOf(UDamageTypes.LOVE_DRAINING, changeling); + + if (damage > 0) { + living.damage(d, damage); + } + + ParticleUtils.spawnParticles(UParticles.CHANGELING_MAGIC, living, 7); + ParticleUtils.spawnParticles(new FollowingParticleEffect(UParticles.HEALTH_DRAIN, changeling.asEntity(), 0.2F), living, 1); + + if (changeling.asEntity().hasStatusEffect(StatusEffects.NAUSEA)) { + StatusEffectInstance effect = changeling.asEntity().getStatusEffect(StatusEffects.NAUSEA); + changeling.asEntity().removeStatusEffect(StatusEffects.NAUSEA); + living.addStatusEffect(effect); + } else if (changeling.asWorld().random.nextInt(2300) == 0) { + living.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, 20, 1)); + } + + if (living instanceof PlayerEntity) { + damage ++; + damage *= 1.6F; + + if (!changeling.asEntity().hasStatusEffect(StatusEffects.HEALTH_BOOST)) { + changeling.asEntity().addStatusEffect(new StatusEffectInstance(StatusEffects.HEALTH_BOOST, 13000, 1)); + } + } + + return damage; + } + + public static boolean canFeed(Pony player) { + return player.asEntity().getHealth() < player.asEntity().getMaxHealth() + || player.asEntity().canConsume(false); + } + + @Override + public void toNBT(NbtCompound compound) { + super.toNBT(compound); + compound.putFloat("healthToDrain", healthToDrain); + compound.putInt("foodToDrain", foodToDrain); + compound.putFloat("damageThisTick", damageThisTick); + compound.put("targets", EntityReference.getSerializer().writeAll(targets)); + } + + @Override + public void fromNBT(NbtCompound compound) { + super.fromNBT(compound); + healthToDrain = compound.getFloat("healthToDrain"); + foodToDrain = compound.getInt("foodToDrain"); + damageThisTick = compound.getFloat("damageThisTick"); + targets = compound.contains("targets", NbtElement.LIST_TYPE) + ? EntityReference.getSerializer().readAll(compound.getList("targets", NbtElement.COMPOUND_TYPE)).toList() + : List.of(); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java index a3339212..13445ea2 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java @@ -64,7 +64,7 @@ public class RainboomAbilitySpell extends AbstractSpell { }); EFFECT_RANGE.translate(source.getOrigin()).getBlockPositions().forEach(pos -> { BlockState state = source.asWorld().getBlockState(pos); - if (state.isIn(UTags.FRAGILE) && source.canModifyAt(pos, ModificationType.PHYSICAL)) { + if (state.isIn(UTags.Blocks.FRAGILE) && source.canModifyAt(pos, ModificationType.PHYSICAL)) { source.asWorld().breakBlock(pos, true); } }); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/IngredientWithSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/IngredientWithSpell.java index fee645b8..04c95b3b 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/IngredientWithSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/IngredientWithSpell.java @@ -12,6 +12,8 @@ import com.minelittlepony.unicopia.item.EnchantableItem; import com.minelittlepony.unicopia.util.CodecUtils; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Codec; + +import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.Ingredient; @@ -36,6 +38,17 @@ public class IngredientWithSpell implements Predicate { private final Supplier stacks; + public static IngredientWithSpell mundane(ItemConvertible item) { + return new IngredientWithSpell(Optional.of(Ingredient.ofItems(item)), Optional.empty()); + } + + public static IngredientWithSpell of(ItemConvertible base, SpellType spell) { + if (spell == SpellType.EMPTY_KEY) { + return mundane(base); + } + return new IngredientWithSpell(Optional.of(Ingredient.ofItems(base)), Optional.of(spell)); + } + private IngredientWithSpell(Optional stack, Optional> spell) { this.stack = stack; this.spell = spell; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellCraftingRecipe.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellCraftingRecipe.java index aa7601fa..f65fca75 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellCraftingRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellCraftingRecipe.java @@ -9,7 +9,7 @@ import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits; import com.minelittlepony.unicopia.container.inventory.SpellbookInventory; import com.minelittlepony.unicopia.item.EnchantableItem; -import com.minelittlepony.unicopia.item.URecipes; +import com.minelittlepony.unicopia.recipe.URecipes; import com.minelittlepony.unicopia.util.CodecUtils; import com.minelittlepony.unicopia.util.InventoryUtil; import com.mojang.datafixers.util.Pair; @@ -47,7 +47,7 @@ public class SpellCraftingRecipe implements SpellbookRecipe { */ final ItemStack output; - private SpellCraftingRecipe(IngredientWithSpell material, TraitIngredient requiredTraits, List requiredItems, ItemStack output) { + public SpellCraftingRecipe(IngredientWithSpell material, TraitIngredient requiredTraits, List requiredItems, ItemStack output) { this.material = material; this.requiredTraits = requiredTraits; this.requiredItems = requiredItems; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellDuplicatingRecipe.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellDuplicatingRecipe.java index 3d2f31a9..79b9b1bd 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellDuplicatingRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellDuplicatingRecipe.java @@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.ability.magic.spell.crafting; import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; import com.minelittlepony.unicopia.container.inventory.SpellbookInventory; import com.minelittlepony.unicopia.item.*; +import com.minelittlepony.unicopia.recipe.URecipes; import com.minelittlepony.unicopia.util.InventoryUtil; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; @@ -16,12 +17,10 @@ import net.minecraft.world.World; /** * A recipe for creating a new spell from input traits and items. */ -public class SpellDuplicatingRecipe implements SpellbookRecipe { - final IngredientWithSpell material; - - private SpellDuplicatingRecipe(IngredientWithSpell material) { - this.material = material; - } +public record SpellDuplicatingRecipe (IngredientWithSpell material) implements SpellbookRecipe { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + IngredientWithSpell.CODEC.fieldOf("material").forGetter(recipe -> recipe.material) + ).apply(instance, SpellDuplicatingRecipe::new)); @Override public void buildCraftingTree(CraftingTreeBuilder builder) { @@ -81,10 +80,6 @@ public class SpellDuplicatingRecipe implements SpellbookRecipe { } public static class Serializer implements RecipeSerializer { - private static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - IngredientWithSpell.CODEC.fieldOf("material").forGetter(recipe -> recipe.material) - ).apply(instance, SpellDuplicatingRecipe::new)); - @Override public Codec codec() { return CODEC; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellEnhancingRecipe.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellEnhancingRecipe.java index e4bcbfa1..9c601e18 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellEnhancingRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellEnhancingRecipe.java @@ -5,6 +5,7 @@ import com.minelittlepony.unicopia.container.inventory.SpellbookInventory; import com.minelittlepony.unicopia.item.*; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import com.minelittlepony.unicopia.recipe.URecipes; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; @@ -15,12 +16,10 @@ import net.minecraft.world.World; /** * Recipe for adding traits to an existing spell. */ -public class SpellEnhancingRecipe implements SpellbookRecipe { - final IngredientWithSpell material; - - private SpellEnhancingRecipe(IngredientWithSpell material) { - this.material = material; - } +public record SpellEnhancingRecipe (IngredientWithSpell material) implements SpellbookRecipe { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + IngredientWithSpell.CODEC.fieldOf("material").forGetter(recipe -> recipe.material) + ).apply(instance, SpellEnhancingRecipe::new)); public IngredientWithSpell getBaseMaterial() { return material; @@ -65,10 +64,6 @@ public class SpellEnhancingRecipe implements SpellbookRecipe { } public static class Serializer implements RecipeSerializer { - private static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - IngredientWithSpell.CODEC.fieldOf("material").forGetter(recipe -> recipe.material) - ).apply(instance, SpellEnhancingRecipe::new)); - @Override public Codec codec() { return CODEC; @@ -81,7 +76,7 @@ public class SpellEnhancingRecipe implements SpellbookRecipe { @Override public void write(PacketByteBuf buf, SpellEnhancingRecipe recipe) { - recipe.material.write(buf); + recipe.material().write(buf); } } } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellShapedCraftingRecipe.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellShapedCraftingRecipe.java index db54b707..e0a70a61 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellShapedCraftingRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellShapedCraftingRecipe.java @@ -1,7 +1,7 @@ package com.minelittlepony.unicopia.ability.magic.spell.crafting; import com.minelittlepony.unicopia.item.EnchantableItem; -import com.minelittlepony.unicopia.item.URecipes; +import com.minelittlepony.unicopia.recipe.URecipes; import com.minelittlepony.unicopia.util.InventoryUtil; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellbookRecipe.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellbookRecipe.java index 89043ce8..49b781aa 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellbookRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/SpellbookRecipe.java @@ -5,7 +5,7 @@ import java.util.List; import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait; import com.minelittlepony.unicopia.container.inventory.SpellbookInventory; import com.minelittlepony.unicopia.item.UItems; -import com.minelittlepony.unicopia.item.URecipes; +import com.minelittlepony.unicopia.recipe.URecipes; import net.minecraft.item.ItemStack; import net.minecraft.recipe.Recipe; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/TraitIngredient.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/TraitIngredient.java index 71d049e4..cb2f0766 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/TraitIngredient.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/crafting/TraitIngredient.java @@ -16,22 +16,36 @@ public record TraitIngredient ( Optional min, Optional max ) implements Predicate { - public static final Codec CODEC = Codecs.xor( - SpellTraits.CODEC.flatXmap( - traits -> DataResult.success(new TraitIngredient(Optional.ofNullable(traits), Optional.empty())), - ingredient -> ingredient.min().map(DataResult::success).orElseGet(() -> DataResult.error(() -> "Cannot serialize an empty trait ingredient"))), - RecordCodecBuilder.create(instance -> instance.group( - SpellTraits.CODEC.optionalFieldOf("min").forGetter(TraitIngredient::min), - SpellTraits.CODEC.optionalFieldOf("max").forGetter(TraitIngredient::max) - ).apply(instance, TraitIngredient::new)).flatXmap( - ingredient -> !ingredient.isEmpty() ? DataResult.success(ingredient) : DataResult.error(() -> "No min or max supplied for ingredient"), - ingredient -> DataResult.success(ingredient) - ) - ).flatXmap( + public static final TraitIngredient EMPTY = new TraitIngredient(Optional.empty(), Optional.empty()); + private static final Codec INLINE_CODEC = SpellTraits.CODEC.xmap( + traits -> new TraitIngredient(Optional.ofNullable(traits), Optional.empty()), + ingredient -> ingredient.min().orElse(SpellTraits.EMPTY)); + private static final Codec STRUCTURED_CODEC = RecordCodecBuilder.create(instance -> instance.group( + SpellTraits.CODEC.optionalFieldOf("min").forGetter(TraitIngredient::min), + SpellTraits.CODEC.optionalFieldOf("max").forGetter(TraitIngredient::max) + ).apply(instance, TraitIngredient::new)); + public static final Codec CODEC = Codecs.xor(INLINE_CODEC, STRUCTURED_CODEC).flatXmap( either -> either.left().or(either::right).map(DataResult::success).orElseGet(() -> DataResult.error(() -> "Invalid traits")), ingredient -> DataResult.success(ingredient.max.isEmpty() ? Either.left(ingredient) : Either.right(ingredient)) ); + public static TraitIngredient of(SpellTraits minTraits) { + if (minTraits.isEmpty()) { + return EMPTY; + } + return new TraitIngredient(Optional.of(minTraits), Optional.empty()); + } + + public static TraitIngredient of(SpellTraits minTraits, SpellTraits maxTraits) { + if (minTraits.isEmpty() && maxTraits.isEmpty()) { + return EMPTY; + } + return new TraitIngredient( + Optional.of(minTraits).filter(s -> !s.isEmpty()), + Optional.of(maxTraits).filter(s -> !s.isEmpty()) + ); + } + public boolean isEmpty() { return min.filter(SpellTraits::isPresent).isEmpty() && max.filter(SpellTraits::isPresent).isEmpty(); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java index ec5cbf3e..ce440570 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java @@ -86,7 +86,7 @@ public class CatapultSpell extends AbstractSpell implements ProjectileDelegate.B } BlockState state = world.getBlockState(bpos); - if (state.isIn(UTags.CATAPULT_IMMUNE)) { + if (state.isIn(UTags.Blocks.CATAPULT_IMMUNE)) { return; } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/HydrophobicSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/HydrophobicSpell.java index d88d9dd0..ce21955f 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/HydrophobicSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/HydrophobicSpell.java @@ -61,7 +61,9 @@ public class HydrophobicSpell extends AbstractSpell { storedFluidPositions.removeIf(entry -> { if (!area.isPointInside(Vec3d.ofCenter(entry.pos()))) { - entry.restore(world); + if (source.canModifyAt(entry.pos())) { + entry.restore(world); + } return true; } @@ -72,7 +74,7 @@ public class HydrophobicSpell extends AbstractSpell { pos = new BlockPos(pos); BlockState state = world.getBlockState(pos); - if (state.getFluidState().isIn(affectedFluid)) { + if (source.canModifyAt(pos) && state.getFluidState().isIn(affectedFluid)) { Block block = state.getBlock(); if (block instanceof FluidBlock) { @@ -95,7 +97,7 @@ public class HydrophobicSpell extends AbstractSpell { source.spawnParticles(new Sphere(true, range), 10, pos -> { BlockPos bp = BlockPos.ofFloored(pos); - if (source.asWorld().getFluidState(bp.up()).isIn(affectedFluid)) { + if (source.canModifyAt(bp) && source.asWorld().getFluidState(bp.up()).isIn(affectedFluid)) { source.addParticle(UParticles.RAIN_DROPS, pos, Vec3d.ZERO); } }); @@ -116,7 +118,9 @@ public class HydrophobicSpell extends AbstractSpell { protected void onDestroyed(Caster caster) { Ether.get(caster.asWorld()).remove(this, caster); storedFluidPositions.removeIf(entry -> { - entry.restore(caster.asWorld()); + if (caster.canModifyAt(entry.pos())) { + entry.restore(caster.asWorld()); + } return true; }); } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/InfernoSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/InfernoSpell.java index 5dc50a69..8c1869ee 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/InfernoSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/InfernoSpell.java @@ -48,8 +48,9 @@ public class InfernoSpell extends FireSpell { for (int i = 0; i < radius * 2; i++) { if (w.random.nextInt(12) == 0) { Vec3d vec = shape.computePoint(w.random).add(origin); + BlockPos pos = BlockPos.ofFloored(vec); - if (!applyBlocks(w, BlockPos.ofFloored(vec))) { + if (source.canModifyAt(pos) && !applyBlocks(w, pos)) { applyEntities(source, vec); } } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/SpellType.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/SpellType.java index 63c5eddc..90bbed43 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/SpellType.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/SpellType.java @@ -11,6 +11,7 @@ import com.minelittlepony.unicopia.Affinity; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.ability.magic.Affine; import com.minelittlepony.unicopia.ability.magic.SpellPredicate; +import com.minelittlepony.unicopia.ability.magic.spell.ChangelingFeedingSpell; import com.minelittlepony.unicopia.ability.magic.spell.DispersableDisguiseSpell; import com.minelittlepony.unicopia.ability.magic.spell.RainboomAbilitySpell; import com.minelittlepony.unicopia.ability.magic.spell.PlaceableSpell; @@ -49,6 +50,7 @@ public final class SpellType implements Affine, SpellPredicate< public static final SpellType THROWN_SPELL = register("thrown", Affinity.NEUTRAL, 0, false, SpellTraits.EMPTY, ThrowableSpell::new); public static final SpellType CHANGELING_DISGUISE = register("disguise", Affinity.BAD, 0x19E48E, false, SpellTraits.EMPTY, DispersableDisguiseSpell::new); + public static final SpellType FEED = register("feed", Affinity.BAD, 0xBDBDF9, false, SpellTraits.EMPTY, ChangelingFeedingSpell::new); public static final SpellType RAINBOOM = register("rainboom", Affinity.GOOD, 0xBDBDF9, false, SpellTraits.EMPTY, RainboomAbilitySpell::new); public static final SpellType RAGE = register("rage", Affinity.GOOD, 0xBDBDF9, false, SpellTraits.EMPTY, RageAbilitySpell::new); public static final SpellType TIME_CONTROL = register("time_control", Affinity.GOOD, 0xBDBDF9, false, SpellTraits.EMPTY, TimeControlAbilitySpell::new); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java index e26152f0..4d507d1d 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java @@ -66,7 +66,7 @@ public class TransformationSpell extends AbstractSpell implements ProjectileDele @SuppressWarnings("unchecked") private Optional> pickType(EntityType except, World world) { - Set> options = RegistryUtils.valuesForTag(world, UTags.TRANSFORMABLE_ENTITIES).collect(Collectors.toSet()); + Set> options = RegistryUtils.valuesForTag(world, UTags.Entities.TRANSFORMABLE).collect(Collectors.toSet()); if (except.getSpawnGroup() == SpawnGroup.MONSTER) { options.removeIf(t -> t.getSpawnGroup() == SpawnGroup.MONSTER); } else { diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java index bc39e514..aaeeb999 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java @@ -7,10 +7,7 @@ import java.util.stream.Stream; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.command.CommandArgumentEnum; -import com.mojang.datafixers.util.Either; import com.mojang.serialization.Codec; -import com.mojang.serialization.DataResult; - import net.minecraft.command.argument.EnumArgumentType; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -20,7 +17,6 @@ import net.minecraft.text.*; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.util.StringIdentifiable; -import net.minecraft.util.dynamic.Codecs; public enum Trait implements CommandArgumentEnum { /** @@ -64,14 +60,10 @@ public enum Trait implements CommandArgumentEnum { BLOOD(TraitGroup.DARKNESS); private static final Map IDS = Arrays.stream(values()).collect(Collectors.toMap(Trait::getId, Function.identity())); - @Deprecated - private static final EnumCodec NAME_CODEC = StringIdentifiable.createCodec(Trait::values, String::toLowerCase); - @Deprecated - private static final EnumCodec ID_CODEC = StringIdentifiable.createCodec(Trait::values, i -> "unicopia:" + i); - - public static final Codec CODEC = Codecs.xor(NAME_CODEC, ID_CODEC).flatXmap( - either -> either.left().or(either::right).map(DataResult::success).orElseGet(() -> DataResult.error(() -> "Not a proper trait")), - trait -> DataResult.success(Either.right(trait)) + public static final EnumCodec CODEC = StringIdentifiable.createCodec(Trait::values, n -> n.toLowerCase(Locale.ROOT)); + public static final Codec> SET_CODEC = CODEC.listOf().xmap( + l -> l.stream().distinct().collect(Collectors.toSet()), + s -> s.stream().toList() ); private final Identifier id; @@ -115,7 +107,7 @@ public enum Trait implements CommandArgumentEnum { @Override public String asString() { - return name(); + return getId().getPath(); } public TraitGroup getGroup() { @@ -173,7 +165,7 @@ public enum Trait implements CommandArgumentEnum { @Deprecated public static Optional fromName(String name) { - return Optional.ofNullable(NAME_CODEC.byId(name)); + return Optional.ofNullable(CODEC.byId(name)); } public static EnumArgumentType argument() { diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/TraitDiscovery.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/TraitDiscovery.java index 929f54e1..29ce78d5 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/TraitDiscovery.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/TraitDiscovery.java @@ -1,5 +1,6 @@ package com.minelittlepony.unicopia.ability.magic.spell.trait; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -10,6 +11,7 @@ import java.util.stream.Stream; import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.advancement.UCriteria; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.network.Channel; import com.minelittlepony.unicopia.network.MsgMarkTraitRead; @@ -76,8 +78,11 @@ public class TraitDiscovery implements NbtSerialisable, Copyable }); unreadTraits.addAll(newTraits); pony.setDirty(); - if (!newTraits.isEmpty() && !pony.asWorld().isClient) { - Channel.UNLOCK_TRAITS.sendToPlayer(new MsgUnlockTraits(newTraits), (ServerPlayerEntity)pony.asEntity()); + if (!newTraits.isEmpty()) { + if (!pony.asWorld().isClient) { + Channel.UNLOCK_TRAITS.sendToPlayer(new MsgUnlockTraits(newTraits), (ServerPlayerEntity)pony.asEntity()); + } + UCriteria.TRAIT_DISCOVERED.trigger(pony.asEntity()); } } @@ -103,6 +108,10 @@ public class TraitDiscovery implements NbtSerialisable, Copyable return traits.contains(trait); } + public boolean isKnown(Collection traits) { + return traits.containsAll(traits); + } + @Environment(EnvType.CLIENT) public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip) { SpellTraits.getEmbeddedTraits(stack) diff --git a/src/main/java/com/minelittlepony/unicopia/advancement/CustomEventCriterion.java b/src/main/java/com/minelittlepony/unicopia/advancement/CustomEventCriterion.java index ab0f2bde..91ff5931 100644 --- a/src/main/java/com/minelittlepony/unicopia/advancement/CustomEventCriterion.java +++ b/src/main/java/com/minelittlepony/unicopia/advancement/CustomEventCriterion.java @@ -10,6 +10,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.fabricmc.fabric.api.util.TriState; +import net.minecraft.advancement.AdvancementCriterion; import net.minecraft.advancement.criterion.AbstractCriterion; import net.minecraft.entity.Entity; import net.minecraft.predicate.entity.EntityPredicate; @@ -37,6 +38,22 @@ public class CustomEventCriterion extends AbstractCriterion create(String name) { + return UCriteria.CUSTOM_EVENT.create(new Conditions(Optional.empty(), name, RacePredicate.EMPTY, TriState.DEFAULT, 1)); + } + + public static AdvancementCriterion create(String name, int count) { + return UCriteria.CUSTOM_EVENT.create(new Conditions(Optional.empty(), name, RacePredicate.EMPTY, TriState.DEFAULT, count)); + } + + public static AdvancementCriterion createFlying(String name) { + return UCriteria.CUSTOM_EVENT.create(new Conditions(Optional.empty(), name, RacePredicate.EMPTY, TriState.TRUE, 1)); + } + + public static AdvancementCriterion createFlying(String name, int count) { + return UCriteria.CUSTOM_EVENT.create(new Conditions(Optional.empty(), name, RacePredicate.EMPTY, TriState.TRUE, count)); + } + public record Conditions ( Optional player, String event, diff --git a/src/main/java/com/minelittlepony/unicopia/advancement/RacePredicate.java b/src/main/java/com/minelittlepony/unicopia/advancement/RacePredicate.java index be06bf7c..ad7f9c44 100644 --- a/src/main/java/com/minelittlepony/unicopia/advancement/RacePredicate.java +++ b/src/main/java/com/minelittlepony/unicopia/advancement/RacePredicate.java @@ -1,5 +1,6 @@ package com.minelittlepony.unicopia.advancement; +import java.util.Optional; import java.util.Set; import java.util.function.Predicate; import com.minelittlepony.unicopia.Race; @@ -10,17 +11,21 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.server.network.ServerPlayerEntity; -public record RacePredicate(Set include, Set exclude) implements Predicate { - public static final RacePredicate EMPTY = new RacePredicate(Set.of(), Set.of()); +public record RacePredicate(Optional> include, Optional> exclude) implements Predicate { + public static final RacePredicate EMPTY = new RacePredicate(Optional.empty(), Optional.empty()); private static final Codec> RACE_SET_CODEC = CodecUtils.setOf(Race.REGISTRY.getCodec()); private static final Codec BASE_CODEC = RecordCodecBuilder.create(instance -> instance.group( - RACE_SET_CODEC.fieldOf("include").forGetter(RacePredicate::include), - RACE_SET_CODEC.fieldOf("exclude").forGetter(RacePredicate::exclude) + RACE_SET_CODEC.optionalFieldOf("include").forGetter(RacePredicate::include), + RACE_SET_CODEC.optionalFieldOf("exclude").forGetter(RacePredicate::exclude) ).apply(instance, RacePredicate::of)); - public static final Codec CODEC = CodecUtils.xor(BASE_CODEC, RACE_SET_CODEC.xmap(include -> of(include, Set.of()), RacePredicate::include)); + public static final Codec CODEC = CodecUtils.xor(BASE_CODEC, RACE_SET_CODEC.xmap(include -> of(Optional.of(include), Optional.empty()), a -> a.include().orElse(Set.of()))); - private static RacePredicate of(Set include, Set exclude) { + public static RacePredicate of(Set include, Set exclude) { + return of(Optional.of(include).filter(s -> !s.isEmpty()), Optional.of(exclude).filter(s -> !s.isEmpty())); + } + + public static RacePredicate of(Optional> include, Optional> exclude) { if (include.isEmpty() && exclude.isEmpty()) { return EMPTY; } @@ -30,6 +35,10 @@ public record RacePredicate(Set include, Set exclude) implements Pre @Override public boolean test(ServerPlayerEntity player) { Race race = Pony.of(player).getSpecies(); - return (include.isEmpty() || include.contains(race)) && !(!exclude.isEmpty() && exclude.contains(race)); + return (include.isEmpty() || include.get().contains(race)) && !(!exclude.isEmpty() && exclude.get().contains(race)); + } + + public boolean isEmpty() { + return include.isEmpty() && exclude.isEmpty(); } } diff --git a/src/main/java/com/minelittlepony/unicopia/advancement/TraitDiscoveredCriterion.java b/src/main/java/com/minelittlepony/unicopia/advancement/TraitDiscoveredCriterion.java new file mode 100644 index 00000000..70e30105 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/advancement/TraitDiscoveredCriterion.java @@ -0,0 +1,45 @@ +package com.minelittlepony.unicopia.advancement; + +import java.util.Optional; +import java.util.Set; + +import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait; +import com.minelittlepony.unicopia.entity.player.Pony; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; + +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.advancement.criterion.AbstractCriterion; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.predicate.entity.EntityPredicate; +import net.minecraft.predicate.entity.LootContextPredicate; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.dynamic.Codecs; + +public class TraitDiscoveredCriterion extends AbstractCriterion { + @Override + public Codec getConditionsCodec() { + return Conditions.CODEC; + } + + public static AdvancementCriterion create(Set traits) { + return UCriteria.TRAIT_DISCOVERED.create(new Conditions(Optional.empty(), traits)); + } + + public void trigger(PlayerEntity player) { + if (player instanceof ServerPlayerEntity) { + trigger((ServerPlayerEntity)player, c -> c.test((ServerPlayerEntity)player)); + } + } + + public record Conditions(Optional player, Set traits) implements AbstractCriterion.Conditions { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + Codecs.createStrictOptionalFieldCodec(EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC, "player").forGetter(Conditions::player), + Trait.SET_CODEC.fieldOf("traits").forGetter(Conditions::traits) + ).apply(instance, Conditions::new)); + + public boolean test(ServerPlayerEntity player) { + return Pony.of(player).getDiscoveries().isKnown(traits); + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java b/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java index 9fba2670..359316e0 100644 --- a/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java +++ b/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java @@ -6,6 +6,7 @@ public interface UCriteria { CustomEventCriterion CUSTOM_EVENT = Criteria.register("unicopia:custom", new CustomEventCriterion()); RaceChangeCriterion PLAYER_CHANGE_RACE = Criteria.register("unicopia:player_change_race", new RaceChangeCriterion()); SendViaDragonBreathScrollCriterion SEND_DRAGON_BREATH = Criteria.register("unicopia:send_dragon_breath", new SendViaDragonBreathScrollCriterion()); + TraitDiscoveredCriterion TRAIT_DISCOVERED = Criteria.register("unicopia:trait_discovered", new TraitDiscoveredCriterion()); CustomEventCriterion.Trigger LOOK_INTO_SUN = CUSTOM_EVENT.createTrigger("look_into_sun"); CustomEventCriterion.Trigger WEAR_SHADES = CUSTOM_EVENT.createTrigger("wear_shades"); @@ -27,7 +28,9 @@ public interface UCriteria { CustomEventCriterion.Trigger POWER_UP_HEART = CUSTOM_EVENT.createTrigger("power_up_heart"); CustomEventCriterion.Trigger SPLIT_SEA = CUSTOM_EVENT.createTrigger("split_sea"); CustomEventCriterion.Trigger RIDE_BALLOON = CUSTOM_EVENT.createTrigger("ride_balloon"); + CustomEventCriterion.Trigger CONSTRUCT_BALLOON = CUSTOM_EVENT.createTrigger("construct_balloon"); CustomEventCriterion.Trigger TELEPORT_ABOVE_WORLD = CUSTOM_EVENT.createTrigger("teleport_above_world"); + CustomEventCriterion.Trigger SEAPONY_TRANSITION = CUSTOM_EVENT.createTrigger("seapony_transition"); static void bootstrap() { } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/EnchantedFruitBlock.java b/src/main/java/com/minelittlepony/unicopia/block/EnchantedFruitBlock.java index 15c2f6ad..1b702931 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/EnchantedFruitBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/EnchantedFruitBlock.java @@ -9,7 +9,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShape; public class EnchantedFruitBlock extends FruitBlock { - static final BooleanProperty ENCHANTED = BooleanProperty.of("enchanted"); + public static final BooleanProperty ENCHANTED = BooleanProperty.of("enchanted"); private static final MapCodec CODEC = createCodec(EnchantedFruitBlock::new); diff --git a/src/main/java/com/minelittlepony/unicopia/block/FancyBedBlock.java b/src/main/java/com/minelittlepony/unicopia/block/FancyBedBlock.java index 7b74d5ec..8869cf1a 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/FancyBedBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/FancyBedBlock.java @@ -20,8 +20,11 @@ import net.minecraft.block.entity.BedBlockEntity; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.block.enums.BedPart; +import net.minecraft.entity.mob.PiglinBrain; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.DyeColor; import net.minecraft.util.StringIdentifiable; @@ -31,6 +34,7 @@ import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import net.minecraft.world.World; +import net.minecraft.world.event.GameEvent; public class FancyBedBlock extends BedBlock { public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group( @@ -70,6 +74,45 @@ public class FancyBedBlock extends BedBlock { return SHAPES.get(state.get(PART).ordinal()).apply(BedBlock.getOppositePartDirection(state)); } + @Deprecated + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + if (state.hasBlockEntity() && !state.isOf(newState.getBlock()) && state.get(PART) == BedPart.HEAD) { + world.getBlockEntity(pos, UBlockEntities.FANCY_BED).ifPresent(tile -> { + SheetPattern pattern = tile.getPattern(); + if (pattern != SheetPattern.NONE) { + dropStack(world, pos, BedsheetsItem.forPattern(pattern).getDefaultStack()); + } + }); + } + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { + // MC-269785 + BedPart part = state.get(PART); + BlockPos otherHalfPos = pos.offset(getDirectionTowardsOtherPart(part, state.get(FACING))); + BlockState otherHalfState = world.getBlockState(otherHalfPos); + if (/*!world.isClient &&*/ player.isCreative() && part == BedPart.FOOT && otherHalfState.isOf(this) && otherHalfState.get(PART) == BedPart.HEAD) { + if (!world.isClient) { + world.setBlockState(otherHalfPos, otherHalfState.getFluidState().getBlockState(), Block.NOTIFY_ALL | Block.SKIP_DROPS); + } + spawnBreakParticles(world, player, otherHalfPos, otherHalfState); + if (state.isIn(BlockTags.GUARDED_BY_PIGLINS)) { + PiglinBrain.onGuardedBlockInteracted(player, false); + } + world.emitGameEvent(GameEvent.BLOCK_DESTROY, pos, GameEvent.Emitter.of(player, state)); + } else { + spawnBreakParticles(world, player, pos, state); + if (state.isIn(BlockTags.GUARDED_BY_PIGLINS)) { + PiglinBrain.onGuardedBlockInteracted(player, false); + } + world.emitGameEvent(GameEvent.BLOCK_DESTROY, pos, GameEvent.Emitter.of(player, state)); + } + return state; + } + @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { return new Tile(pos, state); @@ -140,6 +183,7 @@ public class FancyBedBlock extends BedBlock { public enum SheetPattern implements StringIdentifiable { NONE(DyeColor.WHITE), + WHITE(DyeColor.WHITE), LIGHT_GRAY(DyeColor.LIGHT_GRAY), GRAY(DyeColor.GRAY), BLACK(DyeColor.BLACK), diff --git a/src/main/java/com/minelittlepony/unicopia/block/ItemJarBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ItemJarBlock.java new file mode 100644 index 00000000..d5c9c7c3 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/ItemJarBlock.java @@ -0,0 +1,208 @@ +package com.minelittlepony.unicopia.block; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.block.jar.EntityJarContents; +import com.minelittlepony.unicopia.block.jar.FluidOnlyJarContents; +import com.minelittlepony.unicopia.block.jar.ItemsJarContents; +import com.mojang.serialization.MapCodec; +import com.minelittlepony.unicopia.block.jar.FakeFluidJarContents; + +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.minecraft.block.BlockEntityProvider; +import net.minecraft.block.BlockRenderType; +import net.minecraft.block.BlockState; +import net.minecraft.block.InventoryProvider; +import net.minecraft.block.TransparentBlock; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.inventory.SidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUsage; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; +import net.minecraft.network.listener.ClientPlayPacketListener; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldAccess; + +public class ItemJarBlock extends JarBlock implements BlockEntityProvider, InventoryProvider { + public static final MapCodec CODEC = createCodec(ItemJarBlock::new); + + public ItemJarBlock(Settings settings) { + super(settings); + } + + @Override + protected MapCodec getCodec() { + return CODEC; + } + + @Override + public BlockRenderType getRenderType(BlockState state) { + return BlockRenderType.MODEL; + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + if (hand == Hand.OFF_HAND) { + return ActionResult.PASS; + } + return world.getBlockEntity(pos, UBlockEntities.ITEM_JAR).map(data -> data.interact(player, hand)).orElse(ActionResult.PASS); + } + + @Deprecated + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + if (!moved && !state.isOf(newState.getBlock())) { + world.getBlockEntity(pos, UBlockEntities.ITEM_JAR).ifPresent(data -> { + data.getContents().onDestroyed(); + }); + } + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public boolean hasComparatorOutput(BlockState state) { + return true; + } + + @Override + public int getComparatorOutput(BlockState state, World world, BlockPos pos) { + return world.getBlockEntity(pos, UBlockEntities.ITEM_JAR) + .map(TileData::getItems) + .map(data -> Math.min(16, data.stacks().size())) + .orElse(0); + } + + @Deprecated + @Override + public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data) { + super.onSyncedBlockEvent(state, world, pos, type, data); + BlockEntity blockEntity = world.getBlockEntity(pos); + return blockEntity != null && blockEntity.onSyncedBlockEvent(type, data); + } + + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return new TileData(pos, state); + } + + @Nullable + @Override + public SidedInventory getInventory(BlockState state, WorldAccess world, BlockPos pos) { + return world.getBlockEntity(pos, UBlockEntities.ITEM_JAR).map(TileData::getItems).orElse(null); + } + + public static class TileData extends BlockEntity { + + private JarContents contents = new ItemsJarContents(this); + + public TileData(BlockPos pos, BlockState state) { + super(UBlockEntities.ITEM_JAR, pos, state); + } + + public ActionResult interact(PlayerEntity player, Hand hand) { + TypedActionResult result = contents.interact(player, hand); + contents = result.getValue(); + return result.getResult(); + } + + public JarContents getContents() { + return contents; + } + + @Nullable + public ItemsJarContents getItems() { + return getContents() instanceof ItemsJarContents c ? c : null; + } + + @Nullable + public EntityJarContents getEntity() { + return getContents() instanceof EntityJarContents c ? c : null; + } + + @Nullable + public FluidJarContents getFluid() { + return getContents() instanceof FluidJarContents c ? c : null; + } + + @Nullable + public FakeFluidJarContents getFakeFluid() { + return getContents() instanceof FakeFluidJarContents c ? c : null; + } + + @Override + public Packet toUpdatePacket() { + return BlockEntityUpdateS2CPacket.create(this); + } + + @Override + public NbtCompound toInitialChunkDataNbt() { + return createNbt(); + } + + @Override + public void markDirty() { + super.markDirty(); + if (getWorld() instanceof ServerWorld sw) { + sw.getChunkManager().markForUpdate(getPos()); + } + } + + @Override + public void readNbt(NbtCompound nbt) { + if (nbt.contains("items", NbtElement.COMPOUND_TYPE)) { + contents = new ItemsJarContents(this, nbt.getCompound("items")); + } else if (nbt.contains("entity", NbtElement.COMPOUND_TYPE)) { + contents = new EntityJarContents(this, nbt.getCompound("entity")); + } else if (nbt.contains("fluid", NbtElement.COMPOUND_TYPE)) { + contents = new FluidOnlyJarContents(this, nbt.getCompound("fluid")); + } else if (nbt.contains("fakeFluid", NbtElement.COMPOUND_TYPE)) { + contents = new FakeFluidJarContents(this, nbt.getCompound("fakeFluid")); + } + } + + @Override + protected void writeNbt(NbtCompound nbt) { + var items = getItems(); + if (items != null) { + nbt.put("items", items.toNBT(new NbtCompound())); + } else if (getEntity() != null) { + nbt.put("entity", getEntity().toNBT(new NbtCompound())); + } else if (getFluid() != null) { + nbt.put("fluid", getFluid().toNBT(new NbtCompound())); + } else if (getFakeFluid() != null) { + nbt.put("fakeFluid", getFakeFluid().toNBT(new NbtCompound())); + } + } + } + + public interface JarContents { + TypedActionResult interact(PlayerEntity player, Hand hand); + + void onDestroyed(); + + NbtCompound toNBT(NbtCompound compound); + + default void consumeAndSwap(PlayerEntity player, Hand hand, ItemStack output) { + player.setStackInHand(hand, ItemUsage.exchangeStack(player.getStackInHand(hand), player, output.copy())); + } + } + + public interface FluidJarContents extends JarContents { + FluidVariant fluid(); + + default long amount() { + return FluidConstants.BUCKET; + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/JarBlock.java b/src/main/java/com/minelittlepony/unicopia/block/JarBlock.java new file mode 100644 index 00000000..1a06e276 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/JarBlock.java @@ -0,0 +1,116 @@ +package com.minelittlepony.unicopia.block; + +import java.util.Optional; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.item.WeatherJarItem; +import com.minelittlepony.unicopia.particle.LightningBoltParticleEffect; +import com.mojang.serialization.MapCodec; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.TransparentBlock; +import net.minecraft.block.Waterloggable; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.FluidState; +import net.minecraft.fluid.Fluids; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Properties; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import net.minecraft.world.WorldAccess; +import net.minecraft.world.explosion.Explosion; + +public class JarBlock extends TransparentBlock implements Waterloggable { + public static final MapCodec CODEC = createCodec(JarBlock::new); + private static final VoxelShape SHAPE = VoxelShapes.union( + Block.createCuboidShape(4, 0, 4, 12, 12, 12), + Block.createCuboidShape(6, 12, 6, 10, 16, 10), + Block.createCuboidShape(5, 13, 5, 11, 14, 11) + ); + private static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; + + public JarBlock(Settings settings) { + super(settings); + setDefaultState(getDefaultState().with(WATERLOGGED, false)); + } + + @Override + protected MapCodec getCodec() { + return CODEC; + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return SHAPE; + } + + @Deprecated + @Override + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + if (state.get(WATERLOGGED)) { + world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + + return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); + } + + @Nullable + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + return getDefaultState().with(WATERLOGGED, ctx.getWorld().getFluidState(ctx.getBlockPos()).getFluid() == Fluids.WATER); + } + + @Deprecated + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); + } + + @Override + public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { + if (this == UBlocks.LIGHTNING_JAR) { + world.addParticle(new LightningBoltParticleEffect(true, 10, 1, 0.6F, Optional.empty()), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0, 0, 0); + } + } + + @Deprecated + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public void onDestroyedByExplosion(World world, BlockPos pos, Explosion explosion) { + if (asItem() instanceof WeatherJarItem jar) { + jar.releaseContents(world, pos); + } + } + + @Override + public void afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool) { + super.afterBreak(world, player, pos, state, blockEntity, tool); + if (!EnchantmentHelper.hasSilkTouch(tool) && !player.shouldCancelInteraction()) { + if (asItem() instanceof WeatherJarItem jar) { + jar.releaseContents(world, pos); + } + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java b/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java index 2e156f43..8f53a961 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java @@ -85,7 +85,7 @@ public class PieBlock extends Block implements Waterloggable { if (world.isClient) { - if (itemStack.isIn(UTags.CAN_CUT_PIE)) { + if (itemStack.isIn(UTags.Items.CAN_CUT_PIE)) { return ActionResult.SUCCESS; } @@ -98,7 +98,7 @@ public class PieBlock extends Block implements Waterloggable { } } - if (itemStack.isIn(UTags.CAN_CUT_PIE)) { + if (itemStack.isIn(UTags.Items.CAN_CUT_PIE)) { SoundEmitter.playSoundAt(player, USounds.BLOCK_PIE_SLICE, SoundCategory.NEUTRAL, 1, 1); removeSlice(world, pos, state, player); itemStack.damage(1, player, p -> p.sendToolBreakStatus(hand)); diff --git a/src/main/java/com/minelittlepony/unicopia/block/PineappleCropBlock.java b/src/main/java/com/minelittlepony/unicopia/block/PineappleCropBlock.java index 096c3276..cdb11f48 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/PineappleCropBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/PineappleCropBlock.java @@ -47,7 +47,7 @@ public class PineappleCropBlock extends CropBlock { } @Override - protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { + public boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { return floor.isOf(this) || super.canPlantOnTop(floor, world, pos); } diff --git a/src/main/java/com/minelittlepony/unicopia/block/SegmentedCropBlock.java b/src/main/java/com/minelittlepony/unicopia/block/SegmentedCropBlock.java index 07075df9..15dca1e7 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/SegmentedCropBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/SegmentedCropBlock.java @@ -119,7 +119,7 @@ public class SegmentedCropBlock extends CropBlock implements SegmentedBlock { } @Override - protected boolean canPlantOnTop(BlockState state, BlockView view, BlockPos pos) { + public boolean canPlantOnTop(BlockState state, BlockView view, BlockPos pos) { return (state.getBlock() instanceof SegmentedCropBlock o && o.canSupportBlock(this, state, view, pos)) || super.canPlantOnTop(state, view, pos); } @@ -226,4 +226,8 @@ public class SegmentedCropBlock extends CropBlock implements SegmentedBlock { return state.getBlock() == this || (nextSegmentSupplier != null && nextSegmentSupplier.get().isNext(state)); } + @Nullable + public SegmentedCropBlock getNext() { + return nextSegmentSupplier == null ? null : nextSegmentSupplier.get(); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java b/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java index 22d059aa..94f04f1f 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java @@ -208,7 +208,7 @@ public class SlimePustuleBlock extends Block { public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { super.onStateReplaced(state, world, pos, newState, moved); if (state.isOf(this) && newState.isOf(this) && state.get(POWERED) != newState.get(POWERED)) { - world.updateNeighbor(pos.up(), this, pos); + world.updateNeighborsAlways(pos.up(), this); } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlockEntities.java b/src/main/java/com/minelittlepony/unicopia/block/UBlockEntities.java index 47a64397..87b25155 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlockEntities.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlockEntities.java @@ -15,6 +15,7 @@ public interface UBlockEntities { BlockEntityType FANCY_BED = create("fancy_bed", BlockEntityType.Builder.create(CloudBedBlock.Tile::new, UBlocks.CLOTH_BED, UBlocks.CLOUD_BED)); BlockEntityType CLOUD_CHEST = create("cloud_chest", BlockEntityType.Builder.create(CloudChestBlock.TileData::new, UBlocks.CLOUD_CHEST)); BlockEntityType HIVE_STORAGE = create("hive_storage", BlockEntityType.Builder.create(HiveBlock.TileData::new, UBlocks.HIVE)); + BlockEntityType ITEM_JAR = create("item_jar", BlockEntityType.Builder.create(ItemJarBlock.TileData::new, UBlocks.JAR)); static BlockEntityType create(String id, Builder builder) { return Registry.register(Registries.BLOCK_ENTITY_TYPE, id, builder.build(null)); diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index 39375fc8..ced180ba 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -36,6 +36,7 @@ import com.minelittlepony.unicopia.item.cloud.CloudBlockItem; import com.minelittlepony.unicopia.item.group.ItemGroupRegistry; import com.minelittlepony.unicopia.server.world.UTreeGen; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.registry.CompostingChanceRegistry; import net.fabricmc.fabric.api.registry.FlammableBlockRegistry; import net.fabricmc.fabric.api.registry.OxidizableBlocksRegistry; import net.fabricmc.fabric.api.registry.StrippableBlockRegistry; @@ -47,6 +48,7 @@ import net.minecraft.block.enums.Instrument; import net.minecraft.block.piston.PistonBehavior; import net.minecraft.item.*; import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.ColorCode; import net.minecraft.util.Identifier; import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShapes; @@ -250,7 +252,13 @@ public interface UBlocks { Block CLOUD_DOOR = register("cloud_door", new CloudDoorBlock(CLOUD.getDefaultState(), UWoodTypes.CLOUD, Settings.copy(CLOUD)), ItemGroups.FUNCTIONAL); Block SPECTRAL_FIRE = register("spectral_fire", new SpectralFireBlock(Settings.copy(Blocks.SOUL_FIRE))); + Block JAR = register("jar", new ItemJarBlock(Settings.copy(Blocks.GLASS))); + Block CLOUD_JAR = register("cloud_jar", new JarBlock(Settings.copy(Blocks.GLASS))); + Block STORM_JAR = register("storm_jar", new JarBlock(Settings.copy(Blocks.GLASS))); + Block LIGHTNING_JAR = register("lightning_jar", new JarBlock(Settings.copy(Blocks.GLASS))); + Block ZAP_JAR = register("zap_jar", new JarBlock(Settings.copy(Blocks.GLASS))); + Block WORM_BLOCK = register("worm_block", new ColoredFallingBlock(new ColorCode(0xFF0088), Settings.create().hardness(0.1F).resistance(0).requiresTool().sounds(BlockSoundGroup.MUD)), ItemGroups.NATURAL); EdibleBlock HAY_BLOCK = register("hay_block", new EdibleBlock(new Identifier("hay_block"), new Identifier("wheat"), true)); private static T register(String name, T item) { @@ -301,7 +309,10 @@ public interface UBlocks { OxidizableBlocksRegistry.registerWaxableBlockPair(ZAP_SLAB, WAXED_ZAP_SLAB); OxidizableBlocksRegistry.registerWaxableBlockPair(ZAP_FENCE, WAXED_ZAP_FENCE); OxidizableBlocksRegistry.registerWaxableBlockPair(ZAP_FENCE_GATE, WAXED_ZAP_FENCE_GATE); - Collections.addAll(TRANSLUCENT_BLOCKS, WEATHER_VANE, CHITIN_SPIKES, PLUNDER_VINE, PLUNDER_VINE_BUD, CLAM_SHELL, SCALLOP_SHELL, TURRET_SHELL, CURING_JOKE, SPECTRAL_FIRE); + Collections.addAll(TRANSLUCENT_BLOCKS, + WEATHER_VANE, CHITIN_SPIKES, PLUNDER_VINE, PLUNDER_VINE_BUD, CLAM_SHELL, SCALLOP_SHELL, TURRET_SHELL, CURING_JOKE, SPECTRAL_FIRE, + JAR, CLOUD_JAR, STORM_JAR, LIGHTNING_JAR, ZAP_JAR + ); TintedBlock.REGISTRY.add(PALM_LEAVES); FlammableBlockRegistry.getDefaultInstance().add(GREEN_APPLE_LEAVES, 30, 60); @@ -326,6 +337,8 @@ public interface UBlocks { FlammableBlockRegistry.getDefaultInstance().add(BANANAS, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(CURING_JOKE, 60, 100); + CompostingChanceRegistry.INSTANCE.add(WORM_BLOCK, 1F); + UBlockEntities.bootstrap(); EdibleBlock.bootstrap(); } diff --git a/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java b/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java index 5453677d..0b6d9471 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java @@ -185,7 +185,7 @@ public class CloudBlock extends Block implements CloudLike { } protected boolean canInteract(BlockState state, BlockView world, BlockPos pos, EquineContext context) { - return context.collidesWithClouds(); + return context.collidesWithClouds() || context.hasFeatherTouch(); } @SuppressWarnings("deprecation") diff --git a/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudPillarBlock.java b/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudPillarBlock.java index 301f1d62..2c646726 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudPillarBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudPillarBlock.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia.block.cloud; import java.util.Map; +import java.util.function.Function; import org.jetbrains.annotations.Nullable; @@ -9,13 +10,18 @@ import com.mojang.serialization.MapCodec; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.PillarBlock; import net.minecraft.block.ShapeContext; import net.minecraft.item.ItemPlacementContext; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.Properties; +import net.minecraft.util.BlockRotation; +import net.minecraft.util.Util; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Direction.AxisDirection; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; @@ -23,29 +29,34 @@ import net.minecraft.world.WorldAccess; public class CloudPillarBlock extends CloudBlock { private static final MapCodec CODEC = Block.createCodec(CloudPillarBlock::new); - private static final BooleanProperty NORTH = Properties.NORTH; - private static final BooleanProperty SOUTH = Properties.SOUTH; + public static final EnumProperty AXIS = Properties.AXIS; + private static final BooleanProperty TOP = Properties.NORTH; + private static final BooleanProperty BOTTOM = Properties.SOUTH; private static final Map DIRECTION_PROPERTIES = Map.of( - Direction.UP, NORTH, - Direction.DOWN, SOUTH + Direction.UP, TOP, Direction.DOWN, BOTTOM, + Direction.SOUTH, TOP, Direction.NORTH, BOTTOM, + Direction.EAST, TOP, Direction.WEST, BOTTOM ); - - private static final VoxelShape CORE_SHAPE = Block.createCuboidShape(1, 0, 1, 15, 16, 15); - private static final VoxelShape FOOT_SHAPE = Block.createCuboidShape(0, 0, 0, 16, 5, 16); - private static final VoxelShape CAP_SHAPE = FOOT_SHAPE.offset(0, 11F / 16F, 0); - - private static final VoxelShape[] SHAPES = new VoxelShape[] { - CORE_SHAPE, - VoxelShapes.union(CORE_SHAPE, FOOT_SHAPE), - VoxelShapes.union(CORE_SHAPE, CAP_SHAPE), - VoxelShapes.union(CORE_SHAPE, FOOT_SHAPE, CAP_SHAPE) - }; - // [0,0] [0,1] - // [1,0] [1,1] + private static final Function SHAPES = Util.memoize(axis -> { + int[] offsets = { axis.choose(1, 0, 0), axis.choose(0, 1, 0), axis.choose(0, 0, 1) }; + float capOffset = 11F / 16F; + VoxelShape core = Block.createCuboidShape( + axis.choose(0, 1, 1), axis.choose(1, 0, 1), axis.choose(1, 1, 0), + 16 - axis.choose(0, 1, 1), 16 - axis.choose(1, 0, 1), 16 - axis.choose(1, 1, 0) + ); + VoxelShape foot = Block.createCuboidShape(0, 0, 0, 16 - (11 * offsets[0]), 16 - (11 * offsets[1]), 16 - (11 * offsets[2])); + VoxelShape cap = foot.offset(capOffset * offsets[0], capOffset * offsets[1], capOffset * offsets[2]); + return new VoxelShape[] { + core, + VoxelShapes.union(core, foot), + VoxelShapes.union(core, cap), + VoxelShapes.union(core, cap, foot) + }; + }); public CloudPillarBlock(Settings settings) { super(false, settings); - setDefaultState(getDefaultState().with(NORTH, true).with(SOUTH, true)); + setDefaultState(getDefaultState().with(TOP, true).with(BOTTOM, true).with(AXIS, Direction.Axis.Y)); } @Override @@ -55,32 +66,41 @@ public class CloudPillarBlock extends CloudBlock { @Override protected void appendProperties(StateManager.Builder builder) { - builder.add(NORTH, SOUTH); + builder.add(AXIS, TOP, BOTTOM); } @Override protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, EquineContext equineContext) { - return SHAPES[(state.get(NORTH) ? 0 : 2) + (state.get(SOUTH) ? 0 : 1)]; + return SHAPES.apply(state.get(AXIS))[(state.get(TOP) ? 0 : 2) + (state.get(BOTTOM) ? 0 : 1)]; } @Override @Nullable protected BlockState getPlacementState(ItemPlacementContext placementContext, EquineContext equineContext) { BlockPos pos = placementContext.getBlockPos(); - BlockState state = super.getPlacementState(placementContext, equineContext); - for (var property : DIRECTION_PROPERTIES.entrySet()) { - state = state.with(property.getValue(), placementContext.getWorld().getBlockState(pos.offset(property.getKey())).isOf(this)); - } - return state; + Direction.Axis axis = placementContext.getSide().getAxis(); + Direction upDirection = Direction.get(AxisDirection.POSITIVE, axis); + Direction downDirection = Direction.get(AxisDirection.NEGATIVE, axis); + BlockState above = placementContext.getWorld().getBlockState(pos.offset(upDirection)); + BlockState below = placementContext.getWorld().getBlockState(pos.offset(downDirection)); + return super.getPlacementState(placementContext, equineContext) + .with(DIRECTION_PROPERTIES.get(upDirection), above.isOf(this) && above.get(AXIS) == axis) + .with(DIRECTION_PROPERTIES.get(downDirection), below.isOf(this) && below.get(AXIS) == axis) + .with(AXIS, axis); } @Deprecated @Override public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { - if (direction.getAxis() == Direction.Axis.Y) { - return state.with(DIRECTION_PROPERTIES.get(direction), neighborState.isOf(this)); + if (direction.getAxis() == state.get(AXIS)) { + return state.with(DIRECTION_PROPERTIES.get(direction), neighborState.isOf(this) && neighborState.get(AXIS) == state.get(AXIS)); } return state; } + + @Override + public BlockState rotate(BlockState state, BlockRotation rotation) { + return PillarBlock.changeRotation(state, rotation); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/jar/EntityJarContents.java b/src/main/java/com/minelittlepony/unicopia/block/jar/EntityJarContents.java new file mode 100644 index 00000000..967807c1 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/jar/EntityJarContents.java @@ -0,0 +1,80 @@ +package com.minelittlepony.unicopia.block.jar; + +import java.util.function.Supplier; + +import org.jetbrains.annotations.Nullable; + +import com.google.common.base.Suppliers; +import com.minelittlepony.unicopia.block.ItemJarBlock.FluidJarContents; +import com.minelittlepony.unicopia.block.ItemJarBlock.JarContents; +import com.minelittlepony.unicopia.block.ItemJarBlock.TileData; + +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.minecraft.block.Blocks; +import net.minecraft.entity.Bucketable; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluids; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.Registries; +import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; +import net.minecraft.util.TypedActionResult; + +public record EntityJarContents ( + TileData tile, + @Nullable EntityType entityType, + Supplier<@Nullable Entity> entity +) implements FluidJarContents { + public EntityJarContents(TileData tile, NbtCompound compound) { + this(tile, Registries.ENTITY_TYPE.getOrEmpty(Identifier.tryParse(compound.getString("entity"))).orElse(null)); + } + + public EntityJarContents(TileData tile) { + this(tile, (EntityType)null); + } + + public EntityJarContents(TileData tile, EntityType entityType) { + this(tile, entityType, Suppliers.memoize(() -> { + return entityType == null ? null : entityType.create(tile.getWorld()); + })); + } + + @Override + public TypedActionResult interact(PlayerEntity player, Hand hand) { + ItemStack stack = player.getStackInHand(hand); + if (stack.isOf(Items.BUCKET)) { + if (entity().get() instanceof Bucketable bucketable) { + consumeAndSwap(player, hand, bucketable.getBucketItem()); + player.playSound(bucketable.getBucketFillSound(), 1, 1); + } + tile.markDirty(); + return TypedActionResult.success(new ItemsJarContents(tile)); + } + return TypedActionResult.pass(this); + } + + @Override + public void onDestroyed() { + tile.getWorld().setBlockState(tile.getPos(), Blocks.WATER.getDefaultState()); + Entity entity = entity().get(); + if (entity != null) { + entity.refreshPositionAfterTeleport(tile.getPos().toCenterPos()); + tile.getWorld().spawnEntity(entity); + } + } + + @Override + public NbtCompound toNBT(NbtCompound compound) { + compound.putString("entity", EntityType.getId(entityType).toString()); + return compound; + } + + @Override + public FluidVariant fluid() { + return FluidVariant.of(Fluids.WATER); + } +} \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/block/jar/FakeFluidJarContents.java b/src/main/java/com/minelittlepony/unicopia/block/jar/FakeFluidJarContents.java new file mode 100644 index 00000000..e49d648c --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/jar/FakeFluidJarContents.java @@ -0,0 +1,79 @@ +package com.minelittlepony.unicopia.block.jar; + +import java.util.Optional; + +import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.block.ItemJarBlock.JarContents; +import com.minelittlepony.unicopia.block.ItemJarBlock.TileData; +import com.minelittlepony.unicopia.util.FluidHelper; + +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluid; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.Registries; +import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; +import net.minecraft.util.TypedActionResult; + +public record FakeFluidJarContents ( + TileData tile, + String fluid, + int color, + Item empty, + Item filled +) implements JarContents { + public FakeFluidJarContents(TileData tile, NbtCompound compound) { + this(tile, compound.getString("fluid"), compound.getInt("color"), + Registries.ITEM.get(new Identifier(compound.getString("empty"))), + Registries.ITEM.get(new Identifier(compound.getString("filled")))); + } + + @Override + public TypedActionResult interact(PlayerEntity player, Hand hand) { + ItemStack stack = player.getStackInHand(hand); + + tile.markDirty(); + return getRealFluid().map(FluidVariant::of).>map(fluid -> { + long remainder = FluidHelper.deposit(stack, player, hand, fluid, FluidConstants.BUCKET); + fluid.getFluid().getBucketFillSound().ifPresent(sound -> player.playSound(sound, 1, 1)); + if (remainder > 0) { + return TypedActionResult.success(new FluidOnlyJarContents(tile, remainder, fluid)); + } + return TypedActionResult.success(new ItemsJarContents(tile)); + }).orElseGet(() -> { + if (!stack.isOf(empty)) { + return TypedActionResult.pass(this); + } + consumeAndSwap(player, hand, filled.getDefaultStack()); + player.playSound("powder_snow".equalsIgnoreCase(fluid) ? USounds.Vanilla.ITEM_BUCKET_FILL_POWDER_SNOW : USounds.Vanilla.ITEM_BUCKET_FILL, 1, 1); + return TypedActionResult.success(new ItemsJarContents(tile)); + }); + } + + @Override + public void onDestroyed() { + getRealFluid().ifPresent(fluid -> { + tile.getWorld().setBlockState(tile.getPos(), FluidHelper.getFullFluidState(FluidVariant.of(fluid)).getBlockState()); + }); + } + + @Override + public NbtCompound toNBT(NbtCompound compound) { + compound.putString("fluid", fluid); + compound.putInt("color", color); + compound.putString("empty", Registries.ITEM.getId(empty).toString()); + compound.putString("filled", Registries.ITEM.getId(filled).toString()); + return compound; + } + + private Optional getRealFluid() { + return Registries.FLUID.getIds().stream() + .filter(id -> id.getPath().equalsIgnoreCase(fluid)) + .findFirst() + .map(Registries.FLUID::get); + } +} \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/block/jar/FluidOnlyJarContents.java b/src/main/java/com/minelittlepony/unicopia/block/jar/FluidOnlyJarContents.java new file mode 100644 index 00000000..0cdcab4b --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/jar/FluidOnlyJarContents.java @@ -0,0 +1,55 @@ +package com.minelittlepony.unicopia.block.jar; + +import com.minelittlepony.unicopia.block.ItemJarBlock.FluidJarContents; +import com.minelittlepony.unicopia.block.ItemJarBlock.JarContents; +import com.minelittlepony.unicopia.block.ItemJarBlock.TileData; +import com.minelittlepony.unicopia.util.FluidHelper; + +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; + +public record FluidOnlyJarContents ( + TileData tile, + long amount, + FluidVariant fluid +) implements FluidJarContents { + + public FluidOnlyJarContents(TileData tile, NbtCompound compound) { + this(tile, compound.getLong("amount"), FluidVariant.fromNbt(compound.getCompound("fluid"))); + } + + @Override + public TypedActionResult interact(PlayerEntity player, Hand hand) { + ItemStack stack = player.getStackInHand(hand); + if (stack.isOf(Items.BUCKET)) { + long remainder = FluidHelper.deposit(stack, player, hand, fluid, amount); + tile.markDirty(); + fluid.getFluid().getBucketFillSound().ifPresent(sound -> player.playSound(sound, 1, 1)); + if (remainder > 0) { + return TypedActionResult.success(new FluidOnlyJarContents(tile, remainder, fluid)); + } + return TypedActionResult.success(new ItemsJarContents(tile)); + } + return TypedActionResult.pass(this); + } + + @Override + public void onDestroyed() { + if (amount >= FluidConstants.BUCKET) { + tile.getWorld().setBlockState(tile.getPos(), FluidHelper.getFullFluidState(fluid).getBlockState()); + } + } + + @Override + public NbtCompound toNBT(NbtCompound compound) { + compound.put("fluid", fluid.toNbt()); + compound.putLong("amount", amount); + return compound; + } +} \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/block/jar/ItemsJarContents.java b/src/main/java/com/minelittlepony/unicopia/block/jar/ItemsJarContents.java new file mode 100644 index 00000000..a406c3dd --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/jar/ItemsJarContents.java @@ -0,0 +1,208 @@ +package com.minelittlepony.unicopia.block.jar; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.block.ItemJarBlock.JarContents; +import com.minelittlepony.unicopia.block.ItemJarBlock.TileData; +import com.minelittlepony.unicopia.item.UItems; +import com.minelittlepony.unicopia.mixin.MixinEntityBucketItem; +import com.minelittlepony.unicopia.util.FluidHelper; +import com.minelittlepony.unicopia.util.NbtSerialisable; + +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.minecraft.block.Block; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.inventory.SidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; +import net.minecraft.util.Hand; +import net.minecraft.util.Pair; +import net.minecraft.util.TypedActionResult; +import net.minecraft.util.math.Direction; + +public record ItemsJarContents ( + TileData tile, + List stacks + ) implements JarContents, SidedInventory { + private static final int[] SLOTS = IntStream.range(0, 16).toArray(); + + public ItemsJarContents(TileData tile) { + this(tile, new ArrayList<>()); + } + + public ItemsJarContents(TileData tile, NbtCompound compound) { + this(tile, NbtSerialisable.ITEM_STACK.readAll(compound.getList("items", NbtElement.COMPOUND_TYPE)) + .limit(15) + .collect(Collectors.toList())); + } + + @Override + public TypedActionResult interact(PlayerEntity player, Hand hand) { + ItemStack handStack = player.getStackInHand(hand); + + if (handStack.isEmpty()) { + if (stacks.isEmpty()) { + return TypedActionResult.fail(this); + } + Block.dropStack(tile.getWorld(), tile.getPos(), stacks.remove(0)); + markDirty(); + return TypedActionResult.success(this); + } + + if (stacks.isEmpty()) { + if (handStack.getItem() instanceof MixinEntityBucketItem bucket) { + consumeAndSwap(player, hand, Items.BUCKET.getDefaultStack()); + player.playSound(bucket.getEmptyingSound(), 1, 1); + markDirty(); + return TypedActionResult.success(new EntityJarContents(tile, bucket.getEntityType())); + } + + Pair fluid = FluidHelper.extract(handStack, player, hand).orElse(null); + if (fluid != null) { + fluid.getRight().getFluid().getBucketFillSound().ifPresent(sound -> player.playSound(sound, 1, 1)); + markDirty(); + return TypedActionResult.success(new FluidOnlyJarContents(tile, fluid.getLeft(), fluid.getRight())); + } + + if (handStack.isOf(Items.MILK_BUCKET)) { + consumeAndSwap(player, hand, handStack.getRecipeRemainder()); + player.playSound(USounds.Vanilla.ITEM_BUCKET_EMPTY, 1, 1); + markDirty(); + return TypedActionResult.success(new FakeFluidJarContents(tile, "milk", 0xFFFFFFFF, Items.BUCKET, Items.MILK_BUCKET)); + } + + if (handStack.isOf(Items.POWDER_SNOW_BUCKET)) { + consumeAndSwap(player, hand, Items.BUCKET.getDefaultStack()); + player.playSound(USounds.Vanilla.ITEM_BUCKET_EMPTY_POWDER_SNOW, 1, 1); + markDirty(); + return TypedActionResult.success(new FakeFluidJarContents(tile, "powder_snow", 0xFFFFFFFF, Items.BUCKET, Items.POWDER_SNOW_BUCKET)); + } + + if (handStack.isOf(UItems.LOVE_BUCKET)) { + consumeAndSwap(player, hand, handStack.getRecipeRemainder()); + player.playSound(USounds.Vanilla.ITEM_BUCKET_EMPTY, 1, 1); + markDirty(); + return TypedActionResult.success(new FakeFluidJarContents(tile, "love", 0xFF3030, Items.BUCKET, UItems.LOVE_BUCKET)); + } + + if (handStack.isOf(UItems.JUICE)) { + consumeAndSwap(player, hand, handStack.getRecipeRemainder()); + player.playSound(USounds.Vanilla.ITEM_BUCKET_EMPTY, 1, 1); + markDirty(); + return TypedActionResult.success(new FakeFluidJarContents(tile, "apple_juice", 0x30FF30, Items.GLASS_BOTTLE, UItems.JUICE)); + } + } + + if (stacks.size() >= size()) { + return TypedActionResult.fail(this); + } + stacks.add(player.isCreative() ? handStack.copyWithCount(1) : handStack.split(1)); + markDirty(); + + return TypedActionResult.success(this); + } + + @Override + public void onDestroyed() { + stacks.forEach(stack -> Block.dropStack(tile.getWorld(), tile.getPos(), stack)); + } + + @Override + public int size() { + return 15; + } + + @Override + public boolean isEmpty() { + return stacks.isEmpty(); + } + + @Override + public ItemStack getStack(int slot) { + return slot < 0 || slot >= stacks.size() ? ItemStack.EMPTY : stacks.get(slot); + } + + @Override + public ItemStack removeStack(int slot, int amount) { + if (slot < 0 || slot >= stacks.size()) { + return ItemStack.EMPTY; + } + + try { + ItemStack stack = stacks.get(slot); + ItemStack removed = stack.split(1); + if (stack.isEmpty()) { + stacks.remove(slot); + } + return removed; + } finally { + markDirty(); + } + } + + @Override + public ItemStack removeStack(int slot) { + if (slot < 0 || slot >= stacks.size()) { + return ItemStack.EMPTY; + } + + try { + return stacks.remove(slot); + } finally { + markDirty(); + } + } + + @Override + public void setStack(int slot, ItemStack stack) { + if (slot >= stacks.size()) { + stacks.add(stack); + } else { + stacks.set(slot, stack); + } + markDirty(); + } + + @Override + public boolean canPlayerUse(PlayerEntity player) { + return false; + } + + @Override + public void clear() { + stacks.clear(); + markDirty(); + } + + @Override + public int[] getAvailableSlots(Direction side) { + return SLOTS; + } + + @Override + public boolean canInsert(int slot, ItemStack stack, Direction dir) { + return slot >= 0 && slot < size() && slot >= stacks.size(); + } + + @Override + public boolean canExtract(int slot, ItemStack stack, Direction dir) { + return slot >= 0 && slot < size() && slot < stacks.size(); + } + + @Override + public NbtCompound toNBT(NbtCompound compound) { + compound.put("items", NbtSerialisable.ITEM_STACK.writeAll(stacks)); + return compound; + } + + @Override + public void markDirty() { + tile.markDirty(); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java b/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java index 837b65fd..13352054 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java +++ b/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java @@ -41,6 +41,8 @@ import net.minecraft.network.PacketByteBuf; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.sound.SoundCategory; import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; @@ -161,4 +163,9 @@ public class ClientInteractionManager extends InteractionManager { c.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(player.getYaw(), player.getPitch(), player.isOnGround())); } } + + @Override + public void addBlockBreakingParticles(BlockPos pos, Direction direction) { + client.particleManager.addBlockBreakingParticles(pos, direction); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/client/URenderers.java b/src/main/java/com/minelittlepony/unicopia/client/URenderers.java index 69d0ab9c..747465b5 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/URenderers.java +++ b/src/main/java/com/minelittlepony/unicopia/client/URenderers.java @@ -12,6 +12,7 @@ import com.minelittlepony.unicopia.client.particle.CloudsEscapingParticle; import com.minelittlepony.unicopia.client.particle.DiskParticle; import com.minelittlepony.unicopia.client.particle.DustCloudParticle; import com.minelittlepony.unicopia.client.particle.FloatingBubbleParticle; +import com.minelittlepony.unicopia.client.particle.FootprintParticle; import com.minelittlepony.unicopia.client.particle.GroundPoundParticle; import com.minelittlepony.unicopia.client.particle.HealthDrainParticle; import com.minelittlepony.unicopia.client.particle.LightningBoltParticle; @@ -19,7 +20,6 @@ import com.minelittlepony.unicopia.client.particle.MagicParticle; import com.minelittlepony.unicopia.client.particle.RainboomParticle; import com.minelittlepony.unicopia.client.particle.RainbowTrailParticle; import com.minelittlepony.unicopia.client.particle.RaindropsParticle; -import com.minelittlepony.unicopia.client.particle.RunesParticle; import com.minelittlepony.unicopia.client.particle.ShockwaveParticle; import com.minelittlepony.unicopia.client.particle.SphereParticle; import com.minelittlepony.unicopia.client.render.*; @@ -54,6 +54,7 @@ import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.*; import net.minecraft.client.render.VertexConsumerProvider.Immediate; import net.minecraft.client.render.block.entity.BlockEntityRendererFactories; +import net.minecraft.client.render.entity.EmptyEntityRenderer; import net.minecraft.client.render.entity.FlyingItemEntityRenderer; import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.model.json.ModelTransformationMode; @@ -68,7 +69,6 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockRenderView; -@SuppressWarnings("deprecation") public interface URenderers { BlockEntity CHEST_RENDER_ENTITY = new CloudChestBlock.TileData(BlockPos.ORIGIN, UBlocks.CLOUD_CHEST.getDefaultState()); @@ -78,10 +78,10 @@ public interface URenderers { ParticleFactoryRegistry.getInstance().register(UParticles.BUBBLE, createFactory(FloatingBubbleParticle::new)); ParticleFactoryRegistry.getInstance().register(UParticles.RAIN_DROPS, createFactory(RaindropsParticle::new)); ParticleFactoryRegistry.getInstance().register(UParticles.HEALTH_DRAIN, createFactory(HealthDrainParticle::create)); + ParticleFactoryRegistry.getInstance().register(UParticles.FOOTPRINT, createFactory(FootprintParticle::new)); ParticleFactoryRegistry.getInstance().register(UParticles.RAINBOOM_RING, RainboomParticle::new); ParticleFactoryRegistry.getInstance().register(UParticles.RAINBOOM_TRAIL, RainbowTrailParticle::new); ParticleFactoryRegistry.getInstance().register(UParticles.SHOCKWAVE, ShockwaveParticle::new); - ParticleFactoryRegistry.getInstance().register(UParticles.MAGIC_RUNES, RunesParticle::new); ParticleFactoryRegistry.getInstance().register(UParticles.SPHERE, SphereParticle::new); ParticleFactoryRegistry.getInstance().register(UParticles.DISK, DiskParticle::new); ParticleFactoryRegistry.getInstance().register(UParticles.GROUND_POUND, GroundPoundParticle::new); @@ -111,10 +111,12 @@ public interface URenderers { EntityRendererRegistry.register(UEntities.LOOT_BUG, LootBugEntityRenderer::new); EntityRendererRegistry.register(UEntities.TENTACLE, TentacleEntityRenderer::new); EntityRendererRegistry.register(UEntities.IGNOMINIOUS_BULB, IgnominiousBulbEntityRenderer::new); + EntityRendererRegistry.register(UEntities.SPECTER, EmptyEntityRenderer::new); BlockEntityRendererFactories.register(UBlockEntities.WEATHER_VANE, WeatherVaneBlockEntityRenderer::new); BlockEntityRendererFactories.register(UBlockEntities.FANCY_BED, CloudBedBlockEntityRenderer::new); BlockEntityRendererFactories.register(UBlockEntities.CLOUD_CHEST, CloudChestBlockEntityRenderer::new); + BlockEntityRendererFactories.register(UBlockEntities.ITEM_JAR, ItemJarBlockEntityRenderer::new); register(URenderers::renderJarItem, UItems.FILLED_JAR); register(URenderers::renderBedItem, UItems.CLOTH_BED, UItems.CLOUD_BED); diff --git a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java index e7face1d..c8d9bcff 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java +++ b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java @@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.client; import java.util.Optional; import org.jetbrains.annotations.Nullable; +import org.joml.Vector3f; import com.minelittlepony.common.client.gui.element.Button; import com.minelittlepony.common.event.ScreenInitCallback; @@ -33,11 +34,14 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.OpenToLanScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.ingame.HandledScreens; +import net.minecraft.client.render.Camera; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.resource.ResourceType; import net.minecraft.text.Text; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; public class UnicopiaClient implements ClientModInitializer { @@ -66,6 +70,20 @@ public class UnicopiaClient implements ClientModInitializer { return Optional.empty(); } + + public static Vec3d getAdjustedSoundPosition(Vec3d pos) { + PlayerCamera cam = getCamera().orElse(null); + if (cam == null) { + return pos; + } + Camera camera = MinecraftClient.getInstance().gameRenderer.getCamera(); + + Vector3f rotated = pos.subtract(camera.getPos()).toVector3f(); + rotated = rotated.rotateAxis(cam.calculateRoll() * MathHelper.RADIANS_PER_DEGREE, 0, 1, 0); + + return new Vec3d(rotated).add(camera.getPos()); + } + public static Race getPreferredRace() { if (!Unicopia.getConfig().ignoreMineLP.get() && MinecraftClient.getInstance().player != null) { diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookCraftingPageContent.java b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookCraftingPageContent.java index fa7c365e..c23705a6 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookCraftingPageContent.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookCraftingPageContent.java @@ -7,7 +7,7 @@ import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellbookRecipe; import com.minelittlepony.unicopia.client.gui.DrawableUtil; import com.minelittlepony.unicopia.client.gui.MagicText; import com.minelittlepony.unicopia.container.SpellbookState; -import com.minelittlepony.unicopia.item.URecipes; +import com.minelittlepony.unicopia.recipe.URecipes; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.DrawContext; diff --git a/src/main/java/com/minelittlepony/unicopia/client/particle/FootprintParticle.java b/src/main/java/com/minelittlepony/unicopia/client/particle/FootprintParticle.java new file mode 100644 index 00000000..32075c5e --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/client/particle/FootprintParticle.java @@ -0,0 +1,74 @@ +package com.minelittlepony.unicopia.client.particle; + +import org.joml.Vector3f; + +import com.minelittlepony.unicopia.particle.FootprintParticleEffect; + +import net.minecraft.client.particle.ParticleTextureSheet; +import net.minecraft.client.particle.SpriteBillboardParticle; +import net.minecraft.client.particle.SpriteProvider; +import net.minecraft.client.render.Camera; +import net.minecraft.client.render.VertexConsumer; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; + +public class FootprintParticle extends SpriteBillboardParticle { + // specter + + public FootprintParticle(FootprintParticleEffect effect, SpriteProvider provider, ClientWorld world, double x, double y, double z, double dx, double dy, double dz) { + super(world, x, y, z, 0, 0, 0); + setVelocity(0, 0, 0); + setSprite(provider.getSprite(world.random)); + this.angle = effect.yaw() * MathHelper.RADIANS_PER_DEGREE; + this.maxAge = 1000; + this.gravityStrength = 1; + } + + @Override + public ParticleTextureSheet getType() { + return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; + } + + @Override + public void tick() { + super.tick(); + } + + @Override + public void buildGeometry(VertexConsumer drawer, Camera camera, float tickDelta) { + Vec3d cam = camera.getPos(); + + float renderX = (float)(MathHelper.lerp(tickDelta, prevPosX, x) - cam.getX()); + float renderY = (float)(MathHelper.lerp(tickDelta, prevPosY, y) - cam.getY()); + float renderZ = (float)(MathHelper.lerp(tickDelta, prevPosZ, z) - cam.getZ()); + + Vector3f[] corners = new Vector3f[]{ + new Vector3f(-1, 0, -1), + new Vector3f(-1, 0, 1), + new Vector3f( 1, 0, 1), + new Vector3f( 1, 0, -1) + }; + for (int k = 0; k < 4; ++k) { + Vector3f corner = corners[k]; + corner.mul(0.2F); + corner.rotateAxis(angle, 0, 1, 0); + corner.add(renderX, renderY + 0.0001F, renderZ); + } + + float alpha = this.alpha * (1 - ((float)age / maxAge)); + int light = getBrightness(tickDelta); + + float minU = this.sprite.getMinU(); + float maxU = this.sprite.getMaxU(); + + float minV = this.sprite.getMinV(); + float maxV = this.sprite.getMaxV(); + + drawer.vertex(corners[0].x, corners[0].y, corners[0].z).texture(minU, minV).color(red, green, blue, alpha).light(light).next(); + drawer.vertex(corners[1].x, corners[1].y, corners[1].z).texture(maxU, minV).color(red, green, blue, alpha).light(light).next(); + drawer.vertex(corners[2].x, corners[2].y, corners[2].z).texture(maxU, maxV).color(red, green, blue, alpha).light(light).next(); + drawer.vertex(corners[3].x, corners[3].y, corners[3].z).texture(minU, maxV).color(red, green, blue, alpha).light(light).next(); + } + +} diff --git a/src/main/java/com/minelittlepony/unicopia/client/particle/RunesParticle.java b/src/main/java/com/minelittlepony/unicopia/client/particle/RunesParticle.java deleted file mode 100644 index 21294ca3..00000000 --- a/src/main/java/com/minelittlepony/unicopia/client/particle/RunesParticle.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.minelittlepony.unicopia.client.particle; - -import org.joml.Quaternionf; -import org.joml.Vector3f; - -import com.minelittlepony.unicopia.Unicopia; -import com.minelittlepony.unicopia.particle.OrientedBillboardParticleEffect; -import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.Tessellator; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.*; - -@Deprecated -public class RunesParticle extends OrientedBillboardParticle { - - private static final Identifier[] TEXTURES = new Identifier[] { - Unicopia.id("textures/particles/runes_0.png"), - Unicopia.id("textures/particles/runes_1.png"), - Unicopia.id("textures/particles/runes_2.png"), - Unicopia.id("textures/particles/runes_3.png"), - Unicopia.id("textures/particles/runes_4.png"), - Unicopia.id("textures/particles/runes_5.png") - }; - - protected float targetSize = 3; - - protected float prevBaseSize = 0; - protected float baseSize = 0; - - private float prevRotationAngle; - private float rotationAngle; - - public RunesParticle(OrientedBillboardParticleEffect effect, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { - super(effect, world, x, y, z, velocityX, velocityY, velocityZ); - setMaxAge(70); - - red = world.random.nextFloat(); - green = world.random.nextFloat(); - blue = world.random.nextFloat(); - } - - @Override - public float getScale(float tickDelta) { - return MathHelper.lerp(tickDelta, prevBaseSize, baseSize) * super.getScale(tickDelta); - } - - @Override - protected Identifier getTexture() { - return TEXTURES[0]; - } - - private float getAlphaScale() { - float transitionScale = age < maxAge / 2 ? 5 : 3; - return (float)Math.min(1, Math.sin(Math.PI * age / maxAge) * transitionScale); - } - - @Override - protected int getBrightness(float tint) { - return 0xF000F0; - } - - @Override - protected void renderQuads(Tessellator te, BufferBuilder buffer, float x, float y, float z, float tickDelta) { - - float alpha = this.alpha * getAlphaScale(); - - float angle = MathHelper.lerp(tickDelta, prevRotationAngle, rotationAngle); - - for (int i = 0; i < TEXTURES.length; i++) { - for (int dim = 0; dim < 3; dim++) { - RenderSystem.setShaderTexture(0, TEXTURES[i]); - RenderSystem.setShaderColor(red, green, blue, alpha / ((float)(dim * 3) + 1)); - - Vector3f[] corners = new Vector3f[]{ - new Vector3f(-1, -1, 0), - new Vector3f(-1, 1, 0), - new Vector3f( 1, 1, 0), - new Vector3f( 1, -1, 0) - }; - float scale = getScale(tickDelta); - - float ringSpeed = (i % 2 == 0 ? i : -1) * i; - - Quaternionf ringAngle = RotationAxis.POSITIVE_Z.rotationDegrees(angle * ringSpeed); - Quaternionf ringFlip = RotationAxis.POSITIVE_Y.rotationDegrees(angle * ringSpeed * dim); - Quaternionf ringRoll = RotationAxis.POSITIVE_X.rotationDegrees(angle * ringSpeed * dim); - - for(int k = 0; k < 4; ++k) { - Vector3f corner = corners[k]; - corner.rotate(ringAngle); - corner.rotate(ringFlip); - corner.rotate(ringRoll); - corner.rotate(rotation); - corner.mul(scale); - corner.add(x, y + 0.001F, z); - } - - renderQuad(te, buffer, corners, alpha, tickDelta); - } - } - - RenderSystem.setShaderColor(1, 1, 1, 1); - } - - @Override - public void tick() { - super.tick(); - - prevBaseSize = baseSize; - if (baseSize < targetSize) { - baseSize += 0.1F; - } - if (baseSize > targetSize) { - baseSize -= 0.1F; - } - - rotationAngle = (rotationAngle + 0.3F) % 360; - prevRotationAngle = rotationAngle - 0.3F; - } -} diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java b/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java index cde8af7f..d1e69b94 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java @@ -53,7 +53,7 @@ public class PlayerPoser { float pitchChange = -0.5F; float yawChange = 0.8F; - if (player.getStackInHand(rightHand).isIn(UTags.POLEARMS) && (!ponyRace.isEquine() || model.rightArm.pitch != 0)) { + if (player.getStackInHand(rightHand).isIn(UTags.Items.POLEARMS) && (!ponyRace.isEquine() || model.rightArm.pitch != 0)) { model.rightArm.pitch += pitchChange; model.rightArm.yaw += yawChange; if (player.handSwingTicks > 0 && rightHand == Hand.MAIN_HAND) { @@ -62,7 +62,7 @@ public class PlayerPoser { } } - if (player.getStackInHand(leftHand).isIn(UTags.POLEARMS) && (!ponyRace.isEquine() || model.leftArm.pitch != 0)) { + if (player.getStackInHand(leftHand).isIn(UTags.Items.POLEARMS) && (!ponyRace.isEquine() || model.leftArm.pitch != 0)) { model.leftArm.pitch += pitchChange; model.leftArm.yaw -= yawChange; if (player.handSwingTicks > 0 && leftHand == Hand.MAIN_HAND) { diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/RenderUtil.java b/src/main/java/com/minelittlepony/unicopia/client/render/RenderUtil.java index cb43a128..9b92256d 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/RenderUtil.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/RenderUtil.java @@ -12,7 +12,8 @@ import net.minecraft.client.util.math.MatrixStack; public class RenderUtil { public static final Vector4f TEMP_VECTOR = new Vector4f(); - private static final Vector4f TEMP_UV_VECTOR = new Vector4f(); + public static final Vector4f TEMP_UV_VECTOR = new Vector4f(); + public static final Vector3f TEMP_NORMAL_VECTOR = new Vector3f(); public static final Vertex[] UNIT_FACE = new Vertex[] { new Vertex(0, 0, 0, 1, 1), new Vertex(0, 1, 0, 1, 0), @@ -26,6 +27,9 @@ public class RenderUtil { new Vertex(0, 0, 0, 0, 1) }; + + + public static void renderFace(MatrixStack matrices, Tessellator te, BufferBuilder buffer, float r, float g, float b, float a, int light) { renderFace(matrices, te, buffer, r, g, b, a, light, 1, 1); } diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java b/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java index ac9c3cdb..f839fef1 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java @@ -167,51 +167,45 @@ public class WorldRenderDelegate { return true; } - pony.updateSupportingEntity(); - matrices.push(); Entity owner = pony.asEntity(); boolean negative = pony.getPhysics().isGravityNegative(); - float roll = negative ? 180 : 0; - - roll = pony instanceof Pony ? ((Pony)pony).getInterpolator().interpolate("g_roll", roll, 15) : roll; - matrices.translate(x, y + owner.getHeight() / 2, z); - matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(roll)); - matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(roll)); - if (pony instanceof Pony p) { - roll = p.getCamera().calculateRoll(); - if (negative) { - roll -= 180; - } + float sidewaysRoll = p.getCamera().calculateRoll(); if (p.getAcrobatics().isFloppy()) { matrices.translate(0, -0.5, 0); p.asEntity().setBodyYaw(0); p.asEntity().setYaw(0); - matrices.multiply(RotationAxis.NEGATIVE_X.rotationDegrees(90)); + sidewaysRoll += 90; } - matrices.multiply(RotationAxis.NEGATIVE_Y.rotationDegrees(yaw)); - matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(roll)); + matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(90)); + matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(sidewaysRoll)); + matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-90)); - float diveAngle = p.getInterpolator().interpolate("g_kdive", p.getMotion().isDiving() ? 80 : 0, 15); + float forwardPitch = p.getInterpolator().interpolate("g_kdive", p.getMotion().isDiving() ? 80 : 0, 15); - matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(diveAngle)); - matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(yaw)); + matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(forwardPitch)); if (p.getCompositeRace().includes(Race.SEAPONY) && pony.asEntity().isSubmergedInWater() && MineLPDelegate.getInstance().getPlayerPonyRace(p.asEntity()) != Race.SEAPONY) { ModelPartHooks.startCollecting(); } - } else if (pony instanceof Creature creature && smittenEyesRenderer.isSmitten(creature)) { - ModelPartHooks.startCollecting(); + } else { + float roll = negative ? 180 : 0; + + matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(roll)); + + if (pony instanceof Creature creature && smittenEyesRenderer.isSmitten(creature)) { + ModelPartHooks.startCollecting(); + } } matrices.translate(-x, -y - owner.getHeight() / 2, -z); @@ -224,7 +218,7 @@ public class WorldRenderDelegate { } private void flipAngles(Entity entity) { - if (entity instanceof PlayerEntity) { + if (entity instanceof PlayerEntity player) { entity.prevYaw *= -1; entity.setYaw(entity.getYaw() * -1); diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityModel.java b/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityModel.java index 5934bd8d..1a543310 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityModel.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityModel.java @@ -4,6 +4,7 @@ import java.util.List; import com.minelittlepony.unicopia.entity.mob.AirBalloonEntity; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.model.*; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.entity.model.EntityModel; @@ -14,62 +15,91 @@ import net.minecraft.util.math.MathHelper; public class AirBalloonEntityModel extends EntityModel { private final ModelPart root; + private ModelPart main; private float inflation; private boolean isBurner; private boolean isBalloon; + private boolean isSandbags; private final List ropes; + private final List sandbags; - public AirBalloonEntityModel(ModelPart root) { - this.root = root; - isBurner = root.hasChild("burner"); - isBalloon = root.hasChild("canopy"); + public AirBalloonEntityModel(ModelPart root) { + this.root = root; + isBurner = root.hasChild("burner"); + isSandbags = root.hasChild("sandbag_ne"); + isBalloon = root.hasChild("canopy"); - if (isBurner || isBalloon) { - ModelPart part = root.getChild(isBalloon ? "canopy" : "burner"); - ropes = List.of( - part.getChild("rope_a"), - part.getChild("rope_b"), - part.getChild("rope_c"), - part.getChild("rope_d") + if (isBurner || isBalloon) { + main = root.getChild(isBalloon ? "canopy" : "burner"); + ropes = List.of( + (isBurner ? root : main).getChild("rope_a"), (isBurner ? root : main).getChild("rope_b"), + (isBurner ? root : main).getChild("rope_c"), (isBurner ? root : main).getChild("rope_d") ); - } else { - ropes = List.of(); - } - } + } else { + ropes = List.of(); + } - public static TexturedModelData getBasketModelData() { - ModelData modelData = new ModelData(); - ModelPartData root = modelData.getRoot(); - ModelPartData basket = root.addChild("basket", ModelPartBuilder.create().uv(0, 0).cuboid(-16, -1, -16, 32, 2, 30, Dilation.NONE), ModelTransform.pivot(0, 24, 0)); - basket.addChild("walls", ModelPartBuilder.create().uv(0, 66).cuboid(-17, -12, -16, 2, 11, 30, Dilation.NONE) - .uv(64, 68).cuboid(15, -12, -16, 2, 11, 30, Dilation.NONE) - .uv(80, 38).cuboid(-16, -12, -17, 32, 11, 2, Dilation.NONE) - .uv(0, 32).cuboid(8, -12, 13, 8, 11, 2, Dilation.NONE) - .uv(0, 6).cuboid(-16, -12, 13, 8, 11, 2, Dilation.NONE), ModelTransform.NONE); - basket.addChild("rim", ModelPartBuilder.create().uv(40, 34).cuboid(-18, -13, -17, 4, 2, 32, Dilation.NONE) - .uv(0, 32).cuboid(14, -13, -17, 4, 2, 32, Dilation.NONE) - .uv(80, 32).cuboid(-17, -13, -18, 34, 2, 4, Dilation.NONE) - .uv(0, 19).cuboid(7, -13, 12, 10, 2, 4, Dilation.NONE) - .uv(0, 0).cuboid(-17, -13, 12, 10, 2, 4, Dilation.NONE), ModelTransform.NONE); - return TexturedModelData.of(modelData, 256, 128); - } + sandbags = isSandbags ? List.of( + root.getChild("sandbag_nw"), root.getChild("sandbag_sw"), + root.getChild("sandbag_ne"), root.getChild("sandbag_se") + ) : List.of(); + } - public static TexturedModelData getBurnerModelData() { + public static TexturedModelData getBasketModelData() { ModelData modelData = new ModelData(); ModelPartData root = modelData.getRoot(); + ModelPartData basket = root.addChild("basket", ModelPartBuilder.create().uv(0, 0).cuboid(-16, -1, -16, 32, 2, 30, Dilation.NONE), ModelTransform.pivot(0, 24, 0)); + basket.addChild("walls", ModelPartBuilder.create().uv(0, 66).cuboid(-17, -12, -16, 2, 11, 30, Dilation.NONE) + .uv(64, 68).cuboid(15, -12, -16, 2, 11, 30, Dilation.NONE) + .uv(80, 38).cuboid(-16, -12, -17, 32, 11, 2, Dilation.NONE) + .uv(0, 32).cuboid(8, -12, 13, 8, 11, 2, Dilation.NONE) + .uv(0, 6).cuboid(-16, -12, 13, 8, 11, 2, Dilation.NONE), ModelTransform.NONE); + basket.addChild("rim", ModelPartBuilder.create().uv(40, 34).cuboid(-18, -13, -17, 4, 2, 32, Dilation.NONE) + .uv(0, 32).cuboid(14, -13, -17, 4, 2, 32, Dilation.NONE) + .uv(80, 32).cuboid(-17, -13, -18, 34, 2, 4, Dilation.NONE) + .uv(0, 19).cuboid(7, -13, 12, 10, 2, 4, Dilation.NONE) + .uv(0, 0).cuboid(-17, -13, 12, 10, 2, 4, Dilation.NONE), ModelTransform.NONE); + return TexturedModelData.of(modelData, 256, 128); + } - ModelPartData burner = root.addChild("burner", ModelPartBuilder.create().uv(8, 0).cuboid(-6, -47, -6, 11, 15, 11, Dilation.NONE), ModelTransform.pivot(0, 24, 0)); - burner.addChild("rope_d", ModelPartBuilder.create().cuboid(-2, -68, 0, 2, 68, 2, Dilation.NONE), ModelTransform.of(-5, -46, -6, 0.7854F, 0, -0.7854F)); - burner.addChild("rope_c", ModelPartBuilder.create().cuboid(-2, -68, 0, 2, 68, 2, Dilation.NONE), ModelTransform.of(-4, -44, 3, -0.7854F, 0, -0.7854F)); - burner.addChild("rope_b", ModelPartBuilder.create().cuboid(-2, -68, 0, 2, 68, 2, Dilation.NONE), ModelTransform.of( 5, -46, 1, -0.7854F, 0, 0.7854F)); - burner.addChild("rope_a", ModelPartBuilder.create().cuboid(-2, -68, 0, 2, 68, 2, Dilation.NONE), ModelTransform.of( 5, -45, -6, 0.7854F, 0, 0.7854F)); + public static TexturedModelData getBurnerModelData() { + ModelData modelData = new ModelData(); + ModelPartData root = modelData.getRoot(); + root.addChild("burner", ModelPartBuilder.create().uv(8, 0).cuboid(-5.5F, -47, -5.5F, 11, 15, 11, Dilation.NONE), ModelTransform.pivot(0, 24, 0)); + float angle = 0.37854F; + float half = MathHelper.HALF_PI; + root.addChild("rope_d", ModelPartBuilder.create().cuboid(0, -68, 0, 2, 66, 2, Dilation.NONE), ModelTransform.of(-0, -20, -0, angle, 0, -angle)); + root.addChild("rope_c", ModelPartBuilder.create().cuboid(0, -68, 0, 2, 66, 2, Dilation.NONE), ModelTransform.of(-0, -20, -0, -angle, 0, -angle)); + root.addChild("rope_b", ModelPartBuilder.create().cuboid(0, -68, 0, 2, 66, 2, Dilation.NONE), ModelTransform.of( 0, -20, 0, -angle, 0, angle)); + root.addChild("rope_a", ModelPartBuilder.create().cuboid(0, -68, 0, 2, 66, 2, Dilation.NONE), ModelTransform.of( 0, -20, 0, angle, 0, angle)); + + root.addChild("strut_a", ModelPartBuilder.create() + .cuboid(-27, -40, -30, 2, 40, 2, Dilation.NONE) + .cuboid(-27, 0, -30, 2, 40, 2, Dilation.NONE) + .cuboid( 27, -40, -30, 2, 40, 2, Dilation.NONE) + .cuboid( 27, 0, -30, 2, 40, 2, Dilation.NONE) + + .cuboid(-27, -40, 26, 2, 40, 2, Dilation.NONE) + .cuboid(-27, 0, 26, 2, 40, 2, Dilation.NONE) + .cuboid( 27, -40, 26, 2, 40, 2, Dilation.NONE) + .cuboid( 27, 0, 26, 2, 40, 2, Dilation.NONE), ModelTransform.of(0, -80, 0, half, 0, 0)); + root.addChild("strut_b", ModelPartBuilder.create() + .cuboid(-27, -40, -20, 2, 40, 2, Dilation.NONE) + .cuboid(-27, 0, -20, 2, 40, 2, Dilation.NONE) + .cuboid( 27, -40, -20, 2, 40, 2, Dilation.NONE) + .cuboid( 27, 0, -20, 2, 40, 2, Dilation.NONE) + + .cuboid(-27, -40, 30, 2, 40, 2, Dilation.NONE) + .cuboid(-27, 0, 30, 2, 40, 2, Dilation.NONE) + .cuboid( 27, -40, 30, 2, 40, 2, Dilation.NONE) + .cuboid( 27, 0, 30, 2, 40, 2, Dilation.NONE), ModelTransform.of(0, -80, 0, half, half, 0)); return TexturedModelData.of(modelData, 64, 128); } - public static TexturedModelData getCanopyModelData() { + public static TexturedModelData getCanopyModelData() { ModelData modelData = new ModelData(); ModelPartData root = modelData.getRoot(); ModelPartData balloon = root.addChild("canopy", ModelPartBuilder.create().cuboid(-54, -178, -59, 112, 120, 112, Dilation.NONE), ModelTransform.pivot(0, 24, 0)); @@ -80,40 +110,135 @@ public class AirBalloonEntityModel extends EntityModel { return TexturedModelData.of(modelData, 512, 256); } - @Override - public void setAngles(AirBalloonEntity entity, float tickDelta, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { - inflation = entity.getInflation(tickDelta); - root.roll = MathHelper.sin((float)(entity.getX() - entity.prevX)); - root.pitch = MathHelper.sin((float)(entity.getZ() - entity.prevZ)); + public static TexturedModelData getSandbagsModelData() { + ModelData modelData = new ModelData(); + ModelPartData root = modelData.getRoot(); + float offset = 40; + getHangingBagModelData("sandbag_ne", root, -offset, -offset); + getHangingBagModelData("sandbag_nw", root, -offset, offset); + getHangingBagModelData("sandbag_se", root, offset, -offset); + getHangingBagModelData("sandbag_sw", root, offset, offset); + return TexturedModelData.of(modelData, 32, 32); + } - if (isBurner) { - boolean lifted = inflation > 0.8F; - root.pivotY = 32 * (1 - inflation); - root.pivotX = inflation * MathHelper.sin(limbSwingAmount + entity.age / 5F) / 4F; - ropes.forEach(rope -> rope.visible = lifted); - } + public static void getHangingBagModelData(String name, ModelPartData root, float x, float z) { + ModelPartData bag = root.addChild(name, ModelPartBuilder.create() + .uv(16, 19).cuboid(-0.5F, 0, -0.5F, 1, 9, 1, Dilation.NONE), ModelTransform.pivot(x, -35, z)); + ModelPartData knot = bag.addChild("knot", ModelPartBuilder.create() + .uv(0, 0).cuboid(-3, 1, -3, 6, 7, 6, Dilation.NONE) + .uv(12, 14).cuboid(-2, 0, -2, 4, 1, 4, Dilation.NONE) + .uv(0, 13).cuboid(-2, 8, -2, 4, 1, 4, Dilation.NONE), ModelTransform.pivot(0, 9, 0)); + knot.addChild("cube_r1", ModelPartBuilder.create().uv(8, 14).cuboid(0, 8, -2, 0, 4, 4, Dilation.NONE), ModelTransform.of(0, 1, 0, 0, -0.7854F, 0)); + knot.addChild("cube_r2", ModelPartBuilder.create().uv(8, 14).cuboid(0, 8, -2, 0, 4, 4, Dilation.NONE), ModelTransform.of(0, 1, 0, 0, 0.7854F, 0)); + } - if (isBalloon) { - root.pivotY = 0; - root.pivotX = inflation * MathHelper.cos(limbSwingAmount + entity.age / 5F) / 4F; - if (entity.getBasketType().isOf(BoatEntity.Type.BAMBOO)) { - ropes.forEach(rope -> rope.pivotY = 0); - } else { - ropes.forEach(ModelPart::resetTransform); - } - } - } + @Override + public void setAngles(AirBalloonEntity entity, float limbDistance, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { + float tickDelta = MinecraftClient.getInstance().getTickDelta(); + inflation = entity.getInflation(tickDelta); - @Override - public void render(MatrixStack matrices, VertexConsumer vertexConsumer, int light, int overlay, float r, float g, float b, float a) { - if (isBalloon) { - matrices.push(); - matrices.translate(0, 1 * (1 - inflation), 0); + root.yaw = MathHelper.PI; + + float burnerWiggleProgress = entity.getBurner().getPullProgress(tickDelta); + + if (isBurner || isBalloon || isSandbags) { + root.roll = MathHelper.clamp(entity.getXVelocity(tickDelta), -0.5F, 0.5F); + root.pitch = MathHelper.clamp(entity.getZVelocity(tickDelta), -0.5F, 0.5F); + if (entity.isLeashed()) { + root.roll *= -1; + root.pitch *= -1; + } + } else { + root.pitch = 0; + root.roll = 0; + } + + ropes.forEach(ModelPart::resetTransform); + + if (isBurner) { + boolean lifted = inflation > 0.8F; + root.pivotY = 32 * (1 - inflation) - (9 * inflation); + root.pivotX = inflation * MathHelper.sin(limbSwingAmount + entity.age / 5F) / 4F; + ropes.forEach(rope -> { + rope.visible = lifted; + }); + + root.pivotX += burnerWiggleProgress * MathHelper.sin((entity.age + tickDelta)) * 2.5F; + root.pivotX += burnerWiggleProgress * MathHelper.cos((entity.age + tickDelta)) * 2.5F; + root.pivotY += burnerWiggleProgress * 7; + } + if (isBalloon || isSandbags) { + root.pivotY = burnerWiggleProgress * 3; + root.pivotX = inflation * MathHelper.cos(limbSwingAmount + entity.age / 5F) / 4F; + if (entity.getBasketType().isOf(BoatEntity.Type.BAMBOO)) { + ropes.forEach(rope -> rope.pivotY = 0); + } + } + + if (isSandbags) { + float cosWiggle = MathHelper.cos(limbSwingAmount + entity.age / 5F) / 80F; + float sinWiggle = MathHelper.sin(limbSwingAmount + entity.age / 5F) / 80F; + for (int i = 0; i < sandbags.size(); i++) { + ModelPart bag = sandbags.get(i); + float pullProgress = entity.getSandbag(i).getPullProgress(tickDelta); + bag.resetTransform(); + bag.pitch -= root.pitch * 2.5F * (1 + pullProgress) + cosWiggle; + bag.roll -= root.roll * 2.5F * (1 + pullProgress) + sinWiggle; + if (entity.isLeashed()) { + bag.roll *= -1; + bag.pitch *= -1; + } + float pullAmount = 2 + (2 * pullProgress); + bag.yScale = pullAmount; + bag.getChild("knot").yScale = 1/pullAmount; + } + } + + for (int i = 0; i < ropes.size(); i++) { + ModelPart rope = ropes.get(i); + float rollRatio = root.roll / rope.roll; + float pitchRatio = root.pitch / rope.pitch; + + rope.pivotY -= 5F * rollRatio; + rope.pivotY -= 5F * pitchRatio; + + if (i == 0 || i == 3) { + rope.pivotZ -= 5 * pitchRatio; + } + if (i == 2 || i == 1) { + rope.pivotZ += 5 * pitchRatio; + } + + if (i == 2 || i == 3) { + rope.pivotX -= 5 * rollRatio; + } + if (i == 0 || i == 1) { + rope.pivotX += 5 * rollRatio; + } + + if (isBalloon) { + double speed = Math.abs(entity.getVelocity().getY()) * 3F; + + rope.zScale = MathHelper.clamp((float)speed, 0.25F, 1F); + rope.xScale = 0.001F; + } else { + rope.xScale = 0.3F; + rope.zScale = 0.3F; + } + } + + } + + @Override + public void render(MatrixStack matrices, VertexConsumer vertexConsumer, int light, int overlay, float r, float g, float b, float a) { + if (isBalloon) { + matrices.push(); + matrices.translate(0, 1 * (1 - inflation), 0); matrices.scale(1, MathHelper.lerp(inflation, -0.05F, 1), 1); root.render(matrices, vertexConsumer, light, overlay, r, g, b, a); matrices.pop(); } else { root.render(matrices, vertexConsumer, light, overlay, r, g, b, a); } - } + } } \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityRenderer.java index 5466f5f4..ad31e128 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/entity/AirBalloonEntityRenderer.java @@ -1,9 +1,11 @@ package com.minelittlepony.unicopia.client.render.entity; +import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Predicate; import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.entity.collision.MultiBox; import com.minelittlepony.unicopia.entity.mob.AirBalloonEntity; import net.minecraft.client.MinecraftClient; @@ -17,15 +19,22 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.Items; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; -import net.minecraft.util.math.Box; public class AirBalloonEntityRenderer extends MobEntityRenderer { public AirBalloonEntityRenderer(EntityRendererFactory.Context context) { super(context, new AirBalloonEntityModel(AirBalloonEntityModel.getBasketModelData().createModel()), 0); - addFeature(new BalloonFeature(new AirBalloonEntityModel(AirBalloonEntityModel.getBurnerModelData().createModel()), this, AirBalloonEntity::hasBurner, e -> { + addFeature(new BalloonFeature(new AirBalloonEntityModel(AirBalloonEntityModel.getBurnerModelData().createModel()), this, + AirBalloonEntity::hasBurner, e -> { return getComponentTexture(e.getStackInHand(Hand.MAIN_HAND).isOf(Items.SOUL_LANTERN) ? "soul_burner" : "burner"); - })); - addFeature(new BalloonFeature(new AirBalloonEntityModel(AirBalloonEntityModel.getCanopyModelData().createModel()), this, AirBalloonEntity::hasBalloon, e -> getComponentTexture("canopy/" + e.getDesign().asString()))); + }, (light, entity) -> entity.isAscending() ? 0xFF00FF : light)); + addFeature(new BalloonFeature(new AirBalloonEntityModel(AirBalloonEntityModel.getCanopyModelData().createModel()), this, + AirBalloonEntity::hasBalloon, + e -> getComponentTexture("canopy/" + e.getDesign().asString()), + (light, entity) -> entity.hasBurner() && entity.isAscending() ? light | 0x00005F : light) + ); + addFeature(new BalloonFeature(new AirBalloonEntityModel(AirBalloonEntityModel.getSandbagsModelData().createModel()), + this, e -> e.hasBalloon() && e.getInflation(1) >= 1, e -> getComponentTexture("sandbags"), + (light, entity) -> entity.hasBurner() && entity.isAscending() ? light | 0x00003F : light)); } @Override @@ -33,9 +42,9 @@ public class AirBalloonEntityRenderer extends MobEntityRenderer { + WorldRenderer.drawBox(matrices, vertices.getBuffer(RenderLayer.getLines()), box.offset(entity.getPos().multiply(-1)), 1, 1, 1, 1); + }); } } @@ -57,22 +66,30 @@ public class AirBalloonEntityRenderer extends MobEntityRenderer visibilityTest; private final Function textureFunc; + private final BiFunction lightFunc; public BalloonFeature(AirBalloonEntityModel model, FeatureRendererContext context, Predicate visibilityTest, - Function textureFunc) { + Function textureFunc, + BiFunction lightFunc) { super(context); this.model = model; this.visibilityTest = visibilityTest; this.textureFunc = textureFunc; + this.lightFunc = lightFunc; } @Override public void render(MatrixStack matrices, VertexConsumerProvider vertices, int light, AirBalloonEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float yaw, float pitch) { if (visibilityTest.test(entity)) { - render(getModel(), model, textureFunc.apply(entity), matrices, vertices, light, entity, limbAngle, limbDistance, 0, yaw, pitch, tickDelta, 1, 1, 1); + Identifier texture = textureFunc.apply(entity); + var model = this.model; + if (texture.getPath().indexOf("sandbags") != -1) { + model = new AirBalloonEntityModel(AirBalloonEntityModel.getSandbagsModelData().createModel()); + } + render(getModel(), model, texture, matrices, vertices, lightFunc.apply(light, entity), entity, limbAngle, limbDistance, 0, yaw, pitch, tickDelta, 1, 1, 1); } } } diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/entity/CloudBedBlockEntityRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/entity/CloudBedBlockEntityRenderer.java index 9d10611a..cd1b2428 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/entity/CloudBedBlockEntityRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/entity/CloudBedBlockEntityRenderer.java @@ -100,7 +100,7 @@ public class CloudBedBlockEntityRenderer implements BlockEntityRenderer { + private static final Direction[] GLASS_SIDES = Arrays.stream(PosHelper.ALL).filter(i -> i != Direction.UP).toArray(Direction[]::new); + private final ItemRenderer itemRenderer; + private final EntityRenderDispatcher dispatcher; + + public ItemJarBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) { + itemRenderer = ctx.getItemRenderer(); + dispatcher = ctx.getEntityRenderDispatcher(); + } + + @Override + public void render(ItemJarBlock.TileData data, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light, int overlay) { + + ItemsJarContents items = data.getItems(); + if (items != null) { + renderItemStacks(data, items, tickDelta, matrices, vertices, light, overlay); + } + + EntityJarContents entity = data.getEntity(); + if (entity != null) { + renderEntity(data, entity, tickDelta, matrices, vertices, light, overlay); + } + + FluidJarContents fluid = data.getFluid(); + if (fluid != null) { + renderFluid(data, fluid, tickDelta, matrices, vertices, light, overlay); + } + + FakeFluidJarContents milk = data.getFakeFluid(); + if (milk != null) { + renderFluid(data, Fluids.WATER.getDefaultState(), milk.color(), FluidConstants.BUCKET, tickDelta, matrices, vertices, light, overlay); + } + } + + private void renderItemStacks(ItemJarBlock.TileData data, ItemsJarContents items, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light, int overlay) { + float itemScale = 0.35F; + + matrices.push(); + matrices.translate(0.5, 0, 0.5); + matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90)); + matrices.scale(itemScale, itemScale, itemScale); + + Random rng = Random.create(data.getPos().asLong()); + + float y = 0; + for (ItemStack stack : items.stacks()) { + matrices.push(); + + matrices.translate((rng.nextFloat() - 0.5F) * 0.5F, (rng.nextFloat() - 0.5F) * 0.8F, -0.05 + y); + matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees((rng.nextFloat() * 360) - 180)); + matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees((rng.nextFloat() * 360) - 180)); + y -= 0.1F; + itemRenderer.renderItem(stack, ModelTransformationMode.FIXED, light, overlay, matrices, vertices, data.getWorld(), 0); + matrices.pop(); + } + matrices.pop(); + } + + private void renderEntity(ItemJarBlock.TileData data, EntityJarContents entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light, int overlay) { + Entity e = entity.entity().get(); + if (e != null) { + + PlayerEntity player = MinecraftClient.getInstance().player; + int age = player == null ? 0 : player.age; + + float fullTick = age + tickDelta; + + float size = Math.max(e.getWidth(), e.getHeight()); + float desiredSize = 0.25F; + float scale = desiredSize / size; + float eyePos = (e.getEyeHeight(e.getPose())) * scale; + + float yaw = 0; + if (player != null) { + Vec3d center = data.getPos().toCenterPos(); + Vec3d observerPos = MinecraftClient.getInstance().gameRenderer.getCamera().getPos(); + e.setPosition(center); + e.lookAt(EntityAnchor.FEET, observerPos); + } + + matrices.push(); + matrices.translate(0.5, 0.48 + MathHelper.sin(fullTick / 19F) * 0.02F - eyePos, 0.5); + matrices.scale(scale, scale, scale); + matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(10 * MathHelper.sin(fullTick / 19F))); + dispatcher.render(e, 0, 0, 0, yaw * MathHelper.RADIANS_PER_DEGREE, tickDelta, matrices, vertices, light); + matrices.pop(); + } + } + + private void renderFluid(ItemJarBlock.TileData data, FluidJarContents fluid, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light, int overlay) { + FluidState state = FluidHelper.getFullFluidState(fluid.fluid()); + int color = getFluidColor(data.getWorld(), data.getPos(), state); + renderFluid(data, state, color, fluid.amount(), tickDelta, matrices, vertices, light, overlay); + } + + private void renderFluid(ItemJarBlock.TileData data, FluidState state, int color, long amount, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light, int overlay) { + Sprite[] sprite = getFluidSprite(data.getWorld(), data.getPos(), state); + matrices.push(); + Sprite topSprite = sprite[0]; + float height = 0.6F * (amount / (float)FluidConstants.BUCKET); + boolean opaque = Color.a(color) >= 1; + CubeModel.render( + matrices, + vertices.getBuffer(opaque ? RenderLayer.getEntitySolid(topSprite.getAtlasId()) : RenderLayer.getEntityTranslucent(topSprite.getAtlasId())), + topSprite.getMinU(), topSprite.getMinV(), + topSprite.getMaxU(), topSprite.getMaxV(), + 0.28F, 0.01F, 0.28F, + 0.73F, 0.01F + height, 0.73F, + color, + light, overlay, Direction.UP + ); + Sprite sideSprite = sprite[sprite.length - 1]; + CubeModel.render( + matrices, + vertices.getBuffer(opaque ? RenderLayer.getEntitySolid(sideSprite.getAtlasId()) : RenderLayer.getEntityTranslucent(sideSprite.getAtlasId())), + sideSprite.getMinU(), sideSprite.getMinV(), + sideSprite.getMaxU(), sideSprite.getMaxV(), + 0.28F, 0.01F, 0.28F, + 0.73F, 0.01F + height, 0.73F, + color, + light, overlay, GLASS_SIDES + ); + matrices.pop(); + } + + private int getFluidColor(World world, BlockPos pos, FluidState state) { + return getFluidHandler(state.getFluid()).getFluidColor(world, pos, state); + } + + private Sprite[] getFluidSprite(@Nullable World world, BlockPos pos, FluidState state) { + return getFluidHandler(state.getFluid()).getFluidSprites(world, pos, state); + } + + private FluidRenderHandler getFluidHandler(Fluid fluid) { + FluidRenderHandler handler = FluidRenderHandlerRegistry.INSTANCE.get(fluid); + if (handler == null) { + return FluidRenderHandlerRegistry.INSTANCE.get(Fluids.WATER); + } + return handler; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/model/CubeModel.java b/src/main/java/com/minelittlepony/unicopia/client/render/model/CubeModel.java new file mode 100644 index 00000000..6aaadb33 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/client/render/model/CubeModel.java @@ -0,0 +1,77 @@ +package com.minelittlepony.unicopia.client.render.model; + +import org.joml.Matrix3f; +import org.joml.Matrix4f; +import org.joml.Vector2f; +import org.joml.Vector3f; +import org.joml.Vector4f; + +import com.minelittlepony.common.util.Color; +import com.minelittlepony.unicopia.client.render.RenderUtil; +import com.minelittlepony.unicopia.client.render.RenderUtil.Vertex; + +import net.minecraft.client.render.VertexConsumer; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.Direction; + +public class CubeModel { + private static final Vector2f TEMP_UV_VECTOR = new Vector2f(); + private static final Vertex[][] CUBE_VERTICES = { + new Vertex[] { + new Vertex(0, 0, 0, 0, 0), + new Vertex(1, 0, 0, 1, 0), + new Vertex(1, 0, 1, 1, 1), + new Vertex(0, 0, 1, 0, 1) + }, + new Vertex[] { + new Vertex(0, 1, 0, 0, 0), + new Vertex(0, 1, 1, 0, 1), + new Vertex(1, 1, 1, 1, 1), + new Vertex(1, 1, 0, 1, 0) + }, + new Vertex[] { + new Vertex(0, 0, 0, 0, 0), + new Vertex(0, 1, 0, 0, 1), + new Vertex(1, 1, 0, 1, 1), + new Vertex(1, 0, 0, 1, 0) + }, + new Vertex[] { + new Vertex(0, 0, 1, 0, 0), + new Vertex(1, 0, 1, 1, 0), + new Vertex(1, 1, 1, 1, 1), + new Vertex(0, 1, 1, 0, 1) + }, + new Vertex[] { + new Vertex(0, 0, 0, 0, 0), + new Vertex(0, 0, 1, 1, 0), + new Vertex(0, 1, 1, 1, 1), + new Vertex(0, 1, 0, 0, 1) + }, + new Vertex[] { + new Vertex(1, 0, 0, 0, 0), + new Vertex(1, 1, 0, 1, 0), + new Vertex(1, 1, 1, 1, 1), + new Vertex(1, 0, 1, 0, 1) + } + }; + + public static void render(MatrixStack matrices, VertexConsumer buffer, + float u0, float v0, float u1, float v1, + float x0, float y0, float z0, float x1, float y1, float z1, + int color, int light, int overlay, + Direction... directions) { + float r = Color.r(color), g = Color.g(color), b = Color.b(color); + float du = u1 - u0, dv = v1 - v0; + float dx = x1 - x0, dy = y1 - y0, dz = z1 - z0; + Matrix4f position = matrices.peek().getPositionMatrix(); + Matrix3f normal = matrices.peek().getNormalMatrix(); + for (Direction direction : directions) { + for (Vertex vertex : CUBE_VERTICES[direction.ordinal()]) { + Vector4f pos = position.transform(RenderUtil.TEMP_VECTOR.set(vertex.position(), 1).mul(dx, dy, dz, 1).add(x0, y0, z0, 0)); + Vector2f tex = TEMP_UV_VECTOR.set(vertex.texture().x, vertex.texture().y).mul(du, dv).add(u0, v0); + Vector3f norm = normal.transform(RenderUtil.TEMP_NORMAL_VECTOR.set(direction.getOffsetX(), direction.getOffsetY(), direction.getOffsetZ())); + buffer.vertex(pos.x, pos.y, pos.z, r, g, b, 1, tex.x, tex.y, overlay, light, norm.x, norm.y, norm.z); + } + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/command/GravityCommand.java b/src/main/java/com/minelittlepony/unicopia/command/GravityCommand.java index c99aa75b..c5249dcb 100644 --- a/src/main/java/com/minelittlepony/unicopia/command/GravityCommand.java +++ b/src/main/java/com/minelittlepony/unicopia/command/GravityCommand.java @@ -1,15 +1,15 @@ package com.minelittlepony.unicopia.command; -import java.util.Arrays; -import java.util.stream.Stream; - -import com.google.common.collect.Streams; -import com.minelittlepony.unicopia.entity.player.Pony; +import java.util.Collection; +import java.util.List; +import java.util.Objects; +import com.minelittlepony.unicopia.entity.Living; import com.mojang.brigadier.arguments.FloatArgumentType; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.command.argument.EntityArgumentType; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; @@ -22,45 +22,48 @@ class GravityCommand { return CommandManager.literal("gravity").requires(s -> s.hasPermissionLevel(2)) .then(CommandManager.literal("get") .executes(context -> get(context.getSource(), context.getSource().getPlayer(), true)) - .then(CommandManager.argument("target", EntityArgumentType.player()) - .executes(context -> get(context.getSource(), EntityArgumentType.getPlayer(context, "target"), false)) + .then(CommandManager.argument("target", EntityArgumentType.entity()) + .executes(context -> get(context.getSource(), EntityArgumentType.getEntity(context, "target"), false)) )) .then(CommandManager.literal("set") .then(CommandManager.argument("gravity", FloatArgumentType.floatArg(-99, 99)) - .executes(context -> set(context.getSource(), context.getSource().getPlayer(), FloatArgumentType.getFloat(context, "gravity"), true)) - .then(CommandManager.argument("target", EntityArgumentType.player()) - .executes(context -> set(context.getSource(), EntityArgumentType.getPlayer(context, "target"), FloatArgumentType.getFloat(context, "gravity"), false)) + .executes(context -> set(context.getSource(), List.of(context.getSource().getPlayer()), FloatArgumentType.getFloat(context, "gravity"), true)) + .then(CommandManager.argument("target", EntityArgumentType.entities()) + .executes(context -> set(context.getSource(), EntityArgumentType.getEntities(context, "target"), FloatArgumentType.getFloat(context, "gravity"), false)) ))); } - static int get(ServerCommandSource source, PlayerEntity player, boolean isSelf) throws CommandSyntaxException { - sendFeedback(source, player, "get", false, Pony.of(player).getPhysics().getGravityModifier()); - return 0; - } + static int get(ServerCommandSource source, Entity target, boolean isSelf) throws CommandSyntaxException { + Living l = Living.living(target); - static int set(ServerCommandSource source, PlayerEntity player, float gravity, boolean isSelf) { - - Pony iplayer = Pony.of(player); - - iplayer.getPhysics().setBaseGravityModifier(gravity); - iplayer.setDirty(); - - sendFeedback(source, player, "set", true, gravity); - return 0; - } - - - static void sendFeedback(ServerCommandSource source, PlayerEntity player, String key, boolean notifyTarget, Object...arguments) { - String translationKey = "commands.gravity." + key; - - if (source.getEntity() == player) { - source.sendFeedback(() -> Text.translatable(translationKey + ".self", arguments), true); + float gravity = l == null ? 1 : l.getPhysics().getGravityModifier(); + if (source.getEntity() == target) { + source.sendFeedback(() -> Text.translatable("commands.gravity.get.self", gravity), true); } else { - if (notifyTarget && source.getWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) { - player.sendMessage(Text.translatable(translationKey, arguments)); - } - - source.sendFeedback(() -> Text.translatable(translationKey + ".other", Streams.concat(Stream.of(player.getDisplayName()), Arrays.stream(arguments)).toArray()), true); + source.sendFeedback(() -> Text.translatable("commands.gravity.get.other", target.getDisplayName(), gravity), true); } + return 0; + } + + static int set(ServerCommandSource source, Collection targets, float gravity, boolean isSelf) { + List affected = targets.stream().map(Living::living).filter(Objects::nonNull).map(l -> { + l.getPhysics().setBaseGravityModifier(gravity); + l.setDirty(); + if (l.asEntity() instanceof PlayerEntity player) { + if (source.getEntity() == player) { + player.sendMessage(Text.translatable("commands.gravity.set.self", gravity)); + } else if (source.getWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) { + player.sendMessage(Text.translatable("commands.gravity.set.other", l.asEntity().getDisplayName(), gravity)); + } + } + return (Entity)l.asEntity(); + }).toList(); + + if (affected.size() == 1) { + source.sendFeedback(() -> Text.translatable("commands.gravity.set.other", affected.get(0).getDisplayName()), true); + } else { + source.sendFeedback(() -> Text.translatable("commands.gravity.set.multiple", affected.size()), true); + } + return 0; } } diff --git a/src/main/java/com/minelittlepony/unicopia/compat/emi/Main.java b/src/main/java/com/minelittlepony/unicopia/compat/emi/Main.java index 9b45b407..461e8587 100644 --- a/src/main/java/com/minelittlepony/unicopia/compat/emi/Main.java +++ b/src/main/java/com/minelittlepony/unicopia/compat/emi/Main.java @@ -15,10 +15,10 @@ import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait; import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.block.state.Schematic; import com.minelittlepony.unicopia.item.EnchantableItem; -import com.minelittlepony.unicopia.item.TransformCropsRecipe; import com.minelittlepony.unicopia.item.UItems; -import com.minelittlepony.unicopia.item.URecipes; import com.minelittlepony.unicopia.item.group.MultiItem; +import com.minelittlepony.unicopia.recipe.TransformCropsRecipe; +import com.minelittlepony.unicopia.recipe.URecipes; import dev.emi.emi.api.EmiPlugin; import dev.emi.emi.api.EmiRegistry; diff --git a/src/main/java/com/minelittlepony/unicopia/container/ShapingBenchScreenHandler.java b/src/main/java/com/minelittlepony/unicopia/container/ShapingBenchScreenHandler.java index 6eb321c9..c490e971 100644 --- a/src/main/java/com/minelittlepony/unicopia/container/ShapingBenchScreenHandler.java +++ b/src/main/java/com/minelittlepony/unicopia/container/ShapingBenchScreenHandler.java @@ -1,7 +1,7 @@ package com.minelittlepony.unicopia.container; import com.minelittlepony.unicopia.block.UBlocks; -import com.minelittlepony.unicopia.item.URecipes; +import com.minelittlepony.unicopia.recipe.URecipes; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; diff --git a/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java b/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java index ab6ec178..649f5d9f 100644 --- a/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java +++ b/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java @@ -10,7 +10,7 @@ import com.minelittlepony.unicopia.compat.trinkets.TrinketsDelegate; import com.minelittlepony.unicopia.container.inventory.*; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.UItems; -import com.minelittlepony.unicopia.item.URecipes; +import com.minelittlepony.unicopia.recipe.URecipes; import com.mojang.datafixers.util.Pair; import net.minecraft.enchantment.EnchantmentHelper; diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/DataCollector.java b/src/main/java/com/minelittlepony/unicopia/datagen/DataCollector.java index 46b27642..2dabd5cd 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/DataCollector.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/DataCollector.java @@ -22,6 +22,10 @@ public class DataCollector { this.resolver = resolver; } + public boolean isDefined(Identifier id) { + return values.containsKey(id); + } + public BiConsumer> prime() { values.clear(); return (Identifier id, Supplier value) -> diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/Datagen.java b/src/main/java/com/minelittlepony/unicopia/datagen/Datagen.java index 24f1f53b..517a21e4 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/Datagen.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/Datagen.java @@ -3,49 +3,75 @@ package com.minelittlepony.unicopia.datagen; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import com.minelittlepony.unicopia.block.EdibleBlock; +import com.minelittlepony.unicopia.datagen.providers.DietsProvider; import com.minelittlepony.unicopia.datagen.providers.SeasonsGrowthRatesProvider; -import com.minelittlepony.unicopia.datagen.providers.UBlockTagProvider; -import com.minelittlepony.unicopia.datagen.providers.UItemTagProvider; +import com.minelittlepony.unicopia.datagen.providers.UAdvancementsProvider; import com.minelittlepony.unicopia.datagen.providers.UModelProvider; -import com.minelittlepony.unicopia.datagen.providers.URecipeProvider; import com.minelittlepony.unicopia.datagen.providers.loot.UBlockAdditionsLootTableProvider; import com.minelittlepony.unicopia.datagen.providers.loot.UBlockLootTableProvider; import com.minelittlepony.unicopia.datagen.providers.loot.UChestAdditionsLootTableProvider; +import com.minelittlepony.unicopia.datagen.providers.loot.UChestLootTableProvider; +import com.minelittlepony.unicopia.datagen.providers.loot.UEntityLootTableProvider; +import com.minelittlepony.unicopia.datagen.providers.recipe.URecipeProvider; +import com.minelittlepony.unicopia.datagen.providers.tag.UBlockTagProvider; +import com.minelittlepony.unicopia.datagen.providers.tag.UDamageTypeProvider; +import com.minelittlepony.unicopia.datagen.providers.tag.UItemTagProvider; +import com.minelittlepony.unicopia.entity.damage.UDamageTypes; import com.minelittlepony.unicopia.server.world.UWorldGen; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryBuilder; -import net.minecraft.registry.RegistryEntryLookup; import net.minecraft.registry.RegistryKeys; +import net.minecraft.util.Identifier; import net.minecraft.world.biome.OverworldBiomeCreator; -import net.minecraft.world.gen.carver.ConfiguredCarver; -import net.minecraft.world.gen.feature.PlacedFeature; public class Datagen implements DataGeneratorEntrypoint { public static final Logger LOGGER = LogManager.getLogger(); + public static Block getOrCreateBaleBlock(Identifier id) { + return Registries.BLOCK.getOrEmpty(id).orElseGet(() -> { + return Registry.register(Registries.BLOCK, id, new EdibleBlock(id, id, false)); + }); + } + + public static Item getOrCreateItem(Identifier id) { + return Registries.ITEM.getOrEmpty(id).orElseGet(() -> { + return Registry.register(Registries.ITEM, id, new Item(new Item.Settings())); + }); + } + @Override public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { - final FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); - - UBlockTagProvider blockTags = pack.addProvider(UBlockTagProvider::new); - pack.addProvider((output, registries) -> new UItemTagProvider(output, registries, blockTags)); + final var pack = fabricDataGenerator.createPack(); + final var blockTags = pack.addProvider(UBlockTagProvider::new); + final var itemTags = pack.addProvider((output, registries) -> new UItemTagProvider(output, registries, blockTags)); + pack.addProvider((output, registries) -> new DietsProvider(output, itemTags)); + pack.addProvider(UDamageTypeProvider::new); pack.addProvider(UModelProvider::new); pack.addProvider(URecipeProvider::new); pack.addProvider(UBlockLootTableProvider::new); + pack.addProvider(UEntityLootTableProvider::new); + pack.addProvider(UChestLootTableProvider::new); pack.addProvider(UBlockAdditionsLootTableProvider::new); pack.addProvider(UChestAdditionsLootTableProvider::new); pack.addProvider(SeasonsGrowthRatesProvider::new); + pack.addProvider(UAdvancementsProvider::new); } @Override public void buildRegistry(RegistryBuilder builder) { builder.addRegistry(RegistryKeys.BIOME, registerable -> { - RegistryEntryLookup placedFeatureLookup = registerable.getRegistryLookup(RegistryKeys.PLACED_FEATURE); - RegistryEntryLookup> carverLookup = registerable.getRegistryLookup(RegistryKeys.CONFIGURED_CARVER); + final var placedFeatureLookup = registerable.getRegistryLookup(RegistryKeys.PLACED_FEATURE); + final var carverLookup = registerable.getRegistryLookup(RegistryKeys.CONFIGURED_CARVER); registerable.register(UWorldGen.SWEET_APPLE_ORCHARD, OverworldBiomeCreator.createNormalForest(placedFeatureLookup, carverLookup, false, false, false)); }); + builder.addRegistry(RegistryKeys.DAMAGE_TYPE, UDamageTypes.REGISTRY); } } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/UBlockFamilies.java b/src/main/java/com/minelittlepony/unicopia/datagen/UBlockFamilies.java index 624d3a9c..7d80df0f 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/UBlockFamilies.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/UBlockFamilies.java @@ -19,4 +19,24 @@ public interface UBlockFamilies { .slab(UBlocks.WAXED_ZAP_SLAB).stairs(UBlocks.WAXED_ZAP_STAIRS).fence(UBlocks.WAXED_ZAP_FENCE).fenceGate(UBlocks.WAXED_ZAP_FENCE_GATE) .group("wooden").unlockCriterionName("has_planks") .build(); + BlockFamily CHISELED_CHITIN = new BlockFamily.Builder(UBlocks.CHISELLED_CHITIN) + .slab(UBlocks.CHISELLED_CHITIN_SLAB).stairs(UBlocks.CHISELLED_CHITIN_STAIRS) + .group("chitin").unlockCriterionName("has_chiselled_chitin") + .build(); + BlockFamily CLOUD = new BlockFamily.Builder(UBlocks.CLOUD) + .slab(UBlocks.CLOUD_SLAB).stairs(UBlocks.CLOUD_STAIRS) + .group("cloud").unlockCriterionName("has_cloud_lump") + .build(); + BlockFamily CLOUD_PLANKS = new BlockFamily.Builder(UBlocks.CLOUD_PLANKS) + .slab(UBlocks.CLOUD_PLANK_SLAB).stairs(UBlocks.CLOUD_PLANK_STAIRS) + .group("cloud").unlockCriterionName("has_cloud") + .build(); + BlockFamily CLOUD_BRICKS = new BlockFamily.Builder(UBlocks.CLOUD_BRICKS) + .slab(UBlocks.CLOUD_BRICK_SLAB).stairs(UBlocks.CLOUD_BRICK_STAIRS) + .group("cloud").unlockCriterionName("has_cloud_bricks") + .build(); + BlockFamily DENSE_CLOUD = new BlockFamily.Builder(UBlocks.DENSE_CLOUD) + .slab(UBlocks.DENSE_CLOUD_SLAB).stairs(UBlocks.DENSE_CLOUD_STAIRS) + .group("cloud").unlockCriterionName("has_dense_cloud") + .build(); } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/AdvancementDisplayBuilder.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/AdvancementDisplayBuilder.java new file mode 100644 index 00000000..be9fdd5f --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/AdvancementDisplayBuilder.java @@ -0,0 +1,145 @@ +package com.minelittlepony.unicopia.datagen.providers; + +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.Unicopia; + +import net.minecraft.advancement.Advancement; +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.advancement.AdvancementDisplay; +import net.minecraft.advancement.AdvancementEntry; +import net.minecraft.advancement.AdvancementFrame; +import net.minecraft.advancement.AdvancementRequirements; +import net.minecraft.advancement.AdvancementRewards; +import net.minecraft.item.ItemConvertible; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; +import net.minecraft.util.Util; + +public class AdvancementDisplayBuilder { + private static final Identifier BACKGROUND = new Identifier("textures/gui/advancements/backgrounds/stone.png"); + + public static AdvancementDisplayBuilder create(ItemConvertible icon) { + return new AdvancementDisplayBuilder(icon, Advancement.Builder.create(), false, false, false); + } + + @Nullable + private Identifier background = BACKGROUND; + + private boolean toast; + private boolean hidden; + private boolean announce; + private final ItemConvertible icon; + private AdvancementFrame frame = AdvancementFrame.TASK; + @Nullable + private String group; + + private final Advancement.Builder advancementBuilder; + + AdvancementDisplayBuilder(ItemConvertible icon, Advancement.Builder advancementBuilder, boolean toast, boolean announce, boolean hidden) { + this.icon = icon; + this.advancementBuilder = advancementBuilder; + this.toast = toast; + this.announce = announce; + this.hidden = hidden; + } + + public AdvancementDisplayBuilder frame(AdvancementFrame frame) { + this.frame = frame; + return this; + } + + public AdvancementDisplayBuilder background(Identifier background) { + this.background = background; + return this; + } + + public AdvancementDisplayBuilder showToast() { + this.toast = true; + return this; + } + + public AdvancementDisplayBuilder hidden() { + this.hidden = true; + return this; + } + + public AdvancementDisplayBuilder visible() { + this.hidden = false; + return this; + } + + public AdvancementDisplayBuilder announce() { + this.announce = true; + return this; + } + + public AdvancementDisplayBuilder doNotAnnounce() { + this.announce = false; + return this; + } + + public AdvancementDisplayBuilder group(String group) { + this.group = group; + return this; + } + + public AdvancementDisplayBuilder rewards(AdvancementRewards.Builder builder) { + advancementBuilder.rewards(builder.build()); + return this; + } + + public AdvancementDisplayBuilder criterion(String name, AdvancementCriterion criterion) { + advancementBuilder.criterion(name, criterion); + return this; + } + + public AdvancementDisplayBuilder criteriaMerger(AdvancementRequirements.CriterionMerger merger) { + advancementBuilder.criteriaMerger(merger); + return this; + } + + public AdvancementDisplayBuilder parent(Identifier parent) { + advancementBuilder.parent(Advancement.Builder.createUntelemetered().build(parent)); + return this; + } + + public AdvancementDisplayBuilder apply(Consumer consumer) { + consumer.accept(this); + return this; + } + + public Parent build(Consumer exporter, String name) { + Identifier id = Unicopia.id(group == null ? name : group + "/" + name); + String key = Util.createTranslationKey("advancements", Unicopia.id(name)); + AdvancementEntry advancement = advancementBuilder.display( + icon.asItem().getDefaultStack(), + Text.translatable(key + ".title"), + Text.translatable(key + ".description"), background, frame, toast, announce, hidden) + .build(id); + exporter.accept(advancement); + return new Parent(advancement, group); + } + + public record Parent(AdvancementEntry parent, @Nullable String group) { + public AdvancementDisplayBuilder child(ItemConvertible icon) { + AdvancementDisplay display = parent.value().display().orElseThrow(); + return new AdvancementDisplayBuilder(icon, Advancement.Builder.create().parent(parent), + display.shouldShowToast(), + display.shouldAnnounceToChat(), + display.isHidden() + ).frame(display.getFrame()).background(display.getBackground().orElse(null)).group(group); + } + + public void children(Consumer children) { + children.accept(this); + } + + public void children(Consumer exporter, BiConsumer, Parent> children) { + children.accept(exporter, this); + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/BlockModels.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/BlockModels.java index 68344833..26a78354 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/BlockModels.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/BlockModels.java @@ -34,6 +34,7 @@ public interface BlockModels { Model DOOR_RIGHT = block("door_right", TextureKey.BOTTOM, TextureKey.TOP); Model TEMPLATE_PILLAR = block("template_pillar", TextureKey.SIDE); Model TEMPLATE_PILLAR_END = block("template_pillar_end", "_end", TextureKey.BOTTOM, TextureKey.TOP, TextureKey.END); + Identifier TEMPLATE_JAR = Unicopia.id("block/template_jar"); Factory CROP = Factory.of(TextureMap::crop, Models.CROP); Factory CUBE_ALL = Factory.of(TextureMap::all, Models.CUBE_ALL); diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/DietProfileGenerator.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/DietProfileGenerator.java new file mode 100644 index 00000000..4034021f --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/DietProfileGenerator.java @@ -0,0 +1,275 @@ +package com.minelittlepony.unicopia.datagen.providers; + +import java.util.List; +import java.util.Optional; +import java.util.function.BiConsumer; +import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.diet.DietProfile; +import com.minelittlepony.unicopia.diet.DietProfile.Multiplier; +import com.minelittlepony.unicopia.diet.FoodGroupEffects; +import com.minelittlepony.unicopia.diet.affliction.ClearLoveSicknessAffliction; +import com.minelittlepony.unicopia.diet.affliction.CompoundAffliction; +import com.minelittlepony.unicopia.diet.affliction.HealingAffliction; +import com.minelittlepony.unicopia.diet.affliction.LoseHungerAffliction; +import com.minelittlepony.unicopia.diet.affliction.Range; +import com.minelittlepony.unicopia.diet.affliction.StatusEffectAffliction; +import com.minelittlepony.unicopia.entity.effect.UEffects; +import com.minelittlepony.unicopia.item.UFoodComponents; + +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.item.FoodComponents; + +public class DietProfileGenerator { + + public void generate(BiConsumer exporter) { + // Pinecones are for everypony + var pineconeMultiplier = new Multiplier.Builder().tag(Unicopia.id("pinecone")).hunger(0.9F).saturation(0.9F).build(); + var bakedGoodPreference = new Multiplier.Builder().tag(Unicopia.id("baked_goods")).build(); + var bakedGoodExtremePreference = new Multiplier.Builder().tag(Unicopia.id("baked_goods")).hunger(1.2F).saturation(2).build(); + var bakedGoodNonPreference = new Multiplier.Builder().tag(Unicopia.id("baked_goods")).hunger(0.4F).saturation(0.2F).build(); + var properMeatStandards = new Multiplier.Builder().tag(Unicopia.id("love")) + .tag(Unicopia.id("meat/raw")).tag(Unicopia.id("insect/raw")).tag(Unicopia.id("fish/raw")) + .tag(Unicopia.id("meat/rotten")).tag(Unicopia.id("insect/rotten")).tag(Unicopia.id("fish/rotten")) + .hunger(0).saturation(0).build(); + var avianMeatStandards = new Multiplier.Builder().tag(Unicopia.id("love")) + .tag(Unicopia.id("meat/raw")).tag(Unicopia.id("insect/raw")) + .tag(Unicopia.id("meat/rotten")).tag(Unicopia.id("insect/rotten")) + .hunger(0).saturation(0).build(); + var loveSicknessEffects = CompoundAffliction.of( + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 95), + new StatusEffectAffliction(StatusEffects.WEAKNESS, Range.of(200), Range.of(1), 0), + new LoseHungerAffliction(0.5F)); + var seaFoodExclusions = new Multiplier.Builder() + .tag(Unicopia.id("sea_vegetable/raw")).tag(Unicopia.id("sea_vegetable/cooked")) + .tag(Unicopia.id("shells")).tag(Unicopia.id("special_shells")) + .hunger(0).saturation(0).build(); + + exporter.accept(Race.HUMAN, new DietProfile(1, 0, List.of(), List.of( + new FoodGroupEffects.Builder() + .tag(Unicopia.id("fish/cooked")).tag(Unicopia.id("fish/raw")).tag(Unicopia.id("fish/rotten")) + .tag(Unicopia.id("meat/cooked")).tag(Unicopia.id("meat/raw")).tag(Unicopia.id("meat/rotten")) + .tag(Unicopia.id("sea_vegetable/cooked")).tag(Unicopia.id("sea_vegetable/raw")) + .tag(Unicopia.id("pinecone")) + .build() + ), Optional.empty())); + // Alicorns are a mashup of unicorn, pegasus, and earth pony eating habits + exporter.accept(Race.ALICORN, new DietProfile(0.9F, 1, List.of( + // Pastries are their passion + bakedGoodExtremePreference, pineconeMultiplier, avianMeatStandards, seaFoodExclusions, + // They have a more of a sweet tooth than earth ponies + new Multiplier.Builder().tag(Unicopia.id("desserts")).hunger(2.5F).saturation(1.7F).build(), + new Multiplier.Builder().tag(Unicopia.id("candy")).tag(Unicopia.id("rocks")).hunger(1.5F).saturation(1.3F).build(), + + // Cannot eat love, or raw/rotten meats and fish + // Can eat raw and rotten fish but still prefers if they are cooked + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(1.5F).saturation(1.5F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(0.25F).saturation(0.16F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/cooked")).hunger(0.1F).saturation(0.7F).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/raw")).hunger(0.5F).saturation(0.8F).build(), + new Multiplier.Builder().tag(Unicopia.id("fish/rotten")).hunger(0.25F).saturation(0.5F).build() + ), List.of( + // Can safely eat fresh and cooked fish with no ill effects + new FoodGroupEffects.Builder().tag(Unicopia.id("fish/cooked")).tag(Unicopia.id("fish/raw")).build(), + // Is less affected when eating rotten fish + new FoodGroupEffects.Builder().tag(Unicopia.id("fish/rotten")).ailment(new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(50), Range.of(2), 95)).build() + ), Optional.empty())); + // Unicorns have a general even preference of foods + exporter.accept(Race.UNICORN, new DietProfile(1.1F, 1, List.of( + bakedGoodPreference, pineconeMultiplier, seaFoodExclusions, + new Multiplier.Builder().tag(Unicopia.id("love")).hunger(0).saturation(0).build(), + + // Improved benefits from cooking their food + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(0.3F).saturation(0.2F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(0.4F).saturation(0.4F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/cooked")).hunger(0.1F).saturation(0.1F).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/raw")).hunger(0.25F).saturation(0.1F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/raw")).hunger(0.3F).saturation(0.1F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/raw")).hunger(0.15F).saturation(0.1F).build(), + + // Can still eat raw and rotten but at a reduced yield + new Multiplier.Builder().tag(Unicopia.id("fish/rotten")).hunger(0.1F).saturation(0.1F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/rotten")).hunger(0.1F).saturation(0.1F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/rotten")).hunger(0).saturation(0.1F).build() + ), List.of(), Optional.empty())); + // Bats prefer cooked foods over raw, and meat/insects over fish + exporter.accept(Race.BAT, new DietProfile(0.7F, 0.9F, List.of( + pineconeMultiplier, seaFoodExclusions, + // Doesn't like baked goods but really likes meats, fish, and insects + bakedGoodNonPreference, + + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(0.75F).saturation(0.75F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(1.15F).saturation(1.16F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/cooked")).hunger(1.75F).saturation(1.74F).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/raw")).hunger(0.5F).saturation(0.6F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/raw")).hunger(0.25F).saturation(0.25F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/raw")).hunger(1).saturation(1).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/rotten")).hunger(0.24F).saturation(0.25F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/rotten")).hunger(0.2F).saturation(0.2F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/rotten")).hunger(0.9F).saturation(0.9F).build() + ), List.of( + // Gets food poisoning from eating rotten and raw meat + new FoodGroupEffects.Builder().tag(Unicopia.id("fish/rotten")).tag(Unicopia.id("meat/raw")).tag(Unicopia.id("meat/rotten")).ailment(new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 5)).build(), + new FoodGroupEffects.Builder().tag(Unicopia.id("insect/rotten")).ailment(new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(50), Range.of(1), 15)).build(), + // Can eat cooked meat and insects without negative effects + new FoodGroupEffects.Builder().tag(Unicopia.id("insect/cooked")).tag(Unicopia.id("meat/cooked")).build(), + // Becomes hyper when eating mangoes + new FoodGroupEffects.Builder().tag(Unicopia.id("bat_ponys_delight")).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.HEALTH_BOOST, Range.of(30, 60), Range.of(2, 6), 0), + new StatusEffectAffliction(StatusEffects.JUMP_BOOST, Range.of(30, 60), Range.of(1, 6), 0), + new StatusEffectAffliction(StatusEffects.REGENERATION, Range.of(3, 30), Range.of(3, 6), 0) + )).build() + ), Optional.empty())); + // Much like Earth Ponies, Kirins must cook their meat before they eat it + exporter.accept(Race.KIRIN, new DietProfile(0.6F, 0.9F, List.of( + // Cannot eat love, or raw/rotten meats and fish + bakedGoodPreference, properMeatStandards, pineconeMultiplier, seaFoodExclusions, + + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(0.75F).saturation(0.35F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(1.5F).saturation(1.6F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/cooked")).hunger(0.25F).saturation(0.74F).build() + ), List.of( + // can eat these without negative effects + new FoodGroupEffects.Builder().tag(Unicopia.id("insect/cooked")).tag(Unicopia.id("meat/cooked")).food(FoodComponents.COOKED_BEEF).build(), + new FoodGroupEffects.Builder().tag(Unicopia.id("foraging/blinding")).food(4, 0.2F).build(), + new FoodGroupEffects.Builder().tag(Unicopia.id("foraging/prickly")).food(0, 1.5F).build(), + new FoodGroupEffects.Builder().tag(Unicopia.id("foraging/severely_prickly")).food(2, 0.9F).build(), + new FoodGroupEffects.Builder().tag(Unicopia.id("foraging/strengthening")).food(4, 0.2F).ailment(new StatusEffectAffliction(StatusEffects.STRENGTH, Range.of(1300), Range.of(0), 0)).build(), + new FoodGroupEffects.Builder().tag(Unicopia.id("foraging/glowing")).food(1, 1.6F).ailment(new StatusEffectAffliction(StatusEffects.GLOWING, Range.of(30), Range.of(0), 30)).build() + ), Optional.empty())); + // Earth Ponies are vegans. They get the most from foraging + exporter.accept(Race.EARTH, new DietProfile(0.7F, 1.2F, List.of( + // Pastries are their passion + // If they must eat meat, they have to cook it and not let it spoil. + bakedGoodExtremePreference, pineconeMultiplier, properMeatStandards, seaFoodExclusions, + // They have a sweet tooth + new Multiplier.Builder().tag(Unicopia.id("candy")).tag(Unicopia.id("desserts")).tag(Unicopia.id("rocks")).hunger(2.5F).saturation(1.7F).build(), + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(0.2F).saturation(0.3F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/cooked")).hunger(0.1F).saturation(0.1F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(0.1F).saturation(0.1F).build() + ), List.of( + // Candy and rocks gives them a massive saturation boost. Maybe too much? + new FoodGroupEffects.Builder().tag(Unicopia.id("candy")).tag(Unicopia.id("rocks")).food(UFoodComponents.builder(5, 12).alwaysEdible()).build(), + new FoodGroupEffects.Builder().tag(Unicopia.id("desserts")).food(UFoodComponents.builder(12, 32).snack().alwaysEdible()).build() + ), Optional.empty())); + // Pegasi prefer fish over other food sources + exporter.accept(Race.PEGASUS, new DietProfile(0.9F, 1, List.of( + bakedGoodPreference, pineconeMultiplier, avianMeatStandards, seaFoodExclusions, + // Cannot eat love, or raw/rotten meat + // Can eat raw and rotten fish but still prefers if they are cooked + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(1.5F).saturation(1.5F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(0.25F).saturation(0.16F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/cooked")).hunger(0.1F).saturation(0.7F).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/raw")).hunger(0.5F).saturation(0.8F).build(), + new Multiplier.Builder().tag(Unicopia.id("fish/rotten")).hunger(0.25F).saturation(0.5F).build() + ), List.of( + // Can safely eat fresh and cooked fish with no ill effects + new FoodGroupEffects.Builder().tag(Unicopia.id("fish/cooked")).tag(Unicopia.id("fish/raw")).build(), + // Is less affected when eating rotten fish + new FoodGroupEffects.Builder().tag(Unicopia.id("fish/rotten")).ailment(new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(50), Range.of(2), 95)).build() + ), Optional.empty())); + // Changelings like meat and fish but really prefer feasting on ponies' love directly from the tap + exporter.accept(Race.CHANGELING, new DietProfile(0.15F, 0.1F, List.of( + // Doesn't like baked goods but really likes meats, fish, and insects + bakedGoodNonPreference, pineconeMultiplier, seaFoodExclusions, + + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(0.5F).saturation(1.2F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(0.9F).saturation(1.2F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/cooked")).hunger(1.2F).saturation(1.3F).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/raw")).hunger(0.15F).saturation(0.25F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/raw")).hunger(1.25F).saturation(1.25F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/raw")).hunger(1).saturation(1).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/rotten")).hunger(0.24F).saturation(0.25F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/rotten")).hunger(0.2F).saturation(0.2F).build(), + new Multiplier.Builder().tag(Unicopia.id("insect/rotten")).hunger(0.9F).saturation(0.9F).build(), + + new Multiplier.Builder().tag(Unicopia.id("love")).hunger(1).saturation(1.5F).build() + ), List.of( + // Can eat fish, meat, insects, and love without negative effects + new FoodGroupEffects.Builder() + .tag(Unicopia.id("fish/cooked")).tag(Unicopia.id("meat/cooked")).tag(Unicopia.id("insect/cooked")) + .tag(Unicopia.id("fish/rotten")).tag(Unicopia.id("meat/rotten")).tag(Unicopia.id("insect/rotten")) + .tag(Unicopia.id("fish/raw")).tag(Unicopia.id("meat/raw")).tag(Unicopia.id("insect/raw")) + .tag(Unicopia.id("baked_goods")).tag(Unicopia.id("pinecone")) + .tag(Unicopia.id("love")).ailment(ClearLoveSicknessAffliction.INSTANCE).build(), + + new FoodGroupEffects.Builder() + .tag(Unicopia.id("foraging/blinding")).tag(Unicopia.id("foraging/dangerous")).tag(Unicopia.id("foraging/edible_filling")) + .tag(Unicopia.id("foraging/edible")).tag(Unicopia.id("foraging/leafy_greens")).tag(Unicopia.id("foraging/nauseating")) + .tag(Unicopia.id("foraging/prickly")).tag(Unicopia.id("foraging/glowing")).tag(Unicopia.id("foraging/risky")) + .tag(Unicopia.id("foraging/severely_nauseating")).tag(Unicopia.id("foraging/severely_prickly")) + .tag(Unicopia.id("foraging/strengthening")) + .ailment(loveSicknessEffects) + .build() + ), Optional.empty())); + // Hippogriffs like fish, nuts, and seeds + exporter.accept(Race.HIPPOGRIFF, new DietProfile(0.5F, 0.8F, List.of( + bakedGoodPreference, pineconeMultiplier, seaFoodExclusions, + + new Multiplier.Builder().tag(Unicopia.id("love")) + .tag(Unicopia.id("insect/cooked")).tag(Unicopia.id("insect/raw")).tag(Unicopia.id("insect/rotten")) + .hunger(0).saturation(0).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(1.5F).saturation(1.2F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/cooked")).hunger(1.9F).saturation(1.2F).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/raw")).hunger(0.85F).saturation(0.95F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/raw")).hunger(0.75F).saturation(0.75F).build(), + + new Multiplier.Builder().tag(Unicopia.id("fish/rotten")).hunger(0.24F).saturation(0.25F).build(), + new Multiplier.Builder().tag(Unicopia.id("meat/rotten")).hunger(0.3F).saturation(0.5F).build(), + + new Multiplier.Builder().tag(Unicopia.id("nuts_and_seeds")).hunger(1.4F).saturation(1.4F).build() + ), List.of( + // Can eat fish and prickly foods without negative effect + new FoodGroupEffects.Builder() + .tag(Unicopia.id("fish/cooked")).tag(Unicopia.id("fish/raw")).tag(Unicopia.id("fish/rotten")) + .tag(Unicopia.id("foraging/prickly")).tag(Unicopia.id("foraging/severely_prickly")) + .build(), + // Gains more health from pinecones + new FoodGroupEffects.Builder().tag(Unicopia.id("pinecone")).ailment(new HealingAffliction(3)).build() + ), Optional.empty())); + // Seaponies can eat seaweed, kelp, shells, and other undersea foods + exporter.accept(Race.SEAPONY, new DietProfile(0.5F, 0.8F, List.of( + new Multiplier.Builder().tag(Unicopia.id("fish/cooked")).hunger(1.5F).saturation(1.2F).build(), + new Multiplier.Builder().tag(Unicopia.id("fish/raw")).hunger(0.85F).saturation(0.95F).build(), + new Multiplier.Builder().tag(Unicopia.id("fish/rotten")).hunger(0.24F).saturation(0.25F).build(), + new Multiplier.Builder() + .tag(Unicopia.id("sea_vegetable/raw")) + .tag(Unicopia.id("sea_vegetable/cooked")) + .tag(Unicopia.id("shells")).tag(Unicopia.id("special_shells")) + .hunger(1).saturation(1).build() + ), List.of( + // Can eat fish without negative effect + new FoodGroupEffects.Builder() + .tag(Unicopia.id("fish/cooked")).tag(Unicopia.id("fish/raw")).tag(Unicopia.id("fish/rotten")) + .build(), + // Gains more health from pinecones + new FoodGroupEffects.Builder().tag(Unicopia.id("pinecone")).ailment(new HealingAffliction(3)).build() + ), Optional.empty())); + } +} + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/DietsProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/DietsProvider.java new file mode 100644 index 00000000..5b14e3dd --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/DietsProvider.java @@ -0,0 +1,83 @@ +package com.minelittlepony.unicopia.datagen.providers; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; + +import com.google.gson.JsonObject; +import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.datagen.DataCollector; +import com.minelittlepony.unicopia.diet.DietProfile; +import com.minelittlepony.unicopia.diet.FoodGroup; +import com.mojang.serialization.JsonOps; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.minecraft.data.DataOutput; +import net.minecraft.data.DataProvider; +import net.minecraft.data.DataWriter; +import net.minecraft.data.server.tag.TagProvider; +import net.minecraft.data.server.tag.TagProvider.TagLookup; +import net.minecraft.item.Item; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +public class DietsProvider implements DataProvider { + private final DataCollector dietsCollector; + private final DataCollector categoriesCollector; + + private final CompletableFuture> itemTagLookup; + + public DietsProvider(FabricDataOutput output, TagProvider tagProvider) { + this.dietsCollector = new DataCollector(output.getResolver(DataOutput.OutputType.DATA_PACK, "diet/races")); + this.categoriesCollector = new DataCollector(output.getResolver(DataOutput.OutputType.DATA_PACK, "diet/food_groups")); + itemTagLookup = tagProvider.getTagLookupFuture(); + } + + @Override + public String getName() { + return "Diets"; + } + + @Override + public CompletableFuture run(DataWriter writer) { + return itemTagLookup.thenCompose(tagLookup -> { + var diets = categoriesCollector.prime(); + Map> keyToGroupId = new HashMap<>(); + new FoodGroupsGenerator().generate((id, builder) -> { + var attributes = builder.build(); + attributes.tags().forEach(key -> { + if (!tagLookup.contains(TagKey.of(RegistryKeys.ITEM, key.id()))) { + throw new IllegalArgumentException("Food group " + id + " references unknown item tag " + key.id()); + } + keyToGroupId.computeIfAbsent(key.id(), i -> new HashSet<>()).add(id); + }); + diets.accept(id, () -> FoodGroup.CODEC.encode(attributes, JsonOps.INSTANCE, new JsonObject()).result().get()); + }); + var profiles = dietsCollector.prime(); + new DietProfileGenerator().generate((race, profile) -> { + Identifier id = Race.REGISTRY.getId(race); + StringBuilder issues = new StringBuilder(); + profile.validate(issue -> { + issues.append(System.lineSeparator()).append(issue); + }, categoriesCollector::isDefined); + if (!issues.isEmpty()) { + throw new IllegalArgumentException("Diet profile " + id + " failed validation: " + issues.toString()); + } + profiles.accept(id, () -> DietProfile.CODEC.encode(profile, JsonOps.INSTANCE, new JsonObject()).result().get()); + }); + keyToGroupId.forEach((tag, groups) -> { + if (groups.size() > 1) { + throw new IllegalArgumentException("Multiple groups referenced the same tag " + tag + " held by " + + groups.stream().map(Identifier::toString).collect(Collectors.joining()) + ); + } + }); + + return CompletableFuture.allOf(categoriesCollector.upload(writer), dietsCollector.upload(writer)); + }); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/FoodGroupsGenerator.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/FoodGroupsGenerator.java new file mode 100644 index 00000000..3959da20 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/FoodGroupsGenerator.java @@ -0,0 +1,115 @@ +package com.minelittlepony.unicopia.datagen.providers; + +import java.util.List; +import java.util.function.BiConsumer; +import com.minelittlepony.unicopia.UConventionalTags; +import com.minelittlepony.unicopia.UTags; +import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.diet.FoodGroupEffects; +import com.minelittlepony.unicopia.diet.affliction.Affliction; +import com.minelittlepony.unicopia.diet.affliction.CompoundAffliction; +import com.minelittlepony.unicopia.diet.affliction.HealingAffliction; +import com.minelittlepony.unicopia.diet.affliction.LoseHungerAffliction; +import com.minelittlepony.unicopia.diet.affliction.Range; +import com.minelittlepony.unicopia.diet.affliction.StatusEffectAffliction; +import com.minelittlepony.unicopia.entity.effect.UEffects; +import com.minelittlepony.unicopia.item.UFoodComponents; + +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.item.FoodComponent; +import net.minecraft.item.FoodComponents; +import net.minecraft.item.Item; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +public class FoodGroupsGenerator { + public void generate(BiConsumer exporter) { + exporter.accept(Unicopia.id("baked_goods"), new FoodGroupEffects.Builder().tag(UTags.Items.BAKED_GOODS).food(FoodComponents.BREAD)); + exporter.accept(Unicopia.id("bat_ponys_delight"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.MANGOES).food(UFoodComponents.MANGO)); + exporter.accept(Unicopia.id("candy"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.CANDY).food(UFoodComponents.CANDY)); + exporter.accept(Unicopia.id("desserts"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.DESSERTS).food(FoodComponents.COOKIE)); + exporter.accept(Unicopia.id("fruit"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.FRUITS).food(UFoodComponents.BANANA)); + exporter.accept(Unicopia.id("rocks"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.ROCKS).tag(UTags.Items.ROCK_STEWS).food(FoodComponents.MUSHROOM_STEW)); + exporter.accept(Unicopia.id("shells"), new FoodGroupEffects.Builder().tag(UTags.Items.SHELLS).food(UFoodComponents.SHELL)); + exporter.accept(Unicopia.id("special_shells"), new FoodGroupEffects.Builder().tag(UTags.Items.SPECIAL_SHELLS).food(UFoodComponents.SHELLY)); + exporter.accept(Unicopia.id("love"), new FoodGroupEffects.Builder().tag(UTags.Items.CONTAINER_WITH_LOVE).food(UFoodComponents.LOVE_MUG).ailment(new CompoundAffliction(List.of( + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(50), Range.of(2), 0), + new LoseHungerAffliction(0.5F) + )))); + exporter.accept(Unicopia.id("nuts_and_seeds"), new FoodGroupEffects.Builder() + .tag(UConventionalTags.Items.GRAIN).tag(UConventionalTags.Items.NUTS).tag(UConventionalTags.Items.SEEDS) + .food(UFoodComponents.BANANA) + ); + exporter.accept(Unicopia.id("pinecone"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.PINECONES).food(UFoodComponents.PINECONE).ailment(new HealingAffliction(1))); + + provideMeatCategory("fish", + UConventionalTags.Items.COOKED_FISH, UConventionalTags.Items.RAW_FISH, UConventionalTags.Items.ROTTEN_FISH, + FoodComponents.COOKED_COD, FoodComponents.COD, FoodComponents.ROTTEN_FLESH, exporter); + provideMeatCategory("meat", + UConventionalTags.Items.COOKED_MEAT, UConventionalTags.Items.RAW_MEAT, UConventionalTags.Items.ROTTEN_MEAT, + FoodComponents.COOKED_BEEF, FoodComponents.BEEF, FoodComponents.ROTTEN_FLESH, exporter); + provideMeatCategory("insect", + UConventionalTags.Items.COOKED_INSECT, UConventionalTags.Items.RAW_INSECT, UConventionalTags.Items.ROTTEN_INSECT, + FoodComponents.COOKED_BEEF, FoodComponents.BEEF, FoodComponents.ROTTEN_FLESH, exporter); + provideVegetableCategory("sea_vegetable", + UTags.Items.HIGH_QUALITY_SEA_VEGETABLES, UTags.Items.LOW_QUALITY_SEA_VEGETABLES, + FoodComponents.COOKED_BEEF, FoodComponents.BEEF, exporter); + + exporter.accept(Unicopia.id("foraging/blinding"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_BLINDING).food(4, 0.2F).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.BLINDNESS, Range.of(30), Range.of(0), 50), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 12) + ))); + exporter.accept(Unicopia.id("foraging/dangerous"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_DANGEROUS).food(3, 0.3F).ailment(new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(250), Range.of(2), 4))); + exporter.accept(Unicopia.id("foraging/edible_filling"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_FILLING).food(17, 0.6F)); + exporter.accept(Unicopia.id("foraging/edible"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_SAFE).food(2, 1)); + exporter.accept(Unicopia.id("foraging/leafy_greens"), new FoodGroupEffects.Builder().tag(ItemTags.LEAVES).food(1, 1.4F)); + exporter.accept(Unicopia.id("foraging/nauseating"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_NAUSEATING).food(5, 0.5F).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.WEAKNESS, Range.of(200), Range.of(1), 30), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(200), Range.of(2), 0) + ))); + exporter.accept(Unicopia.id("foraging/prickly"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_PRICKLY).food(0, 1.5F).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.INSTANT_DAMAGE, Range.of(1), Range.of(0), 30) + ))); + exporter.accept(Unicopia.id("foraging/glowing"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_GLOWING).food(1, 1.6F).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.GLOWING, Range.of(30), Range.of(0), 30), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 0) + ))); + exporter.accept(Unicopia.id("foraging/risky"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_RISKY).food(9, 1.1F).ailment(new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 80))); + exporter.accept(Unicopia.id("foraging/severely_nauseating"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_SEVERE_NAUSEATING).food(3, 0.9F).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.WEAKNESS, Range.of(200), Range.of(1), 0), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 80) + ))); + exporter.accept(Unicopia.id("foraging/severely_prickly"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_SEVERE_PRICKLY).food(2, 0.9F).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.INSTANT_DAMAGE, Range.of(1), Range.of(0), 0), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 80) + ))); + exporter.accept(Unicopia.id("foraging/strengthening"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_STRENGHENING).food(4, 0.2F).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.STRENGTH, Range.of(1300), Range.of(0), 0), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 70) + ))); + } + + private void provideMeatCategory(String name, + TagKey cookedTag, TagKey rawTag, TagKey rottenTag, + FoodComponent cooked, FoodComponent raw, FoodComponent rotten, + BiConsumer exporter) { + exporter.accept(Unicopia.id(name + "/cooked"), new FoodGroupEffects.Builder().tag(cookedTag).food(cooked).ailment(new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 25))); + exporter.accept(Unicopia.id(name + "/raw"), new FoodGroupEffects.Builder().tag(rawTag).food(raw).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.POISON, Range.of(45), Range.of(2), 80), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 65) + ))); + exporter.accept(Unicopia.id(name + "/rotten"), new FoodGroupEffects.Builder().tag(rottenTag).food(rotten).ailment(CompoundAffliction.of( + new StatusEffectAffliction(StatusEffects.POISON, Range.of(45), Range.of(2), 80), + new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 95) + ))); + } + + private void provideVegetableCategory(String name, + TagKey cookedTag, TagKey rawTag, + FoodComponent cooked, FoodComponent raw, + BiConsumer exporter) { + exporter.accept(Unicopia.id(name + "/cooked"), new FoodGroupEffects.Builder().tag(cookedTag).food(cooked)); + exporter.accept(Unicopia.id(name + "/raw"), new FoodGroupEffects.Builder().tag(rawTag).food(raw)); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/SeasonsGrowthRatesProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/SeasonsGrowthRatesProvider.java index 186c0685..d802bbc7 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/SeasonsGrowthRatesProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/SeasonsGrowthRatesProvider.java @@ -12,17 +12,16 @@ import com.minelittlepony.unicopia.server.world.UTreeGen; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.minecraft.block.Block; import net.minecraft.data.DataOutput; -import net.minecraft.data.DataOutput.PathResolver; import net.minecraft.registry.Registries; import net.minecraft.data.DataProvider; import net.minecraft.data.DataWriter; public class SeasonsGrowthRatesProvider implements DataProvider { - private final PathResolver pathResolver; + private final DataCollector collectedData; public SeasonsGrowthRatesProvider(FabricDataOutput output) { - this.pathResolver = output.getResolver(DataOutput.OutputType.DATA_PACK, "seasons/crop"); + this.collectedData = new DataCollector(output.getResolver(DataOutput.OutputType.DATA_PACK, "seasons/crop")); } @Override @@ -32,7 +31,6 @@ public class SeasonsGrowthRatesProvider implements DataProvider { @Override public CompletableFuture run(DataWriter writer) { - DataCollector collectedData = new DataCollector(pathResolver); var exporter = collectedData.prime(); generate((block, crop) -> { exporter.accept(Registries.BLOCK.getId(block), crop::toJson); diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java new file mode 100644 index 00000000..d200f3c1 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java @@ -0,0 +1,272 @@ +package com.minelittlepony.unicopia.datagen.providers; + +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.UTags; +import com.minelittlepony.unicopia.advancement.CustomEventCriterion; +import com.minelittlepony.unicopia.advancement.RaceChangeCriterion; +import com.minelittlepony.unicopia.advancement.RacePredicate; +import com.minelittlepony.unicopia.advancement.SendViaDragonBreathScrollCriterion; +import com.minelittlepony.unicopia.advancement.UCriteria; +import com.minelittlepony.unicopia.item.UItems; +import com.minelittlepony.unicopia.item.enchantment.UEnchantments; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider; +import net.fabricmc.fabric.api.util.TriState; +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.advancement.AdvancementEntry; +import net.minecraft.advancement.AdvancementFrame; +import net.minecraft.advancement.AdvancementRequirements; +import net.minecraft.advancement.AdvancementRewards; +import net.minecraft.advancement.criterion.ConsumeItemCriterion; +import net.minecraft.advancement.criterion.Criteria; +import net.minecraft.advancement.criterion.EnchantedItemCriterion; +import net.minecraft.advancement.criterion.InventoryChangedCriterion; +import net.minecraft.advancement.criterion.OnKilledCriterion; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.damage.DamageType; +import net.minecraft.item.Item; +import net.minecraft.item.ItemConvertible; +import net.minecraft.item.Items; +import net.minecraft.predicate.NumberRange; +import net.minecraft.predicate.TagPredicate; +import net.minecraft.predicate.entity.DamageSourcePredicate; +import net.minecraft.predicate.item.EnchantmentPredicate; +import net.minecraft.predicate.item.ItemPredicate; +import net.minecraft.registry.Registries; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +public class UAdvancementsProvider extends FabricAdvancementProvider { + public UAdvancementsProvider(FabricDataOutput output) { + super(output); + } + + @Override + public void generateAdvancement(Consumer consumer) { + AdvancementDisplayBuilder.create(UItems.ALICORN_BADGE).criterion("crafting_table", hasItems(Items.CRAFTING_TABLE)).build(consumer, "root").children(root -> { + createTribeRootAdvancement(consumer, root, Race.EARTH).children(consumer, this::generateEarthTribeAdvancementsTree); + createTribeRootAdvancement(consumer, root, Race.BAT).children(consumer, this::generateBatTribeAdvancementsTree); + createTribeRootAdvancement(consumer, root, Race.PEGASUS).children(consumer, this::generatePegasusTribeAdvancementsTree); + createTribeRootAdvancement(consumer, root, Race.UNICORN, Race.ALICORN).children(consumer, this::generateUnicornTribeAdvancementsTree); + createTribeRootAdvancement(consumer, root, Race.HIPPOGRIFF, Race.SEAPONY).children(consumer, this::generateHippogrifTribeAdvancementsTree); + }); + + generateEnchantmentsAdvancementsTree(consumer); + } + + private AdvancementDisplayBuilder.Parent createTribeRootAdvancement(Consumer consumer, AdvancementDisplayBuilder.Parent root, Race race, Race...extra) { + AdvancementDisplayBuilder builder = root.child(Registries.ITEM.get(race.getId().withSuffixedPath("_badge"))).showToast().announce().group(race.getId().getPath()) + .criterion("be_" + race.getId().getPath(), UCriteria.PLAYER_CHANGE_RACE.create(new RaceChangeCriterion.Conditions(Optional.empty(), race))); + + if (extra.length > 0) { + for (Race r : extra) { + builder.criterion("be_" + r.getId().getPath(), UCriteria.PLAYER_CHANGE_RACE.create(new RaceChangeCriterion.Conditions(Optional.empty(), r))); + } + } + + return builder.build(consumer, race.getId().getPath() + "_route"); + } + + private void generateEarthTribeAdvancementsTree(Consumer consumer, AdvancementDisplayBuilder.Parent parent) { + parent.child(UItems.ROCK).criterion("has_rock", hasItems(UItems.ROCK)).build(consumer, "born_on_a_rock_farm").children(p -> { + p.child(UItems.PEBBLES).criterion("killed_entity_with_rock", killWithItems(UTags.DamageTypes.FROM_ROCKS)).build(consumer, "sticks_and_stones"); + p.child(UItems.WEIRD_ROCK).hidden().criterion("has_rock", hasItems(UItems.WEIRD_ROCK)).build(consumer, "thats_unusual"); + }); + + parent.child(UItems.FRIED_AXOLOTL).criterion("eaten_axolotl", ConsumeItemCriterion.Conditions.item(UItems.FRIED_AXOLOTL)).build(consumer, "tastes_like_chicken"); + parent.child(UItems.OATS).criterion("has_oats", hasItems(UItems.OATS)).build(consumer, "oats_so_easy"); + parent.child(Items.HAY_BLOCK).criterion("eat_hay", ConsumeItemCriterion.Conditions.item(Items.HAY_BLOCK)).build(consumer, "what_the_hay"); + parent.child(UItems.COPPER_HORSE_SHOE).criterion("has_horseshoe", hasItems(UTags.Items.HORSE_SHOES)).build(consumer, "blacksmith").children(p -> { + p.child(UItems.IRON_HORSE_SHOE).criterion("has_iron_horseshoe", hasItems(UItems.IRON_HORSE_SHOE)).build(consumer, "change_of_shoes") + .child(UItems.GOLDEN_HORSE_SHOE).criterion("has_gold_horseshoe", hasItems(UItems.GOLDEN_HORSE_SHOE)).build(consumer, "fashionably_expensive") + .child(UItems.NETHERITE_HORSE_SHOE).criterion("has_netherite_horseshoe", hasItems(UItems.NETHERITE_HORSE_SHOE)).build(consumer, "overkill"); + p.child(UItems.IRON_HORSE_SHOE).hidden().frame(AdvancementFrame.CHALLENGE).criterion("killed_entity_with_horseshoe", killWithItems(UTags.DamageTypes.FROM_HORSESHOES)).build(consumer, "dead_ringer"); + }); + parent.child(UItems.PINECONE).frame(AdvancementFrame.CHALLENGE).criterion("eat_pinecone", ConsumeItemCriterion.Conditions.item(UItems.PINECONE)).build(consumer, "eat_pinecone"); + parent.child(UItems.OAK_BASKET).doNotAnnounce().criterion("has_basket", hasItems(UTags.Items.BASKETS)).build(consumer, "basket_case") + .child(Items.LANTERN).criterion("construct_balloon", CustomEventCriterion.create("construct_balloon")).build(consumer, "aeronaut") + .child(UItems.GIANT_BALLOON).announce().frame(AdvancementFrame.CHALLENGE).criterion("ride_balloon", CustomEventCriterion.create("ride_balloon")).build(consumer, "travelling_in_style"); + parent.child(UItems.MUFFIN).hidden().criterion("has_muffin", hasItems(UItems.MUFFIN)).build(consumer, "baked_bads"); + parent.child(UItems.HORSE_SHOE_FRIES).criterion("has_horse_shoe_fries", hasItems(UItems.HORSE_SHOE_FRIES)).build(consumer, "lucky"); + parent.child(UItems.TOAST).criterion("has_toast", hasItems(UItems.TOAST)).build(consumer, "toast") + .child(UItems.BURNED_TOAST).hidden().criterion("has_burned_toast", hasItems(UItems.BURNED_TOAST)).build(consumer, "burn_toast"); + parent.child(UItems.GREEN_APPLE).criterion("has_apple", hasItems(UTags.Items.FRESH_APPLES)).build(consumer, "apple_route").children(p -> { + p.child(UItems.SWEET_APPLE).criterion("has_all_apples", hasItems(Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE, UItems.ROTTEN_APPLE, UItems.ZAP_APPLE, UItems.COOKED_ZAP_APPLE, Items.GOLDEN_APPLE)).build(consumer, "sweet_apple_acres"); + p.child(UItems.ZAP_BULB).criterion("has_zap_apple", hasItems(UItems.ZAP_APPLE)).build(consumer, "trick_apple").children(pp -> { + pp.child(UItems.ZAP_APPLE).hidden().criterion("eat_trick_apple", CustomEventCriterion.createFlying("eat_trick_apple")).build(consumer, "eat_trick_apple"); + pp.child(UItems.ZAP_APPLE).hidden().criterion("feed_trick_apple", CustomEventCriterion.createFlying("feed_trick_apple")).build(consumer, "feed_trick_apple"); + }); + p.child(UItems.JUICE).criterion("has_juice", hasItems(UItems.JUICE)).build(consumer, "juice") + .child(UItems.BURNED_JUICE).hidden().criterion("has_burned_juice", hasItems(UItems.BURNED_JUICE)).build(consumer, "burn_juice") + .child(UItems.CIDER).visible().criterion("has_cider", hasItems(UItems.CIDER)).rewards(AdvancementRewards.Builder.experience(12)).build(consumer, "brew_cider"); + }); + } + + private void generatePegasusTribeAdvancementsTree(Consumer consumer, AdvancementDisplayBuilder.Parent parent) { + parent.child(Items.PHANTOM_MEMBRANE).hidden().frame(AdvancementFrame.CHALLENGE).criterion("deter_phantom", CustomEventCriterion.createFlying("kill_phantom_while_flying")).rewards(AdvancementRewards.Builder.experience(100)).build(consumer, "deter_phantom"); + parent.child(Items.GLASS_PANE).criterion("break_window", CustomEventCriterion.createFlying("break_window")).rewards(AdvancementRewards.Builder.experience(10)).build(consumer, "rainbow_crash"); + parent.child(UItems.PEGASUS_BADGE).criterion("fly_through_the_pain", CustomEventCriterion.createFlying("second_wind")).rewards(AdvancementRewards.Builder.experience(10)).build(consumer, "second_wind"); + parent.child(UItems.EMPTY_JAR).criterion("has_empty_jar", hasItems(UItems.EMPTY_JAR)).build(consumer, "jar") + .child(UItems.RAIN_CLOUD_JAR).criterion("has_cloud_jar", hasItems(UTags.Items.CLOUD_JARS)).rewards(AdvancementRewards.Builder.experience(55)).build(consumer, "gotcha"); + parent.child(UItems.LIGHTNING_JAR).frame(AdvancementFrame.CHALLENGE).criterion("lightning_strike", CustomEventCriterion.createFlying("lightning_strike")).rewards(AdvancementRewards.Builder.experience(30)).build(consumer, "mid_flight_interruption").children(p -> { + p.child(UItems.LIGHTNING_JAR).hidden().frame(AdvancementFrame.CHALLENGE).apply(d -> applyLightningBugCriterions(d, RacePredicate.of(Set.of(Race.CHANGELING), Set.of()), 10, 90)).build(consumer, "lightning_bug"); + p.child(UItems.LIGHTNING_JAR).hidden().frame(AdvancementFrame.CHALLENGE).apply(d -> applyLightningBugCriterions(d, RacePredicate.of(Set.of(), Set.of(Race.CHANGELING)), 10, 90)).build(consumer, "wonder_bolt"); + }); + parent.child(UItems.PEGASUS_FEATHER).hidden().frame(AdvancementFrame.CHALLENGE).criterion("shed_feather", CustomEventCriterion.createFlying("shed_feather")).rewards(AdvancementRewards.Builder.experience(1)).build(consumer, "molting_season_1") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 2, 2)).build(consumer, "molting_season_2") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 4, 8)).build(consumer, "molting_season_3") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 8, 20)).build(consumer, "molting_season_4") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 16, 40)).build(consumer, "molting_season_5") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 32, 80)).build(consumer, "molting_season_6") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 64, 200)).build(consumer, "molting_season_7") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 128, 500)).build(consumer, "molting_season_8") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 256, 1000)).build(consumer, "molting_season_9") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 512, 2280)).build(consumer, "molting_season_10") + .child(UItems.GOLDEN_FEATHER).apply(d -> applyShedFeatherCriterions(d, 1024, 4560)).build(consumer, "molting_season_11") + .child(UItems.GOLDEN_FEATHER).apply(d -> applyShedFeatherCriterions(d, 2048, 10000)).frame(AdvancementFrame.GOAL).build(consumer, "dedicated_flier"); + } + + private AdvancementDisplayBuilder applyShedFeatherCriterions(AdvancementDisplayBuilder builder, int repeats, int experience) { + for (int i = 1; i <= repeats; i++) { + builder.criterion("shed_feather_" + i, CustomEventCriterion.createFlying("shed_feather", i)); + } + return builder.criteriaMerger(AdvancementRequirements.CriterionMerger.AND).rewards(AdvancementRewards.Builder.experience(experience)); + } + + private AdvancementDisplayBuilder applyLightningBugCriterions(AdvancementDisplayBuilder builder, RacePredicate race, int repeats, int experience) { + for (int i = 1; i <= repeats; i++) { + builder.criterion("lightning_struck_player_" + i, UCriteria.CUSTOM_EVENT.create(new CustomEventCriterion.Conditions(Optional.empty(), "lightning_struck_player", race, TriState.TRUE, i))); + } + return builder.criteriaMerger(AdvancementRequirements.CriterionMerger.AND).rewards(AdvancementRewards.Builder.experience(experience)); + } + + private void generateUnicornTribeAdvancementsTree(Consumer consumer, AdvancementDisplayBuilder.Parent parent) { + parent.child(UItems.SPELLBOOK).criterion("has_spellbook", hasItems(UItems.SPELLBOOK)).build(consumer, "books").children(p -> { + // TODO: + //ItemPredicate bookPredicate = ItemPredicate.Builder.create().tag(ItemTags.BOOKSHELF_BOOKS).build(); + //p.child(Items.BOOK).hidden().frame(AdvancementFrame.CHALLENGE).criterion("has_books", InventoryChangedCriterion.Conditions.items(IntStream.range(0, 9 * 4).mapToObj(i -> bookPredicate).toArray(ItemPredicate[]::new))).build(consumer, "books_books_books"); + p.child(UItems.CRYSTAL_SHARD).criterion("has_shard", hasItems(UItems.CRYSTAL_SHARD)).build(consumer, "crystaline").children(pp -> { + pp.child(UItems.CRYSTAL_HEART).criterion("power_up_heart", CustomEventCriterion.create("power_up_heart")).rewards(AdvancementRewards.Builder.experience(105)).build(consumer, "power_up_heart"); + }); + p.child(UItems.ALICORN_AMULET).criterion("has_alicorn_amulet", hasItems(UItems.ALICORN_AMULET)).build(consumer, "tempted") + .child(Items.CRYING_OBSIDIAN).criterion("light_altar", CustomEventCriterion.create("light_altar")).build(consumer, "hello_darkness_my_old_friend") + .child(UItems.BROKEN_ALICORN_AMULET).frame(AdvancementFrame.GOAL).criterion("defeat_sombra", CustomEventCriterion.create("defeat_sombra")).rewards(AdvancementRewards.Builder.experience(2000)).build(consumer, "save_the_day").children(pp -> { + pp.child(UItems.UNICORN_AMULET).frame(AdvancementFrame.GOAL).criterion("obtain_the_thing", hasItems(UItems.UNICORN_AMULET)).rewards(AdvancementRewards.Builder.experience(1100)).build(consumer, "ascension"); + pp.child(UItems.BROKEN_ALICORN_AMULET).hidden().frame(AdvancementFrame.CHALLENGE).criterion("defeat_sombra_again", CustomEventCriterion.create("defeat_sombra", 2)).rewards(AdvancementRewards.Builder.experience(2000)).build(consumer, "doctor_sombrero"); + }); + p.child(Items.WATER_BUCKET).criterion("split_sea", CustomEventCriterion.create("split_sea")).rewards(AdvancementRewards.Builder.experience(105)).build(consumer, "split_the_sea"); + }); + + parent.child(UItems.DRAGON_BREATH_SCROLL).showToast().announce().criterion("has_scroll", hasItems(UItems.DRAGON_BREATH_SCROLL)).build(consumer, "take_a_note").children(p -> { + p.child(UItems.DRAGON_BREATH_SCROLL).criterion("send_book", dragonScroll(false, Items.WRITTEN_BOOK)).build(consumer, "dear_princess") + .child(UItems.DRAGON_BREATH_SCROLL).criterion("send_scroll", dragonScroll(false, UItems.DRAGON_BREATH_SCROLL)).build(consumer, "i_await_your_reply"); + p.child(UItems.IMPORTED_OATS).hidden().frame(AdvancementFrame.CHALLENGE) + .criterion("send_oats", dragonScroll(false, UItems.OATS, UItems.IMPORTED_OATS)) + .criterion("receieve_oats", dragonScroll(true, UItems.IMPORTED_OATS)) + .criteriaMerger(AdvancementRequirements.CriterionMerger.OR).build(consumer, "imported_oats"); + p.child(Items.CHIPPED_ANVIL).hidden().frame(AdvancementFrame.CHALLENGE).criterion("ding_sun", dingCelestia(Set.of(), Set.of(Race.BAT))).build(consumer, "blasphemy"); + p.child(Items.CHIPPED_ANVIL).hidden().frame(AdvancementFrame.CHALLENGE).criterion("ding_sun", dingCelestia(Set.of(Race.BAT), Set.of())).build(consumer, "sweet_sweet_revenge"); + }); + + parent.child(UItems.PEGASUS_AMULET).hidden().frame(AdvancementFrame.CHALLENGE).criterion("teleport_above_world", CustomEventCriterion.create("teleport_above_world")).rewards(AdvancementRewards.Builder.experience(100)).build(consumer, "a_falling_wizard"); + + } + + private void generateBatTribeAdvancementsTree(Consumer consumer, AdvancementDisplayBuilder.Parent parent) { + parent.child(Items.LIGHT).criterion("look_into_sun", CustomEventCriterion.create("look_into_sun")).build(consumer, "praise_the_sun").children(p -> { + p.child(UItems.SUNGLASSES).criterion("wear_shades", CustomEventCriterion.create("wear_shades")).build(consumer, "cool_potato"); + p.child(Items.BLACK_CANDLE).frame(AdvancementFrame.CHALLENGE).criterion("screech_twenty_mobs", CustomEventCriterion.createFlying("screech_twenty_mobs")).build(consumer, "screech_twenty_mobs") + .child(Items.BRICK).frame(AdvancementFrame.CHALLENGE).criterion("super_scare_entity", CustomEventCriterion.createFlying("super_scare_entity")).build(consumer, "extra_spooky"); + p.child(Items.BLACK_CANDLE).frame(AdvancementFrame.CHALLENGE).criterion("screech_self", CustomEventCriterion.createFlying("screech_self")).build(consumer, "screech_self"); + }); + } + + private void generateHippogrifTribeAdvancementsTree(Consumer consumer, AdvancementDisplayBuilder.Parent parent) { + parent.child(UItems.BAITED_FISHING_ROD).showToast().announce().criterion("has_baited_fishing_rod", hasItems(UItems.BAITED_FISHING_ROD)).build(consumer, "bait"); + parent.child(UItems.PEARL_NECKLACE).showToast().announce().criterion("seapony_transition", UCriteria.CUSTOM_EVENT.create(new CustomEventCriterion.Conditions(Optional.empty(), "seapony_transition", RacePredicate.of(Set.of(Race.SEAPONY), Set.of()), TriState.DEFAULT, 1))).build(consumer, "shoo_be_doo") + .child(UItems.PEARL_NECKLACE).showToast().announce().criterion("seapony_transition", UCriteria.CUSTOM_EVENT.create(new CustomEventCriterion.Conditions(Optional.empty(), "seapony_transition", RacePredicate.of(Set.of(), Set.of(Race.SEAPONY)), TriState.DEFAULT, 1))).build(consumer, "shoo_be_done"); + } + + private void generateEnchantmentsAdvancementsTree(Consumer consumer) { + AdvancementDisplayBuilder.create(Items.NETHERITE_SCRAP).showToast().announce() + .criterion("enchant_with_consumption", enchant(UEnchantments.CONSUMPTION)) + .rewards(AdvancementRewards.Builder.experience(120)) + .parent(new Identifier("story/enchant_item")) + .group("enchanting") + .build(consumer, "experimental") + .child(Items.NETHERITE_PICKAXE) + .criterion("use_consumption", CustomEventCriterion.create("use_consumption")) + .rewards(AdvancementRewards.Builder.experience(1200)) + .group("enchanting") + .hidden() + .build(consumer, "xp_miner"); + AdvancementDisplayBuilder.create(Items.GOLDEN_APPLE).showToast().announce() + .criterion("enchant_with_heart_bound", enchant(UEnchantments.HEART_BOUND)) + .rewards(AdvancementRewards.Builder.experience(120)) + .parent(new Identifier("story/enchant_item")) + .group("enchanting") + .build(consumer, "hearts_stronger_than_horses") + .child(Items.GOLDEN_PICKAXE) + .criterion("use_soulmate", CustomEventCriterion.create("use_soulmate")) + .rewards(AdvancementRewards.Builder.experience(1200)) + .group("enchanting") + .hidden() + .build(consumer, "soulmate"); + } + + public static AdvancementCriterion enchant(Enchantment enchantment) { + return Criteria.ENCHANTED_ITEM.create(new EnchantedItemCriterion.Conditions( + Optional.empty(), + Optional.of(ItemPredicate.Builder.create() + .enchantment(new EnchantmentPredicate(enchantment, NumberRange.IntRange.ANY)) + .build()), + NumberRange.IntRange.ANY + )); + } + + public static AdvancementCriterion dragonScroll(boolean receiving, ItemConvertible...items) { + return dragonScroll(receiving, ItemPredicate.Builder.create().items(items).build()); + } + + public static AdvancementCriterion dragonScroll(boolean receiving, ItemPredicate items) { + return UCriteria.SEND_DRAGON_BREATH.create(new SendViaDragonBreathScrollCriterion.Conditions( + Optional.empty(), + Optional.of(items), + receiving, + Optional.empty(), + TriState.DEFAULT, + Optional.empty(), + RacePredicate.EMPTY + )); + } + + static AdvancementCriterion hasItems(ItemConvertible...items) { + return InventoryChangedCriterion.Conditions.items(items); + } + + static AdvancementCriterion hasItems(TagKey items) { + return InventoryChangedCriterion.Conditions.items(ItemPredicate.Builder.create().tag(items).build()); + } + + static AdvancementCriterion killWithItems(TagKey tag) { + return OnKilledCriterion.Conditions.createPlayerKilledEntity( + Optional.empty(), + Optional.of(DamageSourcePredicate.Builder.create().tag(TagPredicate.expected(tag)).build()) + ); + } + + static AdvancementCriterion dingCelestia(Set includeTribes, Set excludeTribes) { + return UCriteria.SEND_DRAGON_BREATH.create(new SendViaDragonBreathScrollCriterion.Conditions( + Optional.empty(), + Optional.of(ItemPredicate.Builder.create().tag(UTags.Items.IS_DELIVERED_AGGRESSIVELY).build()), + false, + Optional.of("princess celestia"), + TriState.FALSE, + Optional.of("dings_on_celestias_head"), + RacePredicate.of(includeTribes, excludeTribes))); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockStateModelGenerator.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockStateModelGenerator.java index 66a829e3..6aad0997 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockStateModelGenerator.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockStateModelGenerator.java @@ -16,6 +16,7 @@ import com.minelittlepony.unicopia.block.ShellsBlock; import com.minelittlepony.unicopia.block.SlimePustuleBlock; import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.block.zap.ZapAppleLeavesBlock; +import com.minelittlepony.unicopia.datagen.Datagen; import com.minelittlepony.unicopia.datagen.UBlockFamilies; import com.minelittlepony.unicopia.server.world.Tree; @@ -35,12 +36,12 @@ import net.minecraft.data.client.Models; import net.minecraft.data.client.MultipartBlockStateSupplier; import net.minecraft.data.client.TextureMap; import net.minecraft.data.client.TexturedModel; +import net.minecraft.data.client.VariantSettings; import net.minecraft.data.client.VariantsBlockStateSupplier; import net.minecraft.data.client.When; import net.minecraft.item.Item; import net.minecraft.item.Items; import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.Properties; @@ -108,11 +109,11 @@ public class UBlockStateModelGenerator extends BlockStateModelGenerator { // chitin blocks registerTopsoil(UBlocks.SURFACE_CHITIN, UBlocks.CHITIN); registerHollow(UBlocks.CHITIN); - registerCubeAllModelTexturePool(UBlocks.CHISELLED_CHITIN).stairs(UBlocks.CHISELLED_CHITIN_STAIRS).slab(UBlocks.CHISELLED_CHITIN_SLAB); + registerCubeAllModelTexturePool(UBlocks.CHISELLED_CHITIN).family(UBlockFamilies.CHISELED_CHITIN); registerHiveBlock(UBlocks.HIVE); registerRotated(UBlocks.CHITIN_SPIKES, BlockModels.SPIKES); registerHull(UBlocks.CHISELLED_CHITIN_HULL, UBlocks.CHITIN, UBlocks.CHISELLED_CHITIN); - registerParentedItemModel(UBlocks.SLIME_PUSTULE, ModelIds.getBlockSubModelId(UBlocks.SLIME_PUSTULE, "_pod")); + registerItemModel(UBlocks.SLIME_PUSTULE.asItem()); blockStateCollector.accept(VariantsBlockStateSupplier.create(UBlocks.SLIME_PUSTULE) .coordinate(BlockStateVariantMap.create(SlimePustuleBlock.SHAPE) .register(state -> BlockStateVariant.create().put(MODEL, ModelIds.getBlockSubModelId(UBlocks.SLIME_PUSTULE, "_" + state.asString()))))); @@ -123,7 +124,7 @@ public class UBlockStateModelGenerator extends BlockStateModelGenerator { registerLog(UBlocks.STRIPPED_PALM_LOG).log(UBlocks.STRIPPED_PALM_LOG).wood(UBlocks.STRIPPED_PALM_WOOD); registerCubeAllModelTexturePool(UBlocks.PALM_PLANKS).family(UBlockFamilies.PALM); registerHangingSign(UBlocks.STRIPPED_PALM_LOG, UBlocks.PALM_HANGING_SIGN, UBlocks.PALM_WALL_HANGING_SIGN); - registerSimpleCubeAll(UBlocks.PALM_LEAVES); + registerSingleton(UBlocks.PALM_LEAVES, TexturedModel.LEAVES); // zap wood registerLog(UBlocks.ZAP_LOG) @@ -170,12 +171,25 @@ public class UBlockStateModelGenerator extends BlockStateModelGenerator { // shells registerAll(UBlockStateModelGenerator::registerShell, UBlocks.CLAM_SHELL, UBlocks.TURRET_SHELL, UBlocks.SCALLOP_SHELL); // other + registerSimpleCubeAll(UBlocks.WORM_BLOCK); registerBuiltinWithParticle(UBlocks.WEATHER_VANE, UBlocks.WEATHER_VANE.asItem()); registerWithStages(UBlocks.FROSTED_OBSIDIAN, Properties.AGE_3, BlockModels.CUBE_ALL, 0, 1, 2, 3); registerWithStagesBuiltinModels(UBlocks.ROCKS, Properties.AGE_7, 0, 1, 2, 3, 4, 5, 6, 7); registerWithStagesBuiltinModels(UBlocks.MYSTERIOUS_EGG, PileBlock.COUNT, 1, 2, 3); - excludeFromSimpleItemModelGeneration(UBlocks.MYSTERIOUS_EGG); + registerItemModel(UBlocks.MYSTERIOUS_EGG.asItem()); FireModels.registerSoulFire(this, UBlocks.SPECTRAL_FIRE, Blocks.SOUL_FIRE); + + blockStateCollector.accept(createSingletonBlockState(UBlocks.JAR, BlockModels.TEMPLATE_JAR)); + registerWeatherJar(UBlocks.CLOUD_JAR); + registerWeatherJar(UBlocks.STORM_JAR); + registerWeatherJar(UBlocks.ZAP_JAR); + registerWeatherJar(UBlocks.LIGHTNING_JAR); + } + + public void registerWeatherJar(Block jar) { + blockStateCollector.accept(MultipartBlockStateSupplier.create(jar) + .with(BlockStateVariant.create().put(VariantSettings.MODEL, BlockModels.TEMPLATE_JAR)) + .with(BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockSubModelId(jar, "_filling")))); } @SafeVarargs @@ -381,9 +395,17 @@ public class UBlockStateModelGenerator extends BlockStateModelGenerator { Identifier middle = BlockModels.TEMPLATE_PILLAR.upload(pillar, textures, modelCollector); Identifier end = BlockModels.TEMPLATE_PILLAR_END.upload(pillar, textures, modelCollector); blockStateCollector.accept(MultipartBlockStateSupplier.create(pillar) - .with(BlockStateVariant.create().put(MODEL, middle)) - .with(When.create().set(Properties.NORTH, false), BlockStateVariant.create().put(MODEL, end).put(UVLOCK, true).put(X, R180)) - .with(When.create().set(Properties.SOUTH, false), BlockStateVariant.create().put(MODEL, end)) + .with(When.create().set(Properties.AXIS, Direction.Axis.X), BlockStateVariant.create().put(MODEL, middle).put(X, R90).put(Y, R90)) + .with(When.create().set(Properties.AXIS, Direction.Axis.X).set(Properties.NORTH, false), BlockStateVariant.create().put(MODEL, end).put(X, R270).put(Y, R90)) + .with(When.create().set(Properties.AXIS, Direction.Axis.X).set(Properties.SOUTH, false), BlockStateVariant.create().put(MODEL, end).put(X, R90).put(Y, R90)) + + .with(When.create().set(Properties.AXIS, Direction.Axis.Y), BlockStateVariant.create().put(MODEL, middle)) + .with(When.create().set(Properties.AXIS, Direction.Axis.Y).set(Properties.NORTH, false), BlockStateVariant.create().put(MODEL, end).put(X, R180)) + .with(When.create().set(Properties.AXIS, Direction.Axis.Y).set(Properties.SOUTH, false), BlockStateVariant.create().put(MODEL, end)) + + .with(When.create().set(Properties.AXIS, Direction.Axis.Z), BlockStateVariant.create().put(MODEL, middle).put(X, R90)) + .with(When.create().set(Properties.AXIS, Direction.Axis.Z).set(Properties.NORTH, false), BlockStateVariant.create().put(MODEL, end).put(X, R90)) + .with(When.create().set(Properties.AXIS, Direction.Axis.Z).set(Properties.SOUTH, false), BlockStateVariant.create().put(MODEL, end).put(X, R270)) ); ItemModels.TEMPLATE_PILLAR.upload(ModelIds.getItemModelId(pillar.asItem()), textures, modelCollector); } @@ -407,9 +429,7 @@ public class UBlockStateModelGenerator extends BlockStateModelGenerator { Identifier side = baseBlockId.withPath(p -> "block/" + p + "_side"); TextureMap textures = new TextureMap().put(TOP, top).put(SIDE, side); - MultipartBlockStateSupplier supplier = MultipartBlockStateSupplier.create(Registries.BLOCK.getOrEmpty(blockId).orElseGet(() -> { - return Registry.register(Registries.BLOCK, blockId, new EdibleBlock(blockId, blockId, false)); - })); + MultipartBlockStateSupplier supplier = MultipartBlockStateSupplier.create(Datagen.getOrCreateBaleBlock(blockId)); Map uploadedModels = new HashMap<>(); for (Direction.Axis axis : Direction.Axis.VALUES) { diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UItemTagProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UItemTagProvider.java deleted file mode 100644 index 9121d3b8..00000000 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UItemTagProvider.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.minelittlepony.unicopia.datagen.providers; - -import java.util.Objects; -import java.util.concurrent.CompletableFuture; - -import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UConventionalTags; -import com.minelittlepony.unicopia.UTags; -import com.minelittlepony.unicopia.block.UBlocks; -import com.minelittlepony.unicopia.datagen.Datagen; -import com.minelittlepony.unicopia.datagen.ItemFamilies; -import com.minelittlepony.unicopia.item.BedsheetsItem; -import com.minelittlepony.unicopia.item.UItems; - -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; -import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; -import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.Items; -import net.minecraft.registry.Registries; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.RegistryWrapper; -import net.minecraft.registry.RegistryWrapper.WrapperLookup; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.registry.tag.ItemTags; -import net.minecraft.registry.tag.TagBuilder; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; - -public class UItemTagProvider extends FabricTagProvider.ItemTagProvider { - - - private final UBlockTagProvider blockTagProvider; - - public UItemTagProvider(FabricDataOutput output, CompletableFuture registriesFuture, UBlockTagProvider blockTagProvider) { - super(output, registriesFuture, blockTagProvider); - this.blockTagProvider = blockTagProvider; - } - - @Override - public void copy(TagKey blockTag, TagKey itemTag) { - TagBuilder blockTagBuilder = Objects.requireNonNull(blockTagProvider, "Pass Block tag provider via constructor to use copy").getTagBuilder(blockTag); - TagBuilder itemTagBuilder = getTagBuilder(itemTag); - blockTagBuilder.build().forEach(entry -> { - if (entry.canAdd(Registries.ITEM::containsId, tagId -> getTagBuilder(TagKey.of(RegistryKeys.ITEM, tagId)) != null)) { - itemTagBuilder.add(entry); - } else { - Datagen.LOGGER.warn("Cannot copy missing entry {} to item tag {}", entry, itemTag.id()); - } - }); - } - - @Override - protected void configure(WrapperLookup arg) { - copyBlockTags(); - exportConventionalTags(); - getOrCreateTagBuilder(ItemTags.BOOKSHELF_BOOKS).add(UItems.SPELLBOOK); - getOrCreateTagBuilder(ItemTags.BEDS).add(UItems.CLOTH_BED, UItems.CLOUD_BED); - - getOrCreateTagBuilder(ItemTags.CHEST_BOATS).add(UItems.PALM_CHEST_BOAT); - getOrCreateTagBuilder(ItemTags.BOATS).add(UItems.PALM_BOAT); - getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(ItemFamilies.MUSIC_DISCS); - getOrCreateTagBuilder(ItemTags.CREEPER_DROP_MUSIC_DISCS).add(UItems.MUSIC_DISC_CRUSADE, UItems.MUSIC_DISC_FUNK, UItems.MUSIC_DISC_PET, UItems.MUSIC_DISC_POPULAR); - - getOrCreateTagBuilder(ItemTags.SIGNS).add(UBlocks.PALM_SIGN.asItem()); - getOrCreateTagBuilder(ItemTags.HANGING_SIGNS).add(UBlocks.PALM_HANGING_SIGN.asItem()); - - getOrCreateTagBuilder(UTags.HORSE_SHOES).add(ItemFamilies.HORSE_SHOES); - getOrCreateTagBuilder(UTags.POLEARMS).add(ItemFamilies.POLEARMS); - - getOrCreateTagBuilder(ItemTags.TOOLS).addTag(UTags.HORSE_SHOES).addTag(UTags.POLEARMS); - - getOrCreateTagBuilder(UTags.BASKETS).add(ItemFamilies.BASKETS); - getOrCreateTagBuilder(UTags.BADGES).add(Race.REGISTRY.stream() - .map(race -> race.getId().withPath(p -> p + "_badge")) - .flatMap(id -> Registries.ITEM.getOrEmpty(id).stream()) - .toArray(Item[]::new)); - getOrCreateTagBuilder(UTags.BED_SHEETS).add(BedsheetsItem.ITEMS.values().stream().toArray(Item[]::new)); - getOrCreateTagBuilder(UTags.APPLE_SEEDS).add(UItems.GREEN_APPLE_SEEDS, UItems.SWEET_APPLE_SEEDS, UItems.SOUR_APPLE_SEEDS); - getOrCreateTagBuilder(UTags.MAGIC_FEATHERS).add(UItems.PEGASUS_FEATHER, UItems.GRYPHON_FEATHER); - getOrCreateTagBuilder(UTags.FRESH_APPLES).add(Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE); - getOrCreateTagBuilder(UTags.CLOUD_JARS).add(UItems.RAIN_CLOUD_JAR, UItems.STORM_CLOUD_JAR); - getOrCreateTagBuilder(UTags.PIES).add(UItems.APPLE_PIE, UItems.APPLE_PIE_HOOF); - - // technical tags - getOrCreateTagBuilder(ItemTags.VILLAGER_PLANTABLE_SEEDS).addTag(UTags.APPLE_SEEDS); - getOrCreateTagBuilder(UTags.CAN_CUT_PIE).forceAddTag(ConventionalItemTags.SHEARS).addOptionalTag(UConventionalTags.TOOL_KNIVES); - getOrCreateTagBuilder(UTags.COOLS_OFF_KIRINS).add(Items.MELON_SLICE, UItems.JUICE).forceAddTag(ConventionalItemTags.WATER_BUCKETS); - getOrCreateTagBuilder(UTags.FALLS_SLOWLY).add(Items.FEATHER, UItems.CLOUD_LUMP).forceAddTag(UTags.MAGIC_FEATHERS); - getOrCreateTagBuilder(UTags.IS_DELIVERED_AGGRESSIVELY).forceAddTag(ItemTags.ANVIL); - getOrCreateTagBuilder(UTags.SPOOKED_MOB_DROPS).add(Items.BRICK); - getOrCreateTagBuilder(UTags.SHADES).add( - Items.CARVED_PUMPKIN, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL, Items.PLAYER_HEAD, - Items.ZOMBIE_HEAD, Items.CREEPER_HEAD, Items.DRAGON_HEAD, Items.PIGLIN_HEAD, - UItems.SUNGLASSES - ); - getOrCreateTagBuilder(UTags.FLOATS_ON_CLOUDS) - .forceAddTag(UTags.Items.CLOUD_BEDS) - .forceAddTag(UTags.Items.CLOUD_SLABS) - .forceAddTag(UTags.Items.CLOUD_STAIRS) - .forceAddTag(UTags.Items.CLOUD_BLOCKS) - .add(UItems.CLOUD_LUMP); - getOrCreateTagBuilder(UTags.HAS_NO_TRAITS).add( - Items.AIR, Items.SPAWNER, Items.STRUCTURE_VOID, Items.STRUCTURE_BLOCK, - Items.COMMAND_BLOCK, Items.CHAIN_COMMAND_BLOCK, Items.REPEATING_COMMAND_BLOCK, - Items.LIGHT, Items.JIGSAW, Items.BARRIER, Items.BEDROCK, Items.END_PORTAL_FRAME, - Items.DEBUG_STICK, Items.COMMAND_BLOCK_MINECART, - UItems.PLUNDER_VINE - ).forceAddTag(UTags.BADGES); - getOrCreateTagBuilder(UTags.LOOT_BUG_HIGH_VALUE_DROPS).add( - Items.DIAMOND, Items.GOLDEN_APPLE, Items.GOLDEN_CARROT, - Items.GOLDEN_HELMET, Items.GOLDEN_BOOTS, Items.GOLDEN_LEGGINGS, Items.GOLDEN_CHESTPLATE, - Items.GOLDEN_HORSE_ARMOR, - Items.GOLDEN_PICKAXE, Items.GOLDEN_SHOVEL, Items.GOLDEN_AXE, Items.GOLDEN_SWORD, Items.GOLDEN_HOE, - UItems.GOLDEN_HORSE_SHOE, UItems.GOLDEN_POLEARM, UItems.GOLDEN_FEATHER, UItems.GOLDEN_WING, - UItems.GOLDEN_OAK_SEEDS - ).forceAddTag(ConventionalItemTags.NUGGETS) - .forceAddTag(ConventionalItemTags.GOLD_INGOTS).forceAddTag(ConventionalItemTags.RAW_GOLD_ORES).forceAddTag(ConventionalItemTags.RAW_GOLD_BLOCKS) - .addOptionalTag(new Identifier("farmersdelight:golden_knife")); - - exportFarmersDelightItems(); - } - - private void copyBlockTags() { - copy(BlockTags.LEAVES, ItemTags.LEAVES); - copy(BlockTags.LOGS_THAT_BURN, ItemTags.LOGS_THAT_BURN); - copy(BlockTags.LOGS, ItemTags.LOGS); - copy(BlockTags.PLANKS, ItemTags.PLANKS); - copy(BlockTags.WOODEN_BUTTONS, ItemTags.WOODEN_BUTTONS); - copy(BlockTags.WOODEN_DOORS, ItemTags.WOODEN_DOORS); - copy(BlockTags.FENCE_GATES, ItemTags.FENCE_GATES); - copy(BlockTags.WOODEN_FENCES, ItemTags.WOODEN_FENCES); - copy(BlockTags.WOODEN_PRESSURE_PLATES, ItemTags.WOODEN_PRESSURE_PLATES); - copy(BlockTags.SLABS, ItemTags.SLABS); - copy(BlockTags.WOODEN_SLABS, ItemTags.WOODEN_SLABS); - copy(BlockTags.STAIRS, ItemTags.STAIRS); - copy(BlockTags.WOODEN_STAIRS, ItemTags.WOODEN_STAIRS); - copy(BlockTags.TRAPDOORS, ItemTags.TRAPDOORS); - copy(BlockTags.WOODEN_TRAPDOORS, ItemTags.WOODEN_TRAPDOORS); - copy(BlockTags.SAPLINGS, ItemTags.SAPLINGS); - - copy(UTags.Blocks.ZAP_LOGS, UTags.Items.ZAP_LOGS); - copy(UTags.Blocks.WAXED_ZAP_LOGS, UTags.Items.WAXED_ZAP_LOGS); - copy(UTags.Blocks.PALM_LOGS, UTags.Items.PALM_LOGS); - copy(UTags.Blocks.CLOUD_BEDS, UTags.Items.CLOUD_BEDS); - copy(UTags.Blocks.CLOUD_SLABS, UTags.Items.CLOUD_SLABS); - copy(UTags.Blocks.CLOUD_STAIRS, UTags.Items.CLOUD_STAIRS); - copy(UTags.Blocks.CLOUD_BLOCKS, UTags.Items.CLOUD_BLOCKS); - copy(UTags.Blocks.CHITIN_BLOCKS, UTags.Items.CHITIN_BLOCKS); - } - - private void exportConventionalTags() { - getOrCreateTagBuilder(UConventionalTags.ACORNS).add(UItems.ACORN); - getOrCreateTagBuilder(UConventionalTags.APPLES) - .add(Items.APPLE, Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE, UItems.ROTTEN_APPLE) - .forceAddTag(UTags.FRESH_APPLES) - .addOptionalTag(new Identifier("c", "pyrite_apples")) // no idea which mod add pyrite apples - ; - getOrCreateTagBuilder(UConventionalTags.BANANAS).add(UItems.BANANA); - getOrCreateTagBuilder(UConventionalTags.COOKED_FISH).add(Items.COOKED_COD, Items.COOKED_SALMON); - getOrCreateTagBuilder(UConventionalTags.STICKS).add(Items.STICK); - getOrCreateTagBuilder(UConventionalTags.PINECONES).add(UItems.PINECONE); - getOrCreateTagBuilder(UConventionalTags.PINEAPPLES).add(UItems.PINEAPPLE); - getOrCreateTagBuilder(UConventionalTags.MANGOES).add(UItems.MANGO); - getOrCreateTagBuilder(UConventionalTags.MUSHROOMS).add(Items.RED_MUSHROOM, Items.BROWN_MUSHROOM); - getOrCreateTagBuilder(UConventionalTags.MUFFINS).add(UItems.MUFFIN); - getOrCreateTagBuilder(UConventionalTags.SEEDS).add(Items.BEETROOT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.TORCHFLOWER_SEEDS, Items.WHEAT_SEEDS) - .add(UItems.OAT_SEEDS) - .forceAddTag(UTags.APPLE_SEEDS); - getOrCreateTagBuilder(UConventionalTags.OEATMEALS).add(UItems.OATMEAL); - getOrCreateTagBuilder(UConventionalTags.GRAIN).add(Items.WHEAT, UItems.OATS); - getOrCreateTagBuilder(UConventionalTags.NUTS).addOptionalTag(UConventionalTags.CROPS_PEANUTS); - - getOrCreateTagBuilder(UConventionalTags.FRUITS) - .forceAddTag(UConventionalTags.MANGOES) - .forceAddTag(UConventionalTags.PINEAPPLES) - .forceAddTag(UConventionalTags.APPLES) - .forceAddTag(UConventionalTags.BANANAS); - } - - private void exportFarmersDelightItems() { - getOrCreateTagBuilder(UTags.COOLS_OFF_KIRINS) - .addOptional(new Identifier("farmersdelight:melon_popsicle")) - .addOptional(new Identifier("farmersdelight:melon_juice")); - getOrCreateTagBuilder(TagKey.of(RegistryKeys.ITEM, new Identifier("farmersdelight:cabbage_roll_ingredients"))).add(UItems.OATS, UItems.ROCK, UItems.WHEAT_WORMS); - getOrCreateTagBuilder(TagKey.of(RegistryKeys.ITEM, new Identifier("farmersdelight:comfort_foods"))).add(UItems.OATMEAL, UItems.ROCK_STEW, UItems.MUFFIN); - } -} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java index 64bbc4be..cc317eb5 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java @@ -19,6 +19,7 @@ import net.minecraft.item.Items; import net.minecraft.registry.Registries; import net.minecraft.data.client.ItemModelGenerator; import net.minecraft.data.client.ModelIds; +import net.minecraft.data.client.Models; import net.minecraft.data.client.TextureKey; import net.minecraft.data.client.TextureMap; @@ -57,21 +58,24 @@ public class UModelProvider extends FabricModelProvider { public void generateItemModels(ItemModelGenerator itemModelGenerator) { ItemModels.register(itemModelGenerator, UItems.ACORN, UItems.APPLE_PIE_HOOF, UItems.APPLE_PIE_SLICE, UItems.APPLE_PIE, - UItems.BANANA, UItems.BOTCHED_GEM, UItems.BROKEN_SUNGLASSES, UItems.BURNED_JUICE, UItems.BURNED_TOAST, - UItems.CARAPACE, UItems.CLAM_SHELL, UItems.COOKED_ZAP_APPLE, UItems.CLOUD_LUMP, UItems.CRISPY_HAY_FRIES, UItems.CRYSTAL_HEART, UItems.CRYSTAL_SHARD, + UItems.BANANA, UItems.BOTCHED_GEM, UItems.BOWL_OF_NUTS, UItems.BROKEN_SUNGLASSES, UItems.BURNED_JUICE, UItems.BURNED_TOAST, + UItems.CARAPACE, UItems.CLAM_SHELL, UItems.COOKED_ZAP_APPLE, UItems.CHOCOLATE_OATMEAL_COOKIE, + UItems.CLOUD_LUMP, UItems.CRISPY_HAY_FRIES, UItems.CRYSTAL_HEART, UItems.CRYSTAL_SHARD, + UItems.COOKED_TROPICAL_FISH, UItems.COOKED_PUFFERFISH, UItems.FRIED_AXOLOTL, UItems.DAFFODIL_DAISY_SANDWICH, UItems.DRAGON_BREATH_SCROLL, UItems.EMPTY_JAR, UItems.FRIENDSHIP_BRACELET, UItems.GIANT_BALLOON, UItems.GOLDEN_FEATHER, UItems.GOLDEN_OAK_SEEDS, UItems.GOLDEN_WING, UItems.GREEN_APPLE_SEEDS, UItems.GREEN_APPLE, UItems.GROGARS_BELL, - UItems.GRYPHON_FEATHER, + UItems.GRYPHON_FEATHER, UItems.GREEN_FRIED_EGG, UItems.HAY_BURGER, UItems.HAY_FRIES, UItems.HORSE_SHOE_FRIES, UItems.IMPORTED_OATS, UItems.JAM_TOAST, UItems.JUICE, UItems.LIGHTNING_JAR, UItems.MANGO, UItems.MUFFIN, - UItems.OATMEAL, - UItems.PEBBLES, UItems.PEGASUS_FEATHER, UItems.PINECONE, UItems.PINEAPPLE_CROWN, - UItems.RAIN_CLOUD_JAR, UItems.ROCK_STEW, UItems.ROCK, UItems.ROTTEN_APPLE, + UItems.OATMEAL, UItems.OATMEAL_COOKIE, UItems.SCONE, + UItems.PEBBLES, UItems.PEGASUS_FEATHER, UItems.PINECONE, UItems.PINECONE_COOKIE, UItems.PINEAPPLE_CROWN, + UItems.RAIN_CLOUD_JAR, UItems.ROCK_STEW, UItems.ROCK, + UItems.ROTTEN_APPLE, UItems.ROTTEN_COD, UItems.ROTTEN_TROPICAL_FISH, UItems.ROTTEN_SALMON, UItems.ROTTEN_PUFFERFISH, UItems.SALT_CUBE, UItems.SCALLOP_SHELL, UItems.SHELLY, UItems.SOUR_APPLE_SEEDS, UItems.SOUR_APPLE, UItems.SPELLBOOK, UItems.STORM_CLOUD_JAR, UItems.SWEET_APPLE_SEEDS, UItems.SWEET_APPLE, UItems.TOAST, UItems.TOM, UItems.TURRET_SHELL, @@ -105,7 +109,10 @@ public class UModelProvider extends FabricModelProvider { .put(TextureKey.LAYER1, ModelIds.getItemSubModelId(UItems.MAGIC_STAFF, "_magic")), itemModelGenerator.writer); // polearms - List.of(UItems.DIAMOND_POLEARM, UItems.GOLDEN_POLEARM, UItems.NETHERITE_POLEARM, UItems.STONE_POLEARM, UItems.WOODEN_POLEARM, UItems.IRON_POLEARM).forEach(item -> ItemModels.registerPolearm(itemModelGenerator, item)); + List.of( + UItems.DIAMOND_POLEARM, UItems.GOLDEN_POLEARM, UItems.NETHERITE_POLEARM, + UItems.STONE_POLEARM, UItems.WOODEN_POLEARM, UItems.IRON_POLEARM + ).forEach(item -> ItemModels.registerPolearm(itemModelGenerator, item)); // sheets ItemModels.register(itemModelGenerator, BedsheetsItem.ITEMS.values().stream().toArray(Item[]::new)); // badges @@ -133,5 +140,8 @@ public class UModelProvider extends FabricModelProvider { .addOverride(ModelIds.getItemSubModelId(UItems.GEMSTONE, "_pure"), "affinity", 0) .addOverride(ModelIds.getItemSubModelId(UItems.GEMSTONE, "_corrupted"), "affinity", 1) .upload(UItems.GEMSTONE, itemModelGenerator); + + // fishing rod + ItemModels.register(itemModelGenerator, Models.HANDHELD_ROD, UItems.BAITED_FISHING_ROD); } } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/URecipeProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/URecipeProvider.java deleted file mode 100644 index e47ccbdc..00000000 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/URecipeProvider.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.minelittlepony.unicopia.datagen.providers; - -import java.util.Arrays; -import java.util.NoSuchElementException; -import com.minelittlepony.unicopia.UTags; -import com.minelittlepony.unicopia.block.UBlocks; -import com.minelittlepony.unicopia.datagen.ItemFamilies; -import com.minelittlepony.unicopia.datagen.UBlockFamilies; -import com.minelittlepony.unicopia.item.UItems; - -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; -import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; -import net.minecraft.block.Block; -import net.minecraft.data.server.recipe.RecipeExporter; -import net.minecraft.data.server.recipe.RecipeProvider; -import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder; -import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder; -import net.minecraft.data.server.recipe.VanillaRecipeProvider; -import net.minecraft.item.Item; -import net.minecraft.item.ItemConvertible; -import net.minecraft.item.Items; -import net.minecraft.recipe.book.RecipeCategory; -import net.minecraft.registry.Registries; -import net.minecraft.resource.featuretoggle.FeatureSet; -import net.minecraft.util.Identifier; - -public class URecipeProvider extends FabricRecipeProvider { - public URecipeProvider(FabricDataOutput output) { - super(output); - } - - @Override - public void generate(RecipeExporter exporter) { - Arrays.stream(ItemFamilies.BASKETS).forEach(basket -> { - offerBasketRecipe(exporter, basket, getMaterial(basket, "_basket", "_planks")); - }); - - offerBoatRecipe(exporter, UItems.PALM_BOAT, UBlocks.PALM_PLANKS); - offerChestBoatRecipe(exporter, UItems.PALM_CHEST_BOAT, UItems.PALM_BOAT); - offerHangingSignRecipe(exporter, UBlocks.PALM_HANGING_SIGN, UBlocks.PALM_PLANKS); - offerPlanksRecipe(exporter, UBlocks.PALM_PLANKS, UTags.Items.PALM_LOGS, 4); - offerPlanksRecipe(exporter, UBlocks.ZAP_PLANKS, UTags.Items.ZAP_LOGS, 4); - offerPlanksRecipe(exporter, UBlocks.WAXED_ZAP_PLANKS, UTags.Items.WAXED_ZAP_LOGS, 4); - offerBarkBlockRecipe(exporter, UBlocks.PALM_WOOD, UBlocks.PALM_LOG); - offerBarkBlockRecipe(exporter, UBlocks.ZAP_WOOD, UBlocks.ZAP_LOG); - offerBarkBlockRecipe(exporter, UBlocks.WAXED_ZAP_WOOD, UBlocks.WAXED_ZAP_LOG); - - generateFamily(exporter, UBlockFamilies.PALM, FeatureSet.empty()); - generateFamily(exporter, UBlockFamilies.ZAP, FeatureSet.empty()); - generateFamily(exporter, UBlockFamilies.WAXED_ZAP, FeatureSet.empty()); - offerWaxingRecipes(exporter); - } - - private static Item getMaterial(Item output, String toStrip, String suffex) { - Identifier id = Registries.ITEM.getId(output).withPath(p -> p.replace(toStrip, "") + suffex); - return Registries.ITEM.getOrEmpty(id) - .or(() -> Registries.ITEM.getOrEmpty(new Identifier(Identifier.DEFAULT_NAMESPACE, id.getPath()))) - .orElseThrow(() -> new NoSuchElementException("No item with id " + id)); - } - - public static void offerBasketRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input) { - ShapedRecipeJsonBuilder.create(RecipeCategory.TRANSPORTATION, output) - .input(Character.valueOf('#'), input) - .pattern("# #") - .pattern("# #") - .pattern("###") - .group("basket") - .criterion(VanillaRecipeProvider.hasItem(input), VanillaRecipeProvider.conditionsFromItem(input)) - .offerTo(exporter); - } - - public static void offerWaxingRecipes(RecipeExporter exporter) { - UBlockFamilies.WAXED_ZAP.getVariants().forEach((variant, output) -> { - Block input = UBlockFamilies.ZAP.getVariant(variant); - offerWaxingRecipe(exporter, output, input); - }); - offerWaxingRecipe(exporter, UBlocks.WAXED_ZAP_PLANKS, UBlocks.ZAP_PLANKS); - offerWaxingRecipe(exporter, UBlocks.WAXED_ZAP_WOOD, UBlocks.ZAP_WOOD); - } - - public static void offerWaxingRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input) { - ShapelessRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, output) - .input(input) - .input(Items.HONEYCOMB).group(RecipeProvider.getItemPath(output)) - .criterion(RecipeProvider.hasItem(input), RecipeProvider.conditionsFromItem(input)) - .offerTo(exporter, RecipeProvider.convertBetween(output, Items.HONEYCOMB)); - } -} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java index 8484965c..08287291 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java @@ -2,6 +2,7 @@ package com.minelittlepony.unicopia.datagen.providers.loot; import java.util.function.Function; +import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.item.enchantment.UEnchantments; @@ -11,22 +12,27 @@ import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.data.server.loottable.BlockLootTableGenerator; import net.minecraft.enchantment.Enchantments; +import net.minecraft.item.ItemConvertible; import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTable; +import net.minecraft.loot.condition.LocationCheckLootCondition; import net.minecraft.loot.condition.LootCondition; import net.minecraft.loot.condition.MatchToolLootCondition; import net.minecraft.loot.condition.RandomChanceLootCondition; import net.minecraft.loot.condition.TableBonusLootCondition; import net.minecraft.loot.entry.ItemEntry; import net.minecraft.loot.entry.LootPoolEntry; +import net.minecraft.loot.entry.TagEntry; import net.minecraft.loot.function.ApplyBonusLootFunction; import net.minecraft.loot.function.SetCountLootFunction; import net.minecraft.loot.provider.number.ConstantLootNumberProvider; import net.minecraft.loot.provider.number.UniformLootNumberProvider; import net.minecraft.predicate.NumberRange; +import net.minecraft.predicate.entity.LocationPredicate; import net.minecraft.predicate.item.EnchantmentPredicate; import net.minecraft.predicate.item.ItemPredicate; import net.minecraft.util.Identifier; +import net.minecraft.world.biome.BiomeKeys; public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvider { public static final LootCondition.Builder WITH_GEM_FINDER = MatchToolLootCondition.builder(ItemPredicate.Builder.create().enchantment(new EnchantmentPredicate(UEnchantments.GEM_FINDER, NumberRange.IntRange.atLeast(1)))); @@ -34,6 +40,10 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid public static final LootCondition.Builder WITHOUT_SILK_TOUCH_AND_GEM_FINDER = WITHOUT_SILK_TOUCH.and(WITH_GEM_FINDER); public static final float[] GEMSTONES_FORTUNE_CHANCE = { 0.1F, 0.14285715F, 0.25F, 1F }; + public static final LootCondition.Builder NEEDS_OCEAN_OR_BEACH_BIOME = + LocationCheckLootCondition.builder(LocationPredicate.Builder.create().biome(BiomeKeys.OCEAN)) + .or(LocationCheckLootCondition.builder(LocationPredicate.Builder.create().biome(BiomeKeys.BEACH))); + public UBlockAdditionsLootTableProvider(FabricDataOutput dataOutput) { super(dataOutput); } @@ -54,18 +64,42 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid addVanillaDrop(Blocks.PODZOL, block -> wormDrops(block, 4, 0.06F, 0.062222223F, 0.065F, 0.077777776F, 0.2F)); addVanillaDrop(Blocks.DIAMOND_ORE, this::crystalShardDrops); addVanillaDrop(Blocks.DEEPSLATE_DIAMOND_ORE, this::crystalShardDrops); + addVanillaDrop(Blocks.OAK_LEAVES, block -> chanceDropWithShears(block, UItems.ACORN, GEMSTONES_FORTUNE_CHANCE)); + addVanillaDrop(Blocks.SPRUCE_LEAVES, block -> chanceDropWithShears(block, UItems.PINECONE, GEMSTONES_FORTUNE_CHANCE)); + addVanillaDrop(Blocks.GRAVEL, this::shellDrops); + addVanillaDrop(Blocks.SUSPICIOUS_GRAVEL, this::shellDrops); } private void addVanillaDrop(Block block, Function lootTableFunction) { lootTables.put(new Identifier("unicopiamc", block.getLootTableId().getPath()), lootTableFunction.apply(block)); } + public LootTable.Builder shellDrops(Block block) { + return LootTable.builder().pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(1)) + .conditionally(WITHOUT_SILK_TOUCH.and(NEEDS_OCEAN_OR_BEACH_BIOME)) + .with(applyExplosionDecay(block, TagEntry.builder(UTags.Items.SHELLS) + .apply(SetCountLootFunction.builder(ConstantLootNumberProvider.create(1))) + ) + .conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, GEMSTONES_FORTUNE_CHANCE))) + ); + } + + public LootTable.Builder chanceDropWithShears(Block block, ItemConvertible drop, float...chance) { + return LootTable.builder() + .pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(1)) + .conditionally(WITHOUT_SILK_TOUCH.and(WITH_SHEARS)) + .with(chanceDrops(block, drop, 1, chance)) + ); + } + public LootTable.Builder wormDrops(Block block, int max, float...chance) { return LootTable.builder() .pool(LootPool.builder() .rolls(ConstantLootNumberProvider.create(1)) .conditionally(WITHOUT_SILK_TOUCH) - .with(wheatwormDrops(block, max, chance)) + .with(chanceDrops(block, UItems.WHEAT_WORMS, max, chance)) ); } @@ -75,7 +109,7 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid .rolls(ConstantLootNumberProvider.create(1)) .conditionally(WITHOUT_SILK_TOUCH) .with(gemstoneDrops(block, 0.1F)) - .with(wheatwormDrops(block, max, chance)) + .with(chanceDrops(block, UItems.WHEAT_WORMS, max, chance)) ); } @@ -111,16 +145,14 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid .conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, GEMSTONES_FORTUNE_CHANCE)); } - public LootPoolEntry.Builder wheatwormDrops(Block block, int max, float...chance) { - return applyExplosionDecay(block, ItemEntry.builder(UItems.WHEAT_WORMS) + public LootPoolEntry.Builder chanceDrops(Block block, ItemConvertible drop, int max, float...chance) { + return applyExplosionDecay(block, ItemEntry.builder(drop) .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, max))) ) .conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, chance)); } - public static LootTable.Builder dropsWithGemfinding(Block drop, LootPoolEntry.Builder child) { return BlockLootTableGenerator.drops(drop, WITHOUT_SILK_TOUCH_AND_GEM_FINDER, child); } - } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockLootTableProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockLootTableProvider.java index 34db9593..9c625a1d 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockLootTableProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockLootTableProvider.java @@ -1,7 +1,17 @@ package com.minelittlepony.unicopia.datagen.providers.loot; import java.util.List; + +import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.block.EdibleBlock; +import com.minelittlepony.unicopia.block.EnchantedFruitBlock; +import com.minelittlepony.unicopia.block.PieBlock; +import com.minelittlepony.unicopia.block.PileBlock; +import com.minelittlepony.unicopia.block.SegmentedCropBlock; +import com.minelittlepony.unicopia.block.ShellsBlock; +import com.minelittlepony.unicopia.block.SlimePustuleBlock; import com.minelittlepony.unicopia.block.UBlocks; +import com.minelittlepony.unicopia.datagen.Datagen; import com.minelittlepony.unicopia.datagen.providers.UModelProvider; import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.server.world.Tree; @@ -9,22 +19,44 @@ import com.minelittlepony.unicopia.server.world.UTreeGen; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; +import net.fabricmc.fabric.api.resource.conditions.v1.DefaultResourceConditions; import net.minecraft.block.BedBlock; import net.minecraft.block.Block; import net.minecraft.block.Blocks; +import net.minecraft.block.CarrotsBlock; +import net.minecraft.block.SlabBlock; import net.minecraft.block.enums.BedPart; +import net.minecraft.block.enums.BlockHalf; +import net.minecraft.block.enums.SlabType; import net.minecraft.enchantment.Enchantments; +import net.minecraft.item.Item; +import net.minecraft.item.ItemConvertible; import net.minecraft.item.Items; import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTable; +import net.minecraft.loot.condition.BlockStatePropertyLootCondition; +import net.minecraft.loot.condition.LootConditionConsumingBuilder; +import net.minecraft.loot.condition.RandomChanceLootCondition; import net.minecraft.loot.condition.TableBonusLootCondition; import net.minecraft.loot.entry.ItemEntry; +import net.minecraft.loot.function.ApplyBonusLootFunction; +import net.minecraft.loot.function.ConditionalLootFunction; import net.minecraft.loot.function.SetCountLootFunction; import net.minecraft.loot.provider.number.ConstantLootNumberProvider; +import net.minecraft.loot.provider.number.LootNumberProvider; import net.minecraft.loot.provider.number.UniformLootNumberProvider; +import net.minecraft.predicate.StatePredicate; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.IntProperty; +import net.minecraft.state.property.Properties; +import net.minecraft.state.property.Property; +import net.minecraft.util.Identifier; +import net.minecraft.util.StringIdentifiable; public class UBlockLootTableProvider extends FabricBlockLootTableProvider { + private static final ConditionalLootFunction.Builder FORTUNE_BONUS = ApplyBonusLootFunction.binomialWithBonusCount(Enchantments.FORTUNE, 0.5714286F, 3); + public UBlockLootTableProvider(FabricDataOutput output) { super(output); } @@ -54,7 +86,8 @@ public class UBlockLootTableProvider extends FabricBlockLootTableProvider { UBlocks.WEATHER_VANE, UBlocks.ZAP_FENCE_GATE, UBlocks.ZAP_FENCE, - UBlocks.ZAP_LOG, UBlocks.ZAP_PLANKS, UBlocks.ZAP_STAIRS, UBlocks.ZAP_WOOD + UBlocks.ZAP_LOG, UBlocks.ZAP_PLANKS, UBlocks.ZAP_STAIRS, UBlocks.ZAP_WOOD, + UBlocks.WORM_BLOCK ).forEach(this::addDrop); // slabs @@ -62,13 +95,22 @@ public class UBlockLootTableProvider extends FabricBlockLootTableProvider { UBlocks.CHISELLED_CHITIN_SLAB, UBlocks.CLOUD_BRICK_SLAB, UBlocks.CLOUD_PLANK_SLAB, UBlocks.PALM_SLAB, UBlocks.ZAP_SLAB, UBlocks.WAXED_ZAP_SLAB ).forEach(slab -> addDrop(slab, this::slabDrops)); + addDrop(UBlocks.CLOUD_SLAB, slab -> decomposingSlabDrops(slab, UItems.CLOUD_LUMP, 2)); + addDrop(UBlocks.SOGGY_CLOUD_SLAB, slab -> decomposingSlabDrops(slab, UItems.CLOUD_LUMP, 2)); + addDrop(UBlocks.DENSE_CLOUD_SLAB, slab -> decomposingSlabDrops(slab, UItems.CLOUD_LUMP, 4)); + addDrop(UBlocks.ETCHED_CLOUD_SLAB, slab -> decomposingSlabDrops(slab, UItems.CLOUD_LUMP, 4)); // fruit UModelProvider.FRUITS.forEach((block, drop) -> { if (block != UBlocks.GOLDEN_APPLE) { - addDrop(block, drop); + addDrop(block, fortuneBonusDrops(drop)); } }); + addDrop(UBlocks.GOLDEN_APPLE, LootTable.builder().pool(LootPool.builder() + .rolls(exactly(1)) + .with(applyStateCondition(UBlocks.GOLDEN_APPLE, EnchantedFruitBlock.ENCHANTED, false, applyExplosionDecay(UBlocks.GOLDEN_APPLE, ItemEntry.builder(Items.GOLDEN_APPLE))).apply(FORTUNE_BONUS)) + .with(applyStateCondition(UBlocks.GOLDEN_APPLE, EnchantedFruitBlock.ENCHANTED, true, applyExplosionDecay(UBlocks.GOLDEN_APPLE, ItemEntry.builder(Items.ENCHANTED_GOLDEN_APPLE))).apply(FORTUNE_BONUS)) + )); List.of(UBlocks.GREEN_APPLE_LEAVES, UBlocks.SOUR_APPLE_LEAVES, UBlocks.SWEET_APPLE_LEAVES, UBlocks.GOLDEN_OAK_LEAVES).forEach(block -> addDrop(block, this::fruitLeavesDrops)); addDrop(UBlocks.MANGO_LEAVES, block -> leavesDrops(block, UTreeGen.MANGO_TREE.sapling().get(), 0.025F, 0.027777778F, 0.03125F, 0.041666668F, 0.1F)); // same chance as jungle addDrop(UBlocks.ZAP_LEAVES, block -> leavesDrops(block, UTreeGen.ZAP_APPLE_TREE.sapling().get(), SAPLING_DROP_CHANCE)); @@ -80,6 +122,11 @@ public class UBlockLootTableProvider extends FabricBlockLootTableProvider { tree.pot().ifPresent(this::addPottedPlantDrops); }); + // jars + List.of( + UBlocks.JAR, UBlocks.CLOUD_JAR, UBlocks.STORM_JAR, UBlocks.LIGHTNING_JAR, UBlocks.STORM_JAR + ).forEach(jar -> addDrop(jar, UBlockLootTableProvider::dropsWithSilkTouch)); + // doors List.of( UBlocks.CLOUD_DOOR, UBlocks.CRYSTAL_DOOR, @@ -91,42 +138,197 @@ public class UBlockLootTableProvider extends FabricBlockLootTableProvider { UBlocks.CLOUD_BED, UBlocks.CLOTH_BED ).forEach(bed -> addDrop(bed, b -> dropsWithProperty(b, BedBlock.PART, BedPart.HEAD))); - addDrop(UBlocks.CHITIN_SPIKES, drops(UBlocks.CHITIN_SPIKES, UItems.CARAPACE, ConstantLootNumberProvider.create(6))); - addDrop(UBlocks.CHITIN, drops(UBlocks.CHITIN, UItems.CARAPACE, ConstantLootNumberProvider.create(9))); - addDrop(UBlocks.SURFACE_CHITIN, drops(UBlocks.SURFACE_CHITIN, UItems.CARAPACE, ConstantLootNumberProvider.create(9))); + addDrop(UBlocks.CHITIN_SPIKES, drops(UBlocks.CHITIN_SPIKES, UItems.CARAPACE, exactly(6))); + addDrop(UBlocks.CHITIN, drops(UBlocks.CHITIN, UItems.CARAPACE, exactly(9))); + addDrop(UBlocks.SURFACE_CHITIN, drops(UBlocks.SURFACE_CHITIN, UItems.CARAPACE, exactly(9))); + addDrop(UBlocks.CHISELLED_CHITIN_HULL, hullDrops(UBlocks.CHISELLED_CHITIN_HULL, UBlocks.CHITIN, UBlocks.CHISELLED_CHITIN)); - addDrop(UBlocks.CLOUD, drops(UBlocks.CLOUD, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(4))); - addDrop(UBlocks.CLOUD_STAIRS, drops(UBlocks.CLOUD_STAIRS, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(6))); + addDrop(UBlocks.SLIME_PUSTULE, LootTable.builder() + .pool(applyStateCondition(UBlocks.SLIME_PUSTULE, SlimePustuleBlock.SHAPE, SlimePustuleBlock.Shape.POD, + addSurvivesExplosionCondition(UBlocks.SLIME_PUSTULE, LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(UBlocks.SLIME_PUSTULE)).conditionally(WITH_SILK_TOUCH_OR_SHEARS)) + ))); + addDrop(UBlocks.MYSTERIOUS_EGG, LootTable.builder() + .pool(addSurvivesExplosionCondition(UBlocks.MYSTERIOUS_EGG, LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(UBlocks.MYSTERIOUS_EGG)) + .apply(PileBlock.COUNT.getValues(), count -> applyStateCondition(UBlocks.MYSTERIOUS_EGG, PileBlock.COUNT, count, SetCountLootFunction.builder(exactly(count))))))); - addDrop(UBlocks.SOGGY_CLOUD, drops(UBlocks.CLOUD, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(4))); - addDrop(UBlocks.SOGGY_CLOUD_STAIRS, drops(UBlocks.CLOUD_STAIRS, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(6))); + addDrop(UBlocks.CLOUD, drops(UBlocks.CLOUD, UItems.CLOUD_LUMP, exactly(4))); + addDrop(UBlocks.CLOUD_STAIRS, drops(UBlocks.CLOUD_STAIRS, UItems.CLOUD_LUMP, exactly(6))); - addDrop(UBlocks.DENSE_CLOUD, drops(UBlocks.DENSE_CLOUD, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(9))); - addDrop(UBlocks.DENSE_CLOUD_STAIRS, drops(UBlocks.DENSE_CLOUD_STAIRS, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(13))); - addDrop(UBlocks.ETCHED_CLOUD, drops(UBlocks.ETCHED_CLOUD, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(9))); - addDrop(UBlocks.ETCHED_CLOUD_STAIRS, drops(UBlocks.ETCHED_CLOUD_STAIRS, UItems.CLOUD_LUMP, ConstantLootNumberProvider.create(13))); + addDrop(UBlocks.SOGGY_CLOUD, drops(UBlocks.CLOUD, UItems.CLOUD_LUMP, exactly(4))); + addDrop(UBlocks.SOGGY_CLOUD_STAIRS, drops(UBlocks.CLOUD_STAIRS, UItems.CLOUD_LUMP, exactly(6))); - addDrop(UBlocks.CLOUD_PILLAR, drops(UBlocks.CLOUD_PILLAR, UBlocks.CLOUD, ConstantLootNumberProvider.create(6))); + addDrop(UBlocks.DENSE_CLOUD, drops(UBlocks.DENSE_CLOUD, UItems.CLOUD_LUMP, exactly(9))); + addDrop(UBlocks.DENSE_CLOUD_STAIRS, drops(UBlocks.DENSE_CLOUD_STAIRS, UItems.CLOUD_LUMP, exactly(13))); + addDrop(UBlocks.ETCHED_CLOUD, drops(UBlocks.ETCHED_CLOUD, UItems.CLOUD_LUMP, exactly(9))); + addDrop(UBlocks.ETCHED_CLOUD_STAIRS, drops(UBlocks.ETCHED_CLOUD_STAIRS, UItems.CLOUD_LUMP, exactly(13))); + + // recipe produces: 6 blocks -> 3 pillars means: 6/3 = 2 + addDrop(UBlocks.CLOUD_PILLAR, drops(UBlocks.CLOUD_PILLAR, UBlocks.CLOUD, exactly(2))); addDrop(UBlocks.FROSTED_OBSIDIAN, Blocks.OBSIDIAN); + addDrop(UBlocks.APPLE_PIE, pieDrops(UBlocks.APPLE_PIE, UItems.APPLE_PIE, UItems.APPLE_PIE_HOOF)); + + // crops + addTallCropDrops(UBlocks.OATS, UItems.OATS); + addDrop(UBlocks.BANANAS, LootTable.builder() + .pool(addSurvivesExplosionCondition(UBlocks.BANANAS, LootPool.builder() + .rolls(exactly(1)) + .with(item(UItems.BANANA, between(6, 12F)).apply(FORTUNE_BONUS)) + ))); + addDrop(UBlocks.PINEAPPLE, LootTable.builder() + .pool(addSurvivesExplosionCondition(UBlocks.PINEAPPLE, LootPool.builder() + .rolls(exactly(1)) + .with(item(UItems.PINEAPPLE, between(6, 12F)) + .apply(FORTUNE_BONUS) + .conditionally(BlockStatePropertyLootCondition.builder(UBlocks.PINEAPPLE).properties(StatePredicate.Builder.create() + .exactMatch(Properties.BLOCK_HALF, BlockHalf.TOP) + .exactMatch(Properties.AGE_7, Properties.AGE_7_MAX)))) + ))); + addDrop(UBlocks.ROCKS, applyExplosionDecay(UBlocks.ROCKS, LootTable.builder() + .pool(applyStateCondition(UBlocks.ROCKS, Properties.AGE_7, Properties.AGE_7_MAX, LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(UItems.WEIRD_ROCK).conditionally(RandomChanceLootCondition.builder(0.25F)).apply(FORTUNE_BONUS)) + .with(ItemEntry.builder(UItems.ROCK).apply(FORTUNE_BONUS)))) + .pool(LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(UItems.PEBBLES))) + )); + addDrop(UBlocks.GOLD_ROOT, applyExplosionDecay(UBlocks.GOLD_ROOT, LootTable.builder() + .pool(LootPool.builder().with(ItemEntry.builder(Items.GOLDEN_CARROT))) + .pool(applyStateCondition(UBlocks.GOLD_ROOT, CarrotsBlock.AGE, 7, LootPool.builder()) + .with(ItemEntry.builder(Items.GOLDEN_CARROT).apply(FORTUNE_BONUS))))); + addDrop(UBlocks.PLUNDER_VINE, applyExplosionDecay(UBlocks.PLUNDER_VINE, LootTable.builder() + .pool(LootPool.builder().rolls(exactly(4)) + .with(ItemEntry.builder(Items.STICK)) + .with(ItemEntry.builder(Items.DEAD_BUSH))) + .pool(LootPool.builder().rolls(exactly(1)) + .with(ItemEntry.builder(Items.STICK)) + .with(ItemEntry.builder(Items.DEAD_BUSH)) + .with(ItemEntry.builder(UItems.GRYPHON_FEATHER))) + )); + + // hay + addDrop(UBlocks.HAY_BLOCK, b -> edibleBlockDrops(b, Items.WHEAT)); + + // shells + addDrop(UBlocks.CLAM_SHELL, shellDrops(UBlocks.CLAM_SHELL, UItems.CLAM_SHELL)); + addDrop(UBlocks.SCALLOP_SHELL, shellDrops(UBlocks.SCALLOP_SHELL, UItems.SCALLOP_SHELL)); + addDrop(UBlocks.TURRET_SHELL, shellDrops(UBlocks.TURRET_SHELL, UItems.TURRET_SHELL)); + + var farmersDelightGenerator = withConditions(DefaultResourceConditions.allModsLoaded("farmersdelight")); + farmersDelightGenerator.addDrop(Datagen.getOrCreateBaleBlock(Unicopia.id("rice_block")), b -> edibleBlockDrops(b, Datagen.getOrCreateItem(new Identifier("farmersdelight", "rice_panicle")))); + farmersDelightGenerator.addDrop(Datagen.getOrCreateBaleBlock(Unicopia.id("straw_block")), b -> edibleBlockDrops(b, Datagen.getOrCreateItem(new Identifier("farmersdelight", "straw")))); + } + + private void addTallCropDrops(SegmentedCropBlock baseCrop, ItemConvertible crop) { + addDrop(baseCrop, applyExplosionDecay(baseCrop, LootTable.builder() + .pool(LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(baseCrop.getSeedsItem())))) + .pool(applyStateCondition(baseCrop, baseCrop.getAgeProperty(), baseCrop.getMaxAge(), LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(baseCrop.getSeedsItem()).apply(FORTUNE_BONUS))))); + + SegmentedCropBlock stage = baseCrop; + while ((stage = stage.getNext()) != null) { + addDrop(stage, applyExplosionDecay(stage, LootTable.builder() + .pool(LootPool.builder() + .rolls(exactly(1)) + .with(applyStateCondition(stage, stage.getAgeProperty(), stage.getMaxAge(), ItemEntry.builder(crop)))))); + } + } + + private LootTable.Builder decomposingSlabDrops(Block slab, ItemConvertible drop, int count) { + return LootTable.builder() + .pool(applyExplosionDecay(slab, LootPool.builder() + .rolls(exactly(1)) + .with(item(drop, exactly(count)) + .apply(applyStateCondition(slab, SlabBlock.TYPE, SlabType.DOUBLE, SetCountLootFunction.builder(exactly(count * 2))))))); } private LootTable.Builder fruitLeavesDrops(Block leaves) { return LootTable.builder() .pool(LootPool.builder() - .rolls(ConstantLootNumberProvider.create(1)) - .with(ItemEntry.builder(leaves).conditionally(WITH_SILK_TOUCH_OR_SHEARS)) - ) - .pool(LootPool.builder() - .rolls(ConstantLootNumberProvider.create(1)) - .conditionally(WITHOUT_SILK_TOUCH_NOR_SHEARS) - .with( - applyExplosionDecay(leaves, ItemEntry.builder(Items.STICK) - .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, 2))) - ) - .conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, LEAVES_STICK_DROP_CHANCE)) - ) - ); + .rolls(exactly(1)) + .with(ItemEntry.builder(leaves).conditionally(WITH_SILK_TOUCH_OR_SHEARS))) + .pool(applyExplosionDecay(leaves, LootPool.builder() + .rolls(exactly(1)) + .conditionally(WITHOUT_SILK_TOUCH_NOR_SHEARS) + .with(item(Items.STICK, between(1, 2)).conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, LEAVES_STICK_DROP_CHANCE))))); } + private LootTable.Builder hullDrops(Block hull, ItemConvertible inner, ItemConvertible outer) { + return LootTable.builder() + .pool(addSurvivesExplosionCondition(hull, LootPool.builder() + .rolls(exactly(1)) + .with(item(hull, exactly(2)).conditionally(WITHOUT_SILK_TOUCH)) + .with(item(inner, exactly(2)).conditionally(WITHOUT_SILK_TOUCH)) + .with(item(outer, exactly(2)).conditionally(WITH_SILK_TOUCH)))); + } + + private LootTable.Builder edibleBlockDrops(Block block, ItemConvertible drop) { + LootTable.Builder builder = LootTable.builder(); + for (BooleanProperty segment : EdibleBlock.SEGMENTS) { + builder + .pool(addSurvivesExplosionCondition(block, LootPool.builder() + .rolls(exactly(1)) + .with(applyStateCondition(block, segment, true, ItemEntry.builder(drop))))); + } + return builder; + } + + private LootTable.Builder pieDrops(Block block, Item drop, Item stomped) { + return LootTable.builder() + .pool(applyExplosionDecay(block, LootPool.builder() + .rolls(exactly(1)).conditionally(WITH_SILK_TOUCH) + .with(applyStateCondition(block, PieBlock.STOMPED, false, ItemEntry.builder(drop))) + .with(applyStateCondition(block, PieBlock.STOMPED, true, ItemEntry.builder(stomped))))); + } + + private LootTable.Builder shellDrops(Block block, Item shell) { + return LootTable.builder() + .pool(applyExplosionDecay(block, LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(shell)) + .apply(ShellsBlock.COUNT.getValues(), count -> applyStateCondition(block, ShellsBlock.COUNT, count, SetCountLootFunction.builder(exactly(count)))) + .apply(FORTUNE_BONUS))); + } + + + public LootTable.Builder fortuneBonusDrops(ItemConvertible drop) { + return LootTable.builder().pool(addSurvivesExplosionCondition(drop, LootPool.builder() + .rolls(exactly(1)) + .with(ItemEntry.builder(drop).apply(FORTUNE_BONUS)))); + } + + public static ConstantLootNumberProvider exactly(float n) { + return ConstantLootNumberProvider.create(n); + } + + public static UniformLootNumberProvider between(float from, float to) { + return UniformLootNumberProvider.create(from, to); + } + + public static ItemEntry.Builder item(ItemConvertible item, LootNumberProvider count) { + return ItemEntry.builder(item).apply(SetCountLootFunction.builder(count)); + } + + public static , P extends Comparable

& StringIdentifiable> T applyStateCondition(Block block, + Property

property, P value, LootConditionConsumingBuilder builder) { + return builder.conditionally(BlockStatePropertyLootCondition.builder(block).properties(StatePredicate.Builder.create().exactMatch(property, value))); + } + + public static > T applyStateCondition(Block block, + BooleanProperty property, boolean value, LootConditionConsumingBuilder builder) { + return builder.conditionally(BlockStatePropertyLootCondition.builder(block).properties(StatePredicate.Builder.create().exactMatch(property, value))); + } + + public static > T applyStateCondition(Block block, + IntProperty property, int value, LootConditionConsumingBuilder builder) { + return builder.conditionally(BlockStatePropertyLootCondition.builder(block).properties(StatePredicate.Builder.create().exactMatch(property, value))); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java index 72ad8a91..0d6beac9 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java @@ -2,6 +2,7 @@ package com.minelittlepony.unicopia.datagen.providers.loot; import java.util.function.BiConsumer; +import com.minelittlepony.unicopia.UConventionalTags; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.item.UItems; @@ -24,6 +25,10 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi super(dataOutput, LootContextTypes.CHEST); } + @Override + public String getName() { + return super.getName() + " Additions"; + } @Override public void accept(BiConsumer exporter) { @@ -39,7 +44,7 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi .rolls(UniformLootNumberProvider.create(2, 4)) .with(ItemEntry.builder(UItems.GRYPHON_FEATHER).weight(10).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, 7)))) .with(ItemEntry.builder(UItems.GOLDEN_WING).weight(1).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, 2)))) - .with(TagEntry.expandBuilder(UTags.FRESH_APPLES).weight(1).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(2, 5)))) + .with(TagEntry.expandBuilder(UTags.Items.FRESH_APPLES).weight(1).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(2, 5)))) )); exporter.accept(LootTables.VILLAGE_FLETCHER_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(2, 4)) @@ -48,37 +53,42 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi )); exporter.accept(LootTables.VILLAGE_PLAINS_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(3, 4)) - .with(TagEntry.expandBuilder(UTags.FRESH_APPLES).weight(1)) - .with(TagEntry.expandBuilder(UTags.APPLE_SEEDS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.FRESH_APPLES).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.APPLE_SEEDS).weight(1)) )); exporter.accept(LootTables.ANCIENT_CITY_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(0, 1)) .with(ItemEntry.builder(UItems.GROGARS_BELL).weight(1)) )); + exporter.accept(LootTables.BURIED_TREASURE_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) - .with(TagEntry.expandBuilder(UTags.item("food_types/shells")).weight(3)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(3)) )); exporter.accept(LootTables.SHIPWRECK_SUPPLY_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 6)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(3)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(3)) + .with(TagEntry.expandBuilder(UConventionalTags.Items.ROTTEN_FISH).weight(1)) )); exporter.accept(LootTables.SHIPWRECK_TREASURE_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(3)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(3)) + .with(TagEntry.expandBuilder(UConventionalTags.Items.ROTTEN_FISH).weight(1)) )); exporter.accept(LootTables.UNDERWATER_RUIN_BIG_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 2)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) .with(ItemEntry.builder(UItems.SHELLY).weight(4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(8)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(8)) + .with(TagEntry.expandBuilder(UConventionalTags.Items.ROTTEN_FISH).weight(1)) )); exporter.accept(LootTables.UNDERWATER_RUIN_SMALL_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(1)) + .with(TagEntry.expandBuilder(UConventionalTags.Items.ROTTEN_FISH).weight(1)) )); exporter.accept(LootTables.DESERT_WELL_ARCHAEOLOGY, LootTable.builder().pool(LootPool.builder() @@ -89,7 +99,7 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi .with(ItemEntry.builder(UItems.ROCK_STEW).weight(1)) .with(ItemEntry.builder(UItems.PEBBLES).weight(1)) .with(ItemEntry.builder(UItems.SHELLY).weight(1)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(1)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) )); exporter.accept(LootTables.TRAIL_RUINS_COMMON_ARCHAEOLOGY, LootTable.builder().pool(LootPool.builder() @@ -106,19 +116,22 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi )); exporter.accept(LootTables.OCEAN_RUIN_WARM_ARCHAEOLOGY, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(1)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) + .with(TagEntry.expandBuilder(UConventionalTags.Items.ROTTEN_FISH).weight(1)) )); exporter.accept(LootTables.FISHING_GAMEPLAY, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(2)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(2)) + .with(TagEntry.expandBuilder(UConventionalTags.Items.ROTTEN_FISH).weight(1)) )); exporter.accept(LootTables.FISHING_JUNK_GAMEPLAY, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) .with(ItemEntry.builder(UItems.BROKEN_SUNGLASSES).weight(2)) .with(ItemEntry.builder(UItems.WHEAT_WORMS).weight(2)) + .with(TagEntry.expandBuilder(UConventionalTags.Items.ROTTEN_FISH).weight(1)) .with(ItemEntry.builder(UItems.BOTCHED_GEM).weight(4)) )); diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestLootTableProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestLootTableProvider.java new file mode 100644 index 00000000..0ea207e9 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestLootTableProvider.java @@ -0,0 +1,56 @@ +package com.minelittlepony.unicopia.datagen.providers.loot; + +import java.util.function.BiConsumer; + +import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.entity.effect.UPotions; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.SimpleFabricLootTableProvider; +import net.minecraft.item.Items; +import net.minecraft.loot.LootPool; +import net.minecraft.loot.LootTable; +import net.minecraft.loot.LootTable.Builder; +import net.minecraft.loot.context.LootContextTypes; +import net.minecraft.loot.entry.ItemEntry; +import net.minecraft.loot.function.SetCountLootFunction; +import net.minecraft.loot.function.SetPotionLootFunction; +import net.minecraft.loot.provider.number.ConstantLootNumberProvider; +import net.minecraft.loot.provider.number.UniformLootNumberProvider; +import net.minecraft.potion.Potion; +import net.minecraft.util.Identifier; + +public class UChestLootTableProvider extends SimpleFabricLootTableProvider { + public UChestLootTableProvider(FabricDataOutput output) { + super(output, LootContextTypes.CHEST); + } + + @Override + public void accept(BiConsumer exporter) { + exporter.accept(Unicopia.id("chests/changeling_hive_trap"), LootTable.builder() + .pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(6)) + + .with(createTippedArrowEntry(UPotions.MORPH_EARTH_PONY.shortEffect(), 3)) + .with(createTippedArrowEntry(UPotions.MORPH_UNICORN.shortEffect(), 1)) + .with(createTippedArrowEntry(UPotions.MORPH_PEGASUS.shortEffect(), 1)) + .with(createTippedArrowEntry(UPotions.MORPH_BAT.shortEffect(), 1)) + .with(createTippedArrowEntry(UPotions.MORPH_KIRIN.shortEffect(), 1)) + .with(createTippedArrowEntry(UPotions.MORPH_HIPPOGRIFF.shortEffect(), 1)) + + .with(createTippedArrowEntry(UPotions.MORPH_EARTH_PONY.longEffect(), 5)) + .with(createTippedArrowEntry(UPotions.MORPH_UNICORN.longEffect(), 2)) + .with(createTippedArrowEntry(UPotions.MORPH_PEGASUS.longEffect(), 2)) + .with(createTippedArrowEntry(UPotions.MORPH_BAT.longEffect(), 2)) + .with(createTippedArrowEntry(UPotions.MORPH_KIRIN.longEffect(), 2)) + .with(createTippedArrowEntry(UPotions.MORPH_HIPPOGRIFF.longEffect(), 2)) + )); + } + + private static ItemEntry.Builder createTippedArrowEntry(Potion potion, int weight) { + return ItemEntry.builder(Items.TIPPED_ARROW) + .weight(weight) + .apply(SetPotionLootFunction.builder(potion)) + .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(3, 9))); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UEntityLootTableProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UEntityLootTableProvider.java new file mode 100644 index 00000000..bdcc6942 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UEntityLootTableProvider.java @@ -0,0 +1,63 @@ +package com.minelittlepony.unicopia.datagen.providers.loot; + +import java.util.function.BiConsumer; + +import com.minelittlepony.unicopia.UTags; +import com.minelittlepony.unicopia.entity.mob.UEntities; +import com.minelittlepony.unicopia.item.UItems; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.SimpleFabricLootTableProvider; +import net.minecraft.entity.EntityType; +import net.minecraft.loot.LootPool; +import net.minecraft.loot.LootTable; +import net.minecraft.loot.LootTable.Builder; +import net.minecraft.loot.condition.RandomChanceLootCondition; +import net.minecraft.loot.context.LootContextTypes; +import net.minecraft.loot.entry.ItemEntry; +import net.minecraft.loot.entry.TagEntry; +import net.minecraft.loot.function.LootingEnchantLootFunction; +import net.minecraft.loot.function.SetCountLootFunction; +import net.minecraft.loot.provider.number.ConstantLootNumberProvider; +import net.minecraft.loot.provider.number.UniformLootNumberProvider; +import net.minecraft.util.Identifier; + +public class UEntityLootTableProvider extends SimpleFabricLootTableProvider { + public UEntityLootTableProvider(FabricDataOutput output) { + super(output, LootContextTypes.ENTITY); + } + + @Override + public void accept(BiConsumer exporter) { + generate((type, builder) -> exporter.accept(EntityType.getId(type).withPrefixedPath("entities/"), builder)); + } + + protected void generate(BiConsumer, Builder> exporter) { + exporter.accept(UEntities.BUTTERFLY, LootTable.builder() + .pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(1)) + .with(ItemEntry.builder(UItems.BUTTERFLY) + .apply(LootingEnchantLootFunction.builder(UniformLootNumberProvider.create(0, 1)))))); + exporter.accept(UEntities.STORM_CLOUD, LootTable.builder() + .pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(1)) + .with(ItemEntry.builder(UItems.CLOUD_LUMP) + .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(6, 12))) + .apply(LootingEnchantLootFunction.builder(UniformLootNumberProvider.create(0, 1)))))); + exporter.accept(UEntities.LOOT_BUG, LootTable.builder() + .pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(1)) + .with(TagEntry.builder(UTags.Items.LOOT_BUG_COMMON_DROPS) + .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(6, 12))) + .apply(LootingEnchantLootFunction.builder(UniformLootNumberProvider.create(0, 3)))) + .with(TagEntry.builder(UTags.Items.LOOT_BUG_RARE_DROPS) + .conditionally(RandomChanceLootCondition.builder(0.25F)) + .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, 3))) + .apply(LootingEnchantLootFunction.builder(UniformLootNumberProvider.create(0, 6)))) + .with(TagEntry.builder(UTags.Items.LOOT_BUG_EPIC_DROPS) + .conditionally(RandomChanceLootCondition.builder(0.1F)) + .apply(SetCountLootFunction.builder(ConstantLootNumberProvider.create(1))) + .apply(LootingEnchantLootFunction.builder(UniformLootNumberProvider.create(0, 2)))) + )); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/BedSheetPatternRecipeBuilder.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/BedSheetPatternRecipeBuilder.java new file mode 100644 index 00000000..0c0395c5 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/BedSheetPatternRecipeBuilder.java @@ -0,0 +1,82 @@ +package com.minelittlepony.unicopia.datagen.providers.recipe; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Stream; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.UTags; +import com.minelittlepony.unicopia.item.UItems; + +import net.minecraft.data.server.recipe.RecipeExporter; +import net.minecraft.data.server.recipe.RecipeProvider; +import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder; +import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder; +import net.minecraft.item.ItemConvertible; +import net.minecraft.recipe.book.RecipeCategory; + +public class BedSheetPatternRecipeBuilder { + record PatternTemplate(List symbols, List uniqueSymbols, String[] pattern) { + static final PatternTemplate ONE_COLOR = new PatternTemplate(new String[] { "###", "# #", " ##" }); + static final PatternTemplate TWO_COLOR = new PatternTemplate(new String[] { "#%#", "% %", " %#" }); + static final PatternTemplate THREE_COLOR = new PatternTemplate(new String[] { "cvc", "h h", " vc" }); + static final PatternTemplate FOUR_COLOR = new PatternTemplate(new String[] { "wgb", "p g", " pw" }); + static final PatternTemplate SEVEN_COLOR = new PatternTemplate(new String[] { "roy", "l b", " pg" }); + + PatternTemplate(String[] pattern) { + this(List.of( + pattern[1].charAt(0), + pattern[0].charAt(0), + pattern[0].charAt(1), + pattern[0].charAt(2), + pattern[1].charAt(2), + pattern[2].charAt(2), + pattern[2].charAt(1) + ), pattern); + } + + PatternTemplate(List symbols, String[] pattern) { + this(symbols, symbols.stream().distinct().toList(), pattern); + } + + void offerWithoutConversion(RecipeExporter exporter, ItemConvertible output, ItemConvertible...wool) { + offerRecipe(this, null, exporter, output, wool); + } + + void offerTo(RecipeExporter exporter, ItemConvertible output, ItemConvertible...wool) { + Map symbolMap = new HashMap<>(); + offerRecipe(this, symbolMap, exporter, output, wool); + offerBedSheetConversionRecipe(exporter, output, symbols.stream().map(symbolMap::get)); + } + } + + private static void offerRecipe(PatternTemplate template, @Nullable Map symbolMap, RecipeExporter exporter, ItemConvertible output, ItemConvertible...wool) { + ShapedRecipeJsonBuilder builder = ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output); + for (int i = 0; i < template.uniqueSymbols().size(); i++) { + builder.input(template.uniqueSymbols().get(i), wool[i]); + if (symbolMap != null) { + symbolMap.put(template.uniqueSymbols().get(i), wool[i]); + } + } + for (int i = 0; i < template.pattern().length; i++) { + builder.pattern(template.pattern()[i]); + } + Arrays.asList(wool).stream().distinct().forEach(input -> { + builder.criterion(RecipeProvider.hasItem(input), RecipeProvider.conditionsFromItem(input)); + }); + builder.group("bed_sheet").offerTo(exporter); + } + + private static void offerBedSheetConversionRecipe(RecipeExporter exporter, ItemConvertible output, Stream wools) { + var builder = ShapelessRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output) + .input(UTags.Items.WOOL_BED_SHEETS).criterion("has_bed_sheet", RecipeProvider.conditionsFromTag(UTags.Items.WOOL_BED_SHEETS)); + wools.forEach(builder::input); + builder + .group("bed_sheet") + .offerTo(exporter, RecipeProvider.convertBetween(output, UItems.WHITE_BED_SHEETS)); + } + +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/ComplexSpellcraftingRecipeJsonBuilder.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/ComplexSpellcraftingRecipeJsonBuilder.java new file mode 100644 index 00000000..ca33cce4 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/ComplexSpellcraftingRecipeJsonBuilder.java @@ -0,0 +1,20 @@ +package com.minelittlepony.unicopia.datagen.providers.recipe; + +import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.ability.magic.spell.crafting.IngredientWithSpell; + +import net.minecraft.data.server.recipe.RecipeExporter; +import net.minecraft.item.ItemConvertible; +import net.minecraft.recipe.Recipe; + +public interface ComplexSpellcraftingRecipeJsonBuilder { + static ComplexSpellcraftingRecipeJsonBuilder create(Factory factory, ItemConvertible material) { + return (exporter, recipeId) -> exporter.accept(Unicopia.id(recipeId), factory.create(IngredientWithSpell.mundane(material)), null); + } + + public interface Factory { + Recipe create(IngredientWithSpell material); + } + + void offerTo(RecipeExporter exporter, final String recipeId); +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/CraftingMaterialHelper.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/CraftingMaterialHelper.java new file mode 100644 index 00000000..3c19d467 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/CraftingMaterialHelper.java @@ -0,0 +1,90 @@ +package com.minelittlepony.unicopia.datagen.providers.recipe; + +import java.util.Map; +import java.util.NoSuchElementException; + +import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; +import com.minelittlepony.unicopia.recipe.CloudShapingRecipe; +import com.mojang.datafixers.util.Either; + +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.data.server.recipe.RecipeProvider; +import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder; +import net.minecraft.data.server.recipe.SingleItemRecipeJsonBuilder; +import net.minecraft.data.server.recipe.VanillaRecipeProvider; +import net.minecraft.item.Item; +import net.minecraft.item.ItemConvertible; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.predicate.item.ItemPredicate; +import net.minecraft.recipe.Ingredient; +import net.minecraft.recipe.book.RecipeCategory; +import net.minecraft.registry.Registries; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +public interface CraftingMaterialHelper { + Map> MATERIALS = Map.of( + "wood", ItemTags.PLANKS, + "stone", ItemTags.STONE_TOOL_MATERIALS, + "iron", ConventionalItemTags.IRON_INGOTS, + "gold", ConventionalItemTags.GOLD_INGOTS, + "copper", ConventionalItemTags.COPPER_INGOTS, + "netherite", ConventionalItemTags.NETHERITE_INGOTS + ); + + static Either> getMaterial(Item output, String toStrip, String suffex) { + Identifier id = Registries.ITEM.getId(output).withPath(p -> p.replace(toStrip, "") + suffex); + TagKey tag = MATERIALS.getOrDefault(id.getPath().replace("en_", "_").split("_")[0], null); + if (tag != null) { + return Either.right(tag); + } + return Either.left( + Registries.ITEM.getOrEmpty(id) + .or(() -> Registries.ITEM.getOrEmpty(new Identifier(Identifier.DEFAULT_NAMESPACE, id.getPath()))) + .or(() -> Registries.ITEM.getOrEmpty(new Identifier(Identifier.DEFAULT_NAMESPACE, id.getPath().replace(suffex, "")))) + .orElseThrow(() -> new NoSuchElementException("No item with id " + id)) + ); + } + + static Item getItem(Identifier id) { + return Registries.ITEM.getOrEmpty(id).orElseThrow(() -> new NoSuchElementException("No item with id " + id)); + } + + static ShapedRecipeJsonBuilder input(ShapedRecipeJsonBuilder builder, char key, Either> material) { + material.ifLeft(i -> builder.input(key, i)); + material.ifRight(i -> builder.input(key, i)); + return builder; + } + + static AdvancementCriterion conditionsFromEither(Either> material) { + return material.map(RecipeProvider::conditionsFromItem, RecipeProvider::conditionsFromTag); + } + + static String hasEither(Either> material) { + return material.map(VanillaRecipeProvider::hasItem, CraftingMaterialHelper::hasTag); + } + + static String hasTag(TagKey tag) { + return "has_" + tag.id(); + } + + static AdvancementCriterion conditionsFromSpell(ItemConvertible gem, SpellType spell) { + NbtCompound nbt = new NbtCompound(); + nbt.putString("spell", spell.getId().toString()); + return RecipeProvider.conditionsFromItemPredicates(ItemPredicate.Builder.create() + .items(gem) + .nbt(nbt) + .build() + ); + } + + static String hasSpell(SpellType spell) { + return "has_" + spell.getId() + "_gemstone"; + } + + static SingleItemRecipeJsonBuilder createCloudShaping(Ingredient input, RecipeCategory category, ItemConvertible output, int count) { + return new SingleItemRecipeJsonBuilder(category, CloudShapingRecipe::new, input, output, count); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/GrowingRecipeJsonBuilder.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/GrowingRecipeJsonBuilder.java new file mode 100644 index 00000000..e0e5b355 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/GrowingRecipeJsonBuilder.java @@ -0,0 +1,79 @@ +package com.minelittlepony.unicopia.datagen.providers.recipe; + +import java.util.LinkedHashMap; +import java.util.Map; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.include.com.google.common.base.Preconditions; + +import com.minelittlepony.unicopia.recipe.TransformCropsRecipe; +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.advancement.AdvancementRequirements; +import net.minecraft.advancement.AdvancementRewards; +import net.minecraft.advancement.criterion.RecipeUnlockedCriterion; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.data.server.recipe.RecipeExporter; +import net.minecraft.recipe.book.RecipeCategory; +import net.minecraft.registry.Registries; +import net.minecraft.util.Identifier; + +public class GrowingRecipeJsonBuilder { + private final Map> criterions = new LinkedHashMap<>(); + @Nullable + private String group; + private final RecipeCategory category; + private final BlockState output; + private Block target; + private BlockState fuel; + + public static GrowingRecipeJsonBuilder create(RecipeCategory category, BlockState output) { + return new GrowingRecipeJsonBuilder(category, output); + } + + protected GrowingRecipeJsonBuilder(RecipeCategory category, BlockState output) { + this.category = category; + this.output = output; + } + + public GrowingRecipeJsonBuilder target(Block target) { + this.target = target; + return this; + } + + public GrowingRecipeJsonBuilder fuel(BlockState fuel) { + this.fuel = fuel; + return this; + } + + public GrowingRecipeJsonBuilder criterion(String name, AdvancementCriterion condition) { + criterions.put(name, condition); + return this; + } + + public GrowingRecipeJsonBuilder group(String group) { + this.group = group; + return this; + } + + public void offerTo(RecipeExporter exporter, Identifier id) { + Preconditions.checkState(!criterions.isEmpty(), "No way of obtaining recipe " + id); + exporter.accept(id, new TransformCropsRecipe(target, fuel, output), exporter.getAdvancementBuilder() + .criterion("has_the_recipe", RecipeUnlockedCriterion.create(id)) + .rewards(AdvancementRewards.Builder.recipe(id)) + .criteriaMerger(AdvancementRequirements.CriterionMerger.OR) + .build(id.withPrefixedPath("recipes/" + category.getName() + "/"))); + } + + public void offerTo(RecipeExporter exporter) { + offerTo(exporter, Registries.BLOCK.getId(output.getBlock())); + } + + public void offerTo(RecipeExporter exporter, String recipePath) { + Identifier recipeId = new Identifier(recipePath); + Identifier id = Registries.BLOCK.getId(output.getBlock()); + if (recipeId.equals(id)) { + throw new IllegalStateException("Recipe " + recipePath + " should remove its 'save' argument as it is equal to default one"); + } + offerTo(exporter, recipeId); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/SpellcraftingRecipeJsonBuilder.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/SpellcraftingRecipeJsonBuilder.java new file mode 100644 index 00000000..e140d2c3 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/SpellcraftingRecipeJsonBuilder.java @@ -0,0 +1,105 @@ +package com.minelittlepony.unicopia.datagen.providers.recipe; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.jetbrains.annotations.Nullable; +import org.spongepowered.include.com.google.common.base.Preconditions; + +import com.minelittlepony.unicopia.ability.magic.spell.crafting.IngredientWithSpell; +import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellCraftingRecipe; +import com.minelittlepony.unicopia.ability.magic.spell.crafting.TraitIngredient; +import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; +import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits; +import com.minelittlepony.unicopia.advancement.TraitDiscoveredCriterion; +import com.minelittlepony.unicopia.item.EnchantableItem; +import com.minelittlepony.unicopia.item.UItems; +import net.minecraft.advancement.Advancement; +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.advancement.AdvancementRequirements; +import net.minecraft.advancement.AdvancementRewards; +import net.minecraft.advancement.criterion.RecipeUnlockedCriterion; +import net.minecraft.data.server.recipe.RecipeExporter; +import net.minecraft.item.ItemConvertible; +import net.minecraft.item.ItemStack; +import net.minecraft.recipe.book.RecipeCategory; +import net.minecraft.util.Identifier; + +public class SpellcraftingRecipeJsonBuilder { + private final Map> criterions = new LinkedHashMap<>(); + @Nullable + private String group; + private final RecipeCategory category; + + private IngredientWithSpell base = IngredientWithSpell.mundane(UItems.GEMSTONE); + private final SpellType spell; + private final ItemConvertible gem; + private final List ingredients = new ArrayList<>(); + private SpellTraits traits = SpellTraits.EMPTY; + + public static SpellcraftingRecipeJsonBuilder create(RecipeCategory category, ItemConvertible gem, SpellType spell) { + return new SpellcraftingRecipeJsonBuilder(category, gem, spell); + } + + private SpellcraftingRecipeJsonBuilder(RecipeCategory category, ItemConvertible gem, SpellType spell) { + this.category = category; + this.gem = gem; + this.spell = spell; + } + + public SpellcraftingRecipeJsonBuilder base(ItemConvertible gem, SpellType spell) { + base = IngredientWithSpell.of(gem, spell); + return this; + } + + public SpellcraftingRecipeJsonBuilder input(ItemConvertible gem, SpellType spell) { + ingredients.add(IngredientWithSpell.of(gem, spell)); + return this; + } + + public SpellcraftingRecipeJsonBuilder traits(SpellTraits.Builder traits) { + this.traits = traits.build(); + return this; + } + + public SpellcraftingRecipeJsonBuilder criterion(String name, AdvancementCriterion condition) { + criterions.put(name, condition); + return this; + } + + public SpellcraftingRecipeJsonBuilder group(String group) { + this.group = group; + return this; + } + + public void offerTo(RecipeExporter exporter, Identifier id) { + if (!traits.isEmpty()) { + criterions.put("has_traits", TraitDiscoveredCriterion.create(traits.stream().map(Map.Entry::getKey).collect(Collectors.toUnmodifiableSet()))); + } + Preconditions.checkState(!criterions.isEmpty(), "No way of obtaining recipe " + id); + Advancement.Builder advancementBuilder = exporter.getAdvancementBuilder() + .criterion("has_the_recipe", RecipeUnlockedCriterion.create(id)) + .rewards(AdvancementRewards.Builder.recipe(id)) + .criteriaMerger(AdvancementRequirements.CriterionMerger.OR); + exporter.accept(id, new SpellCraftingRecipe(base, TraitIngredient.of(traits), ingredients, EnchantableItem.enchant(gem.asItem().getDefaultStack(), spell)), advancementBuilder.build(id.withPrefixedPath("recipes/" + category.getName() + "/"))); + } + + public SpellCraftingRecipe create(IngredientWithSpell material, TraitIngredient traits, List ingredients, ItemStack result) { + return null; + } + + public void offerTo(RecipeExporter exporter) { + offerTo(exporter, spell.getId()); + } + + public void offerTo(RecipeExporter exporter, String recipePath) { + Identifier recipeId = new Identifier(recipePath); + if (recipeId.equals(spell.getId())) { + throw new IllegalStateException("Recipe " + recipePath + " should remove its 'save' argument as it is equal to default one"); + } + offerTo(exporter, recipeId); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/TrickCraftingRecipeJsonBuilder.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/TrickCraftingRecipeJsonBuilder.java new file mode 100644 index 00000000..7bf4c568 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/TrickCraftingRecipeJsonBuilder.java @@ -0,0 +1,78 @@ +package com.minelittlepony.unicopia.datagen.providers.recipe; + +import java.util.LinkedHashMap; +import java.util.Map; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.include.com.google.common.base.Preconditions; + +import com.minelittlepony.unicopia.recipe.ZapAppleRecipe; + +import net.minecraft.advancement.Advancement; +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.advancement.AdvancementRequirements; +import net.minecraft.advancement.AdvancementRewards; +import net.minecraft.advancement.criterion.RecipeUnlockedCriterion; +import net.minecraft.data.server.recipe.CraftingRecipeJsonBuilder; +import net.minecraft.data.server.recipe.RecipeExporter; +import net.minecraft.item.Item; +import net.minecraft.item.ItemConvertible; +import net.minecraft.recipe.Ingredient; +import net.minecraft.recipe.book.CraftingRecipeCategory; +import net.minecraft.recipe.book.RecipeCategory; +import net.minecraft.util.Identifier; +import net.minecraft.util.collection.DefaultedList; + +public class TrickCraftingRecipeJsonBuilder implements CraftingRecipeJsonBuilder { + private final Map> criterions = new LinkedHashMap<>(); + @Nullable + private String group; + private final RecipeCategory category; + private final Item output; + + private final DefaultedList inputs = DefaultedList.of(); + + public TrickCraftingRecipeJsonBuilder(RecipeCategory category, ItemConvertible output) { + this.category = category; + this.output = output.asItem(); + } + + public static TrickCraftingRecipeJsonBuilder create(RecipeCategory category, ItemConvertible output) { + return new TrickCraftingRecipeJsonBuilder(category, output); + } + + @Override + public Item getOutputItem() { + return output; + } + + public TrickCraftingRecipeJsonBuilder input(ItemConvertible input) { + inputs.add(Ingredient.ofItems(input)); + return this; + } + + @Override + public TrickCraftingRecipeJsonBuilder criterion(String name, AdvancementCriterion condition) { + criterions.put(name, condition); + return this; + } + + @Override + public TrickCraftingRecipeJsonBuilder group(String group) { + this.group = group; + return this; + } + + @Override + public void offerTo(RecipeExporter exporter, Identifier id) { + Preconditions.checkState(!criterions.isEmpty(), "No way of obtaining recipe " + id); + Advancement.Builder builder = exporter.getAdvancementBuilder() + .criterion("has_the_recipe", RecipeUnlockedCriterion.create(id)) + .rewards(AdvancementRewards.Builder.recipe(id)) + .criteriaMerger(AdvancementRequirements.CriterionMerger.OR); + criterions.forEach(builder::criterion); + exporter.accept(id, + new ZapAppleRecipe(group == null ? "" : group, CraftingRecipeCategory.MISC, output.getDefaultStack(), inputs), + builder.build(id.withPrefixedPath("recipes/" + category.getName() + "/")) + ); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java new file mode 100644 index 00000000..5599c36b --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java @@ -0,0 +1,765 @@ +package com.minelittlepony.unicopia.datagen.providers.recipe; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.UConventionalTags; +import com.minelittlepony.unicopia.UTags; +import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellDuplicatingRecipe; +import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellEnhancingRecipe; +import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; +import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits; +import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait; +import com.minelittlepony.unicopia.block.UBlocks; +import com.minelittlepony.unicopia.datagen.ItemFamilies; +import com.minelittlepony.unicopia.datagen.UBlockFamilies; +import com.minelittlepony.unicopia.datagen.providers.recipe.BedSheetPatternRecipeBuilder.PatternTemplate; +import com.minelittlepony.unicopia.item.UItems; +import com.minelittlepony.unicopia.recipe.GlowingRecipe; +import com.minelittlepony.unicopia.recipe.JarExtractRecipe; +import com.minelittlepony.unicopia.recipe.JarInsertRecipe; +import com.minelittlepony.unicopia.server.world.UTreeGen; +import com.mojang.datafixers.util.Either; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; +import net.minecraft.advancement.AdvancementCriterion; +import net.minecraft.advancement.criterion.Criteria; +import net.minecraft.advancement.criterion.InventoryChangedCriterion; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.data.server.recipe.ComplexRecipeJsonBuilder; +import net.minecraft.data.server.recipe.RecipeExporter; +import net.minecraft.data.server.recipe.RecipeProvider; +import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder; +import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder; +import net.minecraft.item.Item; +import net.minecraft.item.ItemConvertible; +import net.minecraft.item.Items; +import net.minecraft.predicate.NumberRange; +import net.minecraft.predicate.item.ItemPredicate; +import net.minecraft.recipe.Ingredient; +import net.minecraft.recipe.book.RecipeCategory; +import net.minecraft.registry.Registries; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.resource.featuretoggle.FeatureSet; + +public class URecipeProvider extends FabricRecipeProvider { + private static final List WOOLS = List.of(Items.BLACK_WOOL, Items.BLUE_WOOL, Items.BROWN_WOOL, Items.CYAN_WOOL, Items.GRAY_WOOL, Items.GREEN_WOOL, Items.LIGHT_BLUE_WOOL, Items.LIGHT_GRAY_WOOL, Items.LIME_WOOL, Items.MAGENTA_WOOL, Items.ORANGE_WOOL, Items.PINK_WOOL, Items.PURPLE_WOOL, Items.RED_WOOL, Items.YELLOW_WOOL, Items.WHITE_WOOL); + public URecipeProvider(FabricDataOutput output) { + super(output); + } + + @Override + public void generate(RecipeExporter exporter) { + generateVanillaRecipeExtensions(exporter); + offerJarRecipes(exporter); + offerWoodBlocksRecipes(exporter); + offerChitinBlocksRecipes(exporter); + offerCloudRecipes(exporter); + offerFoodRecipes(exporter); + offerGemstoneAndMagicRecipes(exporter); + offerMagicSpellRecipes(exporter); + offerSeaponyRecipes(exporter); + offerEarthPonyRecipes(exporter); + + // beds + createCustomBedRecipe(UItems.CLOUD_BED, Either.left(UBlocks.DENSE_CLOUD), Either.left(UBlocks.CLOUD_PLANKS)).offerTo(exporter); + createCustomBedRecipe(UItems.CLOTH_BED, Either.right(ItemTags.WOOL), Either.right(ItemTags.LOGS)).offerTo(exporter); + offerBedSheetRecipes(exporter); + + // sunglasses + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.SUNGLASSES) + .input('#', ConventionalItemTags.GLASS_BLOCKS).criterion("has_glass_block", conditionsFromTag(ConventionalItemTags.GLASS_BLOCKS)) + .pattern("##") + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.SUNGLASSES) + .input(ConventionalItemTags.GLASS_BLOCKS) + .input(UItems.SUNGLASSES).criterion("has_broken_sunglasses", conditionsFromItem(UItems.BROKEN_SUNGLASSES)) + .offerTo(exporter, convertBetween(UItems.SUNGLASSES, UItems.BROKEN_SUNGLASSES)); + } + + private void generateVanillaRecipeExtensions(RecipeExporter exporter) { + ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, Items.WRITABLE_BOOK) + .input(Items.BOOK).criterion("has_book", conditionsFromItem(Items.BOOK)) + .input(Items.INK_SAC) + .input(UTags.Items.MAGIC_FEATHERS) + .offerTo(exporter); + ShapedRecipeJsonBuilder.create(RecipeCategory.COMBAT, Items.ARROW, 4) + .input('#', UConventionalTags.Items.STICKS) + .input('X', Items.FLINT).criterion("has_flint", conditionsFromItem(Items.FLINT)) + .input('Y', UTags.Items.MAGIC_FEATHERS).criterion("has_feather", conditionsFromTag(UTags.Items.MAGIC_FEATHERS)) + .pattern("X") + .pattern("#") + .pattern("Y") + .offerTo(exporter); + } + + private void offerJarRecipes(RecipeExporter exporter) { + ComplexRecipeJsonBuilder.create(JarExtractRecipe::new).offerTo(exporter, "empty_jar_from_filled_jar"); + ComplexRecipeJsonBuilder.create(JarInsertRecipe::new).offerTo(exporter, "filled_jar"); + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.EMPTY_JAR, 7) + .input('#', ItemTags.PLANKS) + .input('*', ConventionalItemTags.GLASS_BLOCKS).criterion("has_glass", conditionsFromTag(ConventionalItemTags.GLASS_BLOCKS)) + .pattern("*#*") + .pattern("* *") + .pattern("***") + .offerTo(exporter); + } + + private void offerCloudRecipes(RecipeExporter exporter) { + offerShapelessRecipe(exporter, UItems.CLOUD_LUMP, UTags.Items.CLOUD_JARS, "cloud", 4); + generateFamily(exporter, UBlockFamilies.CLOUD, FeatureSet.empty()); + offer2x3Recipe(exporter, UBlocks.CLOUD_PILLAR, UBlocks.CLOUD, "pillar"); + offer2x2CompactingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD, UItems.CLOUD_LUMP); + offerPolishedStoneRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_PLANKS, UBlocks.CLOUD); + generateFamily(exporter, UBlockFamilies.CLOUD_PLANKS, FeatureSet.empty()); + offerChestRecipe(exporter, UBlocks.CLOUD_CHEST, UBlocks.CLOUD_PLANKS); + + offer2x2CompactingRecipe(exporter, RecipeCategory.DECORATIONS, UBlocks.SHAPING_BENCH, UBlocks.DENSE_CLOUD); + generateFamily(exporter, UBlockFamilies.CLOUD_BRICKS, FeatureSet.empty()); + + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CARVED_CLOUD, UBlocks.CLOUD); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.ETCHED_CLOUD, UBlocks.CLOUD); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_BRICKS, UBlocks.CLOUD); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_PLANKS, UBlocks.CLOUD); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_PILLAR, UBlocks.CLOUD); + + // TODO: Cut Cloud, Smooth Cloud, Polished Cloud, Raked Cloud + + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_SLAB, UBlocks.CLOUD, 2); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_STAIRS, UBlocks.CLOUD); + + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_BRICK_SLAB, UBlocks.CLOUD_BRICKS, 2); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_BRICK_STAIRS, UBlocks.CLOUD_BRICKS); + + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_PLANK_SLAB, UBlocks.CLOUD_PLANKS, 2); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD_PLANK_STAIRS, UBlocks.CLOUD_PLANKS); + + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.DENSE_CLOUD_SLAB, UBlocks.DENSE_CLOUD, 2); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.DENSE_CLOUD_STAIRS, UBlocks.DENSE_CLOUD); + + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.ETCHED_CLOUD_SLAB, UBlocks.ETCHED_CLOUD, 2); + offerCloudShapingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.ETCHED_CLOUD_STAIRS, UBlocks.ETCHED_CLOUD); + + offerCompactingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.DENSE_CLOUD, UBlocks.CLOUD, 4); + generateFamily(exporter, UBlockFamilies.DENSE_CLOUD, FeatureSet.empty()); + offer2x3Recipe(exporter, UBlocks.CLOUD_DOOR, UBlocks.DENSE_CLOUD, "door"); + + ShapelessRecipeJsonBuilder.create(RecipeCategory.REDSTONE, UBlocks.UNSTABLE_CLOUD, 8) + .input(UBlocks.CLOUD, 8) + .input(Ingredient.ofItems(UItems.LIGHTNING_JAR, UItems.ZAP_APPLE_JAM_JAR)) + .criterion("has_lightning_jar", conditionsFromItem(UItems.LIGHTNING_JAR)) + .criterion("has_zap_jar", conditionsFromItem(UItems.ZAP_APPLE_JAM_JAR)) + .offerTo(exporter); + } + + private void offerWoodBlocksRecipes(RecipeExporter exporter) { + // palm wood + generateFamily(exporter, UBlockFamilies.PALM, FeatureSet.empty()); + offerPlanksRecipe(exporter, UBlocks.PALM_PLANKS, UTags.Items.PALM_LOGS, 4); + offerBarkBlockRecipe(exporter, UBlocks.PALM_WOOD, UBlocks.PALM_LOG); + offerBarkBlockRecipe(exporter, UBlocks.STRIPPED_PALM_WOOD, UBlocks.STRIPPED_PALM_LOG); + offerBoatRecipe(exporter, UItems.PALM_BOAT, UBlocks.PALM_PLANKS); + offerChestBoatRecipe(exporter, UItems.PALM_CHEST_BOAT, UItems.PALM_BOAT); + offerHangingSignRecipe(exporter, UBlocks.PALM_HANGING_SIGN, UBlocks.PALM_PLANKS); + + // zap wood + generateFamily(exporter, UBlockFamilies.ZAP, FeatureSet.empty()); + offerPlanksRecipe(exporter, UBlocks.ZAP_PLANKS, UTags.Items.ZAP_LOGS, 4); + offerBarkBlockRecipe(exporter, UBlocks.ZAP_WOOD, UBlocks.ZAP_LOG); + offerBarkBlockRecipe(exporter, UBlocks.STRIPPED_ZAP_WOOD, UBlocks.STRIPPED_ZAP_LOG); + + // waxed zap wood + offerPlanksRecipe(exporter, UBlocks.WAXED_ZAP_PLANKS, UTags.Items.WAXED_ZAP_LOGS, 4); + offerBarkBlockRecipe(exporter, UBlocks.WAXED_ZAP_WOOD, UBlocks.WAXED_ZAP_LOG); + generateFamily(exporter, UBlockFamilies.WAXED_ZAP, FeatureSet.empty()); + offerBarkBlockRecipe(exporter, UBlocks.WAXED_STRIPPED_ZAP_WOOD, UBlocks.WAXED_STRIPPED_ZAP_LOG); + + offerWaxingRecipes(exporter); + + // other doors + offer2x3Recipe(exporter, UBlocks.CRYSTAL_DOOR, UItems.CRYSTAL_SHARD, "door"); + offerStableDoorRecipe(exporter, UBlocks.STABLE_DOOR, Either.right(ItemTags.PLANKS), UItems.ROCK_CANDY); + offerStableDoorRecipe(exporter, UBlocks.DARK_OAK_DOOR, Either.right(ItemTags.PLANKS), UItems.ROCK); + } + + private void offerChitinBlocksRecipes(RecipeExporter exporter) { + offerReversibleCompactingRecipes(exporter, RecipeCategory.BUILDING_BLOCKS, UItems.CARAPACE, RecipeCategory.BUILDING_BLOCKS, UBlocks.CHITIN); + generateFamily(exporter, UBlockFamilies.CHISELED_CHITIN, FeatureSet.empty()); + offerHiveRecipe(exporter, UBlocks.HIVE, UBlocks.CHITIN, UBlocks.MYSTERIOUS_EGG); + offerHullRecipe(exporter, UBlocks.CHISELLED_CHITIN_HULL, UBlocks.CHISELLED_CHITIN, UBlocks.CHITIN); + offerSpikesRecipe(exporter, UBlocks.CHITIN_SPIKES, UBlocks.CHITIN); + + // TODO: polished chitin + offerPolishedStoneRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CHISELLED_CHITIN, UBlocks.CHITIN); + + offerStonecuttingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CHISELLED_CHITIN_HULL, UBlocks.CHISELLED_CHITIN); + offerStonecuttingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CHISELLED_CHITIN_SLAB, UBlocks.CHISELLED_CHITIN, 2); + offerStonecuttingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CHISELLED_CHITIN_STAIRS, UBlocks.CHISELLED_CHITIN); + } + + private void offerGemstoneAndMagicRecipes(RecipeExporter exporter) { + offerShapelessRecipe(exporter, UItems.CRYSTAL_SHARD, Items.DIAMOND, "crystal_shard", 6); + offerShapelessRecipe(exporter, UItems.CRYSTAL_SHARD, Items.AMETHYST_SHARD, "crystal_shard", 3); + offer2x2CompactingRecipe(exporter, RecipeCategory.MISC, UItems.GEMSTONE, UItems.CRYSTAL_SHARD); + ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.SPELLBOOK) + .input(Items.BOOK).criterion("has_book", conditionsFromItem(Items.BOOK)) + .input(UItems.GEMSTONE).criterion("has_gemstone", conditionsFromItem(UItems.GEMSTONE)) + .offerTo(exporter); + + // magic staff + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.MAGIC_STAFF) + .input('*', UItems.GEMSTONE).criterion("has_gemstone", conditionsFromItem(UItems.GEMSTONE)) + .input('#', UConventionalTags.Items.STICKS).criterion("has_stick", conditionsFromTag(UConventionalTags.Items.STICKS)) + .pattern(" *") + .pattern(" # ") + .pattern("# ") + .offerTo(exporter); + + // crystal heart + ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, UItems.CRYSTAL_HEART) + .input('#', UItems.CRYSTAL_SHARD).criterion("has_crystal_shard", conditionsFromItem(UItems.CRYSTAL_SHARD)) + .pattern("# #") + .pattern("###") + .pattern(" # ") + .offerTo(exporter); + + // pegasus amulet + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.GOLDEN_FEATHER) + .input('*', Items.GOLD_NUGGET).criterion("has_nugget", conditionsFromItem(Items.GOLD_NUGGET)) + .input('#', UTags.Items.MAGIC_FEATHERS).criterion("has_feather", conditionsFromTag(UTags.Items.MAGIC_FEATHERS)) + .pattern("***") + .pattern("*#*") + .pattern("***") + .offerTo(exporter); + offerCompactingRecipe(exporter, RecipeCategory.COMBAT, UItems.GOLDEN_WING, UItems.GOLDEN_FEATHER); + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.PEGASUS_AMULET) + .input('*', UItems.GOLDEN_WING).criterion("has_wing", conditionsFromItem(UItems.GOLDEN_WING)) + .input('#', UItems.GEMSTONE).criterion("has_gemstone", conditionsFromItem(UItems.GEMSTONE)) + .pattern("*#*") + .offerTo(exporter); + + // friendship bracelet + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.FRIENDSHIP_BRACELET) + .input('*', Items.STRING) + .input('#', Items.LEATHER).criterion(hasItem(Items.LEATHER), conditionsFromItem(Items.LEATHER)) + .pattern("*#*") + .pattern("# #") + .pattern("*#*") + .offerTo(exporter); + ComplexRecipeJsonBuilder.create(GlowingRecipe::new).offerTo(exporter, "friendship_bracelet_glowing"); + + // meadowbrook's staff + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.MEADOWBROOKS_STAFF) + .input('*', UItems.GEMSTONE).criterion(hasItem(UItems.GEMSTONE), conditionsFromItem(UItems.GEMSTONE)) + .input('/', UConventionalTags.Items.STICKS).criterion(hasItem(Items.STICK), conditionsFromTag(UConventionalTags.Items.STICKS)) + .pattern(" *") + .pattern(" / ") + .pattern("/ ") + .offerTo(exporter); + offerShapelessRecipe(exporter, Items.STICK, UItems.MEADOWBROOKS_STAFF, "stick", 2); + } + + private void offerMagicSpellRecipes(RecipeExporter exporter) { + offerSpell(exporter, UItems.GEMSTONE, SpellType.DISPLACEMENT, new SpellTraits.Builder().with(Trait.KNOWLEDGE, 10).with(Trait.CHAOS, 10)); + offerSpell(exporter, UItems.GEMSTONE, SpellType.FROST, new SpellTraits.Builder().with(Trait.ICE, 10)); + offerSpell(exporter, UItems.GEMSTONE, SpellType.SCORCH, new SpellTraits.Builder().with(Trait.FIRE, 10)); + offerSpell(exporter, UItems.GEMSTONE, SpellType.SHIELD, new SpellTraits.Builder().with(Trait.STRENGTH, 10).with(Trait.FOCUS, 6).with(Trait.POWER, 10)); + offerSpell(exporter, UItems.GEMSTONE, SpellType.TRANSFORMATION, new SpellTraits.Builder().with(Trait.KNOWLEDGE, 10).with(Trait.LIFE, 10).with(Trait.CHAOS, 4)); + + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.ARCANE_PROTECTION, SpellType.SHIELD, new SpellTraits.Builder().with(Trait.STRENGTH, 10).with(Trait.KNOWLEDGE, 18).with(Trait.DARKNESS, 1)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.BUBBLE, SpellType.CATAPULT, new SpellTraits.Builder().with(Trait.WATER, 9).with(Trait.AIR, 9)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.CATAPULT, SpellType.FLAME, new SpellTraits.Builder().with(Trait.FOCUS, 9).with(Trait.AIR, 9)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.CHILLING_BREATH, SpellType.FROST, new SpellTraits.Builder().with(Trait.ICE, 5).with(Trait.KNOWLEDGE, 10)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.DARK_VORTEX, SpellType.VORTEX, new SpellTraits.Builder().with(Trait.STRENGTH, 10).with(Trait.KNOWLEDGE, 8).with(Trait.DARKNESS, 9).with(Trait.CHAOS, 8)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.FEATHER_FALL, SpellType.SHIELD, new SpellTraits.Builder().with(Trait.KNOWLEDGE, 20).with(Trait.LIFE, 10).with(Trait.CHAOS, 4).with(Trait.GENEROSITY, 10)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.FIRE_BOLT, SpellType.FLAME, new SpellTraits.Builder().with(Trait.FOCUS, 9).with(Trait.FIRE, 30)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.FLAME, SpellType.SCORCH, new SpellTraits.Builder().with(Trait.FIRE, 15)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.INFERNAL, SpellType.FLAME, new SpellTraits.Builder().with(Trait.FIRE, 50).with(Trait.DARKNESS, 10)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.LIGHT, SpellType.FIRE_BOLT, new SpellTraits.Builder().with(Trait.ICE, 30).with(Trait.LIFE, 30).with(Trait.FOCUS, 10)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.MIMIC, SpellType.TRANSFORMATION, new SpellTraits.Builder().with(Trait.KNOWLEDGE, 19).with(Trait.LIFE, 10).with(Trait.CHAOS, 4)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.MIND_SWAP, SpellType.MIMIC, new SpellTraits.Builder().with(Trait.KNOWLEDGE, 19).with(Trait.LIFE, 10).with(Trait.CHAOS, 40)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.NECROMANCY, SpellType.SIPHONING, new SpellTraits.Builder().with(Trait.STRENGTH, 10).with(Trait.KNOWLEDGE, 8).with(Trait.DARKNESS, 19).with(Trait.CHAOS, 8).with(Trait.BLOOD, 10).with(Trait.POISON, 9)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.REVEALING, SpellType.SHIELD, new SpellTraits.Builder().with(Trait.KNOWLEDGE, 18).with(Trait.LIFE, 1).with(Trait.ORDER, 4)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.SIPHONING, SpellType.INFERNAL, new SpellTraits.Builder().with(Trait.BLOOD, 8).with(Trait.POISON, 10)); + offerSpellFromSpell(exporter, UItems.GEMSTONE, SpellType.VORTEX, SpellType.SHIELD, new SpellTraits.Builder().with(Trait.STRENGTH, 10).with(Trait.KNOWLEDGE, 8).with(Trait.AIR, 9)); + + offerSpellFromTwoSpells(exporter, UItems.GEMSTONE, SpellType.DISPEL_EVIL, SpellType.ARCANE_PROTECTION, SpellType.DISPLACEMENT, new SpellTraits.Builder().with(Trait.KINDNESS, 1).with(Trait.POWER, 1)); + offerSpellFromTwoSpells(exporter, UItems.GEMSTONE, SpellType.HYDROPHOBIC, SpellType.FROST, SpellType.SHIELD, new SpellTraits.Builder().with(Trait.FOCUS, 6)); + offerSpellFromTwoSpells(exporter, UItems.GEMSTONE, SpellType.PORTAL, SpellType.DISPLACEMENT, SpellType.DARK_VORTEX, new SpellTraits.Builder().with(Trait.KNOWLEDGE, 18).with(Trait.CHAOS, 20)); + + SpellcraftingRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.ALICORN_AMULET, SpellType.EMPTY_KEY) + .base(UItems.GEMSTONE, SpellType.DARK_VORTEX) + .traits(new SpellTraits.Builder().with(Trait.DARKNESS, 30).with(Trait.POWER, 30).with(Trait.BLOOD, 30)) + .offerTo(exporter, "alicorn_amulet"); + + SpellcraftingRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.UNICORN_AMULET, SpellType.EMPTY_KEY) + .base(UItems.BROKEN_ALICORN_AMULET, SpellType.EMPTY_KEY) + .input(UItems.PEGASUS_AMULET, SpellType.EMPTY_KEY) + .input(UItems.CRYSTAL_HEART, SpellType.EMPTY_KEY) + .input(UItems.GROGARS_BELL, SpellType.EMPTY_KEY) + .input(Items.TOTEM_OF_UNDYING, SpellType.EMPTY_KEY) + .traits(new SpellTraits.Builder()) + .criterion(hasItem(UItems.BROKEN_ALICORN_AMULET), conditionsFromItem(UItems.BROKEN_ALICORN_AMULET)) + .offerTo(exporter, "unicorn_amulet"); + + SpellcraftingRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.DRAGON_BREATH_SCROLL, SpellType.EMPTY_KEY) + .base(Items.PAPER, SpellType.EMPTY_KEY) + .input(Items.PAPER, SpellType.EMPTY_KEY) + .traits(new SpellTraits.Builder().with(Trait.FIRE, 1)) + .offerTo(exporter, "dragon_breath_scroll"); + + ComplexSpellcraftingRecipeJsonBuilder.create(SpellDuplicatingRecipe::new, UItems.BOTCHED_GEM).offerTo(exporter, "spell_duplicating"); + ComplexSpellcraftingRecipeJsonBuilder.create(SpellEnhancingRecipe::new, UItems.BOTCHED_GEM).offerTo(exporter, "trait_combining_botched_gem"); + ComplexSpellcraftingRecipeJsonBuilder.create(SpellEnhancingRecipe::new, UItems.GEMSTONE).offerTo(exporter, "trait_combining_gemstone"); + } + + private void offerFoodRecipes(RecipeExporter exporter) { + offerShapelessRecipe(exporter, UItems.PINEAPPLE_CROWN, UItems.PINEAPPLE, "seeds", 1); + offerShapelessRecipe(exporter, UItems.SWEET_APPLE_SEEDS, UItems.SWEET_APPLE, "seeds", 3); + offerShapelessRecipe(exporter, UItems.SOUR_APPLE_SEEDS, UItems.SOUR_APPLE, "seeds", 3); + offerShapelessRecipe(exporter, UItems.GREEN_APPLE_SEEDS, UItems.GREEN_APPLE, "seeds", 3); + offerShapelessRecipe(exporter, UItems.GOLDEN_OAK_SEEDS, Items.GOLDEN_APPLE, "seeds", 1); + offerPieRecipe(exporter, UItems.APPLE_PIE, UItems.APPLE_PIE_SLICE, Items.WHEAT, UTags.Items.FRESH_APPLES); + + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.ROCK_STEW) + .input(UItems.ROCK, 3).criterion(hasItem(UItems.ROCK), conditionsFromItem(UItems.ROCK)) + .input(Items.BOWL) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.BOWL_OF_NUTS) + .input(UItems.ACORN, 3).criterion(hasItem(UItems.ACORN), conditionsFromItem(UItems.ACORN)) + .input(Items.BOWL) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.OATMEAL_COOKIE) + .input(UItems.OATS, 2).criterion(hasItem(UItems.OATS), conditionsFromItem(UItems.OATS)) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.CHOCOLATE_OATMEAL_COOKIE) + .input(UItems.OATS, 2) + .input(Items.COCOA_BEANS).criterion(hasItem(Items.COCOA_BEANS), conditionsFromItem(Items.COCOA_BEANS)) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.PINECONE_COOKIE) + .input(UItems.PINECONE).criterion(hasItem(UItems.PINECONE), conditionsFromItem(UItems.PINECONE)) + .input(Items.WHEAT, 2) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.SCONE) + .input(UItems.OATS).criterion(hasItem(UItems.OATS), conditionsFromItem(UItems.OATS)) + .input(Items.WHEAT, 2) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.ROCK_CANDY, 3) + .input(Items.SUGAR, 6).criterion(hasItem(Items.SUGAR), conditionsFromItem(Items.SUGAR)) + .input(UItems.PEBBLES, 3) + .offerTo(exporter); + ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, Items.BREAD) + .input('#', UItems.OATS).criterion("has_oats", conditionsFromItem(UItems.OATS)) + .pattern("###") + .offerTo(exporter, convertBetween(UItems.OATS, Items.WHEAT)); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.JUICE) + .input(Ingredient.fromTag(UTags.Items.FRESH_APPLES), 6).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.Items.FRESH_APPLES)) + .input(Items.GLASS_BOTTLE) + .group("juice") + .offerTo(exporter); + appendIngredients(ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.MUFFIN), Items.SUGAR, Items.EGG, Items.POTATO, UItems.JUICE, UItems.WHEAT_WORMS).offerTo(exporter); + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.MUG) + .input('*', Items.IRON_NUGGET).criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET)) + .input('#', UConventionalTags.Items.STICKS).criterion(hasItem(Items.STICK), conditionsFromTag(UConventionalTags.Items.STICKS)) + .pattern("# #") + .pattern("* *") + .pattern(" # ") + .offerTo(exporter); + appendIngredients(ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.CIDER), UItems.BURNED_JUICE, UItems.MUG) + .input(Ingredient.fromTag(UTags.Items.FRESH_APPLES)).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.Items.FRESH_APPLES)) + .offerTo(exporter); + + ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.HAY_FRIES) + .input('#', UItems.OATS).criterion(hasItem(UItems.OATS), conditionsFromItem(UItems.OATS)) + .pattern("#") + .pattern("#") + .pattern("#") + .offerTo(exporter); + ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.HAY_BURGER) + .input('~', Items.BREAD).criterion(hasItem(Items.BREAD), conditionsFromItem(Items.BREAD)) + .input('#', UItems.OATS).criterion(hasItem(UItems.OATS), conditionsFromItem(UItems.OATS)) + .pattern(" # ") + .pattern("~~~") + .pattern(" # ") + .offerTo(exporter); + + ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.DAFFODIL_DAISY_SANDWICH) + .input('#', Items.BREAD).criterion(hasItem(Items.BREAD), conditionsFromItem(Items.BREAD)) + .input('~', ItemTags.SMALL_FLOWERS).criterion("has_flower", conditionsFromTag(ItemTags.SMALL_FLOWERS)) + .pattern(" # ") + .pattern("~~~") + .pattern(" # ") + .offerTo(exporter); + + ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.HORSE_SHOE_FRIES, 15) + .input('#', Items.BAKED_POTATO).criterion(hasItem(Items.BAKED_POTATO), conditionsFromItem(Items.BAKED_POTATO)) + .pattern("# #") + .pattern("# #") + .pattern(" # ") + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.OATMEAL) + .input(UItems.OATS, 3).criterion(hasItem(UItems.OATS), conditionsFromItem(UItems.OATS)) + .input(ConventionalItemTags.MILK_BUCKETS) + .input(Items.BOWL) + .offerTo(exporter); + + offerSmelting(exporter, List.of(UItems.JUICE), RecipeCategory.FOOD, UItems.BURNED_JUICE, 0, 100, "juice"); + offerSmelting(exporter, List.of(Items.BREAD), RecipeCategory.FOOD, UItems.TOAST, 0.2F, 430, "bread"); + offerSmelting(exporter, List.of(UItems.TOAST), RecipeCategory.FOOD, UItems.BURNED_TOAST, 0.2F, 30, "bread"); + offerSmelting(exporter, List.of(UItems.BURNED_JUICE, UItems.BURNED_TOAST), RecipeCategory.FOOD, Items.CHARCOAL, 1, 20, "coal"); + offerSmelting(exporter, List.of(UItems.HAY_FRIES), RecipeCategory.FOOD, UItems.CRISPY_HAY_FRIES, 1F, 25, "hay_fries"); + offerSmelting(exporter, List.of(UItems.ZAP_APPLE), RecipeCategory.FOOD, UItems.COOKED_ZAP_APPLE, 1.2F, 430, "zap_apple"); + offerSmelting(exporter, List.of(Items.TROPICAL_FISH), RecipeCategory.FOOD, UItems.COOKED_TROPICAL_FISH, 1.2F, 230, "fish"); + offerSmelting(exporter, List.of(Items.PUFFERFISH), RecipeCategory.FOOD, UItems.COOKED_PUFFERFISH, 1.2F, 230, "fish"); + offerSmelting(exporter, List.of(Items.AXOLOTL_BUCKET), RecipeCategory.FOOD, UItems.FRIED_AXOLOTL, 2.2F, 230, "fried_axolotl"); + offerSmelting(exporter, List.of(UBlocks.MYSTERIOUS_EGG.asItem()), RecipeCategory.FOOD, UItems.GREEN_FRIED_EGG, 3.8F, 630, "fried_egg"); + + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.ZAP_APPLE_JAM_JAR) + .input(UItems.COOKED_ZAP_APPLE, 6).criterion(hasItem(UItems.COOKED_ZAP_APPLE), conditionsFromItem(UItems.COOKED_ZAP_APPLE)) + .input(UItems.EMPTY_JAR) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.JAM_TOAST, 8) + .input(UItems.ZAP_APPLE_JAM_JAR).criterion(hasItem(UItems.ZAP_APPLE_JAM_JAR), conditionsFromItem(UItems.ZAP_APPLE_JAM_JAR)) + .input(UItems.TOAST, 8) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.CANDIED_APPLE) + .input(UConventionalTags.Items.STICKS) + .input(UTags.Items.FRESH_APPLES).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.Items.FRESH_APPLES)) + .input(Items.SUGAR, 4) + .offerTo(exporter); + + // trick apples + offerTrickRecipe(exporter, UItems.GREEN_APPLE, Items.GREEN_DYE); + offerTrickRecipe(exporter, Items.APPLE, Items.RED_DYE); + offerTrickRecipe(exporter, UItems.SOUR_APPLE, Items.YELLOW_DYE); + offerTrickRecipe(exporter, UItems.SWEET_APPLE, Items.ORANGE_DYE); + offerTrickRecipe(exporter, UItems.ROTTEN_APPLE, Items.ROTTEN_FLESH); + offerTrickRecipe(exporter, UItems.COOKED_ZAP_APPLE, Items.SPIDER_EYE); + offerTrickRecipe(exporter, Items.GOLDEN_APPLE, Items.GOLD_NUGGET); + offerTrickRecipe(exporter, Items.ENCHANTED_GOLDEN_APPLE, Items.GOLD_INGOT); + offerTrickRecipe(exporter, UItems.MANGO, Items.LIME_DYE); + offerTrickRecipe(exporter, UItems.PINEAPPLE, UItems.PINEAPPLE_CROWN); + offerTrickRecipe(exporter, UItems.HORSE_SHOE_FRIES, UItems.IRON_HORSE_SHOE); + offerTrickRecipe(exporter, UItems.MUFFIN, UItems.ROCK); + } + + public static void offerTrickRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input) { + TrickCraftingRecipeJsonBuilder.create(RecipeCategory.FOOD, output) + .input(UItems.ZAP_APPLE).criterion(hasItem(UItems.ZAP_APPLE), conditionsFromItem(UItems.ZAP_APPLE)) + .input(input) + .offerTo(exporter, convertBetween(output, input) + "_trick"); + } + + private void offerSeaponyRecipes(RecipeExporter exporter) { + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.SHELLY) + .input('C', UItems.CLAM_SHELL).criterion("has_clam_shell", conditionsFromItem(UItems.CLAM_SHELL)) + .input('o', UItems.ROCK_CANDY) + .pattern("o o") + .pattern(" C ") + .offerTo(exporter); + ShapedRecipeJsonBuilder.create(RecipeCategory.COMBAT, UItems.PEARL_NECKLACE) + .input('#', UTags.Items.SHELLS).criterion("has_shell", conditionsFromTag(UTags.Items.SHELLS)) + .input('~', Items.STRING) + .pattern("# #") + .pattern("# #") + .pattern("~#~") + .offerTo(exporter); + } + + private void offerEarthPonyRecipes(RecipeExporter exporter) { + Arrays.stream(ItemFamilies.BASKETS).forEach(basket -> offerBasketRecipe(exporter, basket, CraftingMaterialHelper.getMaterial(basket, "_basket", "_planks"))); + Arrays.stream(ItemFamilies.HORSE_SHOES).forEach(horseshoe -> offerHorseshoeRecipe(exporter, horseshoe, CraftingMaterialHelper.getMaterial(horseshoe, "_horse_shoe", "_ingot"))); + Arrays.stream(ItemFamilies.POLEARMS).forEach(polearm -> { + if (polearm == UItems.NETHERITE_POLEARM) { + offerNetheriteUpgradeRecipe(exporter, UItems.DIAMOND_POLEARM, RecipeCategory.TOOLS, UItems.NETHERITE_POLEARM); + } else { + offerPolearmRecipe(exporter, polearm, CraftingMaterialHelper.getMaterial(polearm, "_polearm", "_ingot")); + } + }); + // weather vane + offerWeatherVaneRecipe(exporter, UBlocks.WEATHER_VANE, Items.IRON_NUGGET); + + // Giant balloons + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.GIANT_BALLOON) + .input('-', ItemTags.WOOL_CARPETS).criterion("has_carpet", conditionsFromTag(ItemTags.WOOL_CARPETS)) + .input('#', ItemTags.WOOL).criterion("has_wool", conditionsFromTag(ItemTags.WOOL)) + .pattern("---") + .pattern("# #") + .pattern("---") + .offerTo(exporter); + + // worms + offerReversibleCompactingRecipes(exporter, RecipeCategory.BUILDING_BLOCKS, UItems.WHEAT_WORMS, RecipeCategory.BUILDING_BLOCKS, UBlocks.WORM_BLOCK); + // fishing + ShapelessRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.BAITED_FISHING_ROD) + .input(Items.FISHING_ROD).criterion(hasItem(Items.FISHING_ROD), conditionsFromItem(Items.FISHING_ROD)) + .input(UItems.WHEAT_WORMS) + .group("fishing_rod") + .offerTo(exporter); + + // utility + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, Items.DIRT) + .input('*', UItems.WHEAT_WORMS).criterion("has_wheat_worms", conditionsFromItem(UItems.WHEAT_WORMS)) + .input('#', ItemTags.SAND).criterion("has_sand", conditionsFromTag(ItemTags.SAND)) + .pattern("*#") + .pattern("#*") + .offerTo(exporter, convertBetween(Items.DIRT, UItems.WHEAT_WORMS)); + + offerShapelessRecipe(exporter, Items.BONE_MEAL, UTags.Items.SHELLS, "bonemeal", 3); + + // pegasus feathers for non pegasi + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.PEGASUS_FEATHER) + .input('*', Items.GHAST_TEAR).criterion("has_ghast_tear", conditionsFromItem(Items.GHAST_TEAR)) + .input('#', UItems.GRYPHON_FEATHER).criterion("has_feather", conditionsFromItem(UItems.GRYPHON_FEATHER)) + .pattern("***") + .pattern("*#*") + .pattern("***") + .offerTo(exporter); + + offer2x2CompactingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, Items.COBBLESTONE, UItems.ROCK); + offerReversibleCompactingRecipesWithReverseRecipeGroup(exporter, RecipeCategory.MISC, UItems.PEBBLES, RecipeCategory.BUILDING_BLOCKS, Blocks.GRAVEL, convertBetween(UItems.PEBBLES, Blocks.GRAVEL), "pebbles"); + offerShapelessRecipe(exporter, UItems.PEBBLES, Blocks.SUSPICIOUS_GRAVEL, "pebbles", 9); + offerSmelting(exporter, List.of(UItems.GOLDEN_OAK_SEEDS, UItems.GOLDEN_FEATHER), RecipeCategory.MISC, Items.GOLD_NUGGET, 3F, 10, "gold_nugget"); + + offerGrowing(exporter, UBlocks.CURING_JOKE, Blocks.LAPIS_BLOCK, Blocks.CORNFLOWER); + offerGrowing(exporter, UBlocks.GOLD_ROOT, Blocks.RAW_GOLD_BLOCK, Blocks.CARROTS); + offerGrowing(exporter, UTreeGen.GOLDEN_APPLE_TREE.sapling().get(), Blocks.RAW_GOLD_BLOCK, Blocks.OAK_SAPLING); + offerGrowing(exporter, UBlocks.PLUNDER_VINE_BUD, Blocks.NETHERRACK, Blocks.WITHER_ROSE); + offerGrowing(exporter, UTreeGen.ZAP_APPLE_TREE.sapling().get(), UBlocks.CHITIN, Blocks.DARK_OAK_SAPLING); + } + + private static ShapelessRecipeJsonBuilder appendIngredients(ShapelessRecipeJsonBuilder builder, ItemConvertible...ingredients) { + for (ItemConvertible ingredient : ingredients) { + builder.input(ingredient).criterion(hasItem(ingredient), conditionsFromItem(ingredient)); + } + return builder; + } + + public static void offerShapelessRecipe(RecipeExporter exporter, ItemConvertible output, TagKey input, @Nullable String group, int outputCount) { + ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, output, outputCount) + .input(input).criterion(CraftingMaterialHelper.hasTag(input), conditionsFromTag(input)) + .group(group) + .offerTo(exporter, getItemPath(output) + "_from_" + input.id().getPath()); + } + + public static void offerPieRecipe(RecipeExporter exporter, ItemConvertible pie, ItemConvertible slice, ItemConvertible crust, TagKey filling) { + ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, pie) + .input('*', crust).criterion("has_crust", conditionsFromItem(crust)) + .input('#', filling).criterion("has_filling", conditionsFromTag(filling)) + .pattern("***") + .pattern("###") + .pattern("***") + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, pie) + .input(slice, 4) + .criterion(hasItem(slice), conditionsFromItem(slice)) + .offerTo(exporter, getItemPath(pie) + "_from_" + getItemPath(slice)); + } + + public static void offerBasketRecipe(RecipeExporter exporter, ItemConvertible output, Either> input) { + CraftingMaterialHelper.input(ShapedRecipeJsonBuilder.create(RecipeCategory.TRANSPORTATION, output), '#', input) + .criterion(CraftingMaterialHelper.hasEither(input), CraftingMaterialHelper.conditionsFromEither(input)) + .pattern("# #") + .pattern("# #") + .pattern("###") + .group("basket") + .offerTo(exporter); + } + + public static void offerHorseshoeRecipe(RecipeExporter exporter, ItemConvertible output, Either> input) { + CraftingMaterialHelper + .input(ShapedRecipeJsonBuilder.create(RecipeCategory.COMBAT, output), '#', input) + .criterion(CraftingMaterialHelper.hasEither(input), CraftingMaterialHelper.conditionsFromEither(input)) + .pattern("# #") + .pattern("# #") + .pattern(" # ") + .group("horseshoe") + .offerTo(exporter); + } + + public static void offerHiveRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible chitin, ItemConvertible egg) { + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, output) + .input('#', chitin) + .input('o', egg).criterion(hasItem(egg), conditionsFromItem(egg)) + .pattern(" # ") + .pattern("#o#") + .pattern(" # ") + .group("chitin") + .offerTo(exporter); + } + + public static void offerPolearmRecipe(RecipeExporter exporter, ItemConvertible output, Either> input) { + CraftingMaterialHelper + .input(ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, output), 'o', input).criterion(CraftingMaterialHelper.hasEither(input), CraftingMaterialHelper.conditionsFromEither(input)) + .input('#', UConventionalTags.Items.STICKS) + .pattern(" o") + .pattern(" # ") + .pattern("# ") + .group("polearm") + .offerTo(exporter); + } + + public static void offerHullRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible outside, ItemConvertible inside) { + ShapedRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, output, 4) + .input('#', outside).criterion(hasItem(outside), conditionsFromItem(outside)) + .input('o', inside).criterion(hasItem(inside), conditionsFromItem(inside)) + .pattern("##") + .pattern("oo") + .group("hull") + .offerTo(exporter); + } + + public static void offerSpikesRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input) { + ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output, 8) + .input('#', input).criterion(hasItem(input), conditionsFromItem(input)) + .pattern(" # ") + .pattern("###") + .group("spikes") + .offerTo(exporter); + } + + public static void offerChestRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input) { + ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output) + .input('#', input) + .pattern("###") + .pattern("# #") + .pattern("###") + .criterion("has_lots_of_items", Criteria.INVENTORY_CHANGED.create(new InventoryChangedCriterion.Conditions( + Optional.empty(), + new InventoryChangedCriterion.Conditions.Slots(NumberRange.IntRange.atLeast(10), NumberRange.IntRange.ANY, NumberRange.IntRange.ANY), + List.of()))) + .offerTo(exporter); + } + + public static void offer2x3Recipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input, String group) { + createDoorRecipe(output, Ingredient.ofItems(input)) + .criterion(hasItem(input), conditionsFromItem(input)) + .group(group) + .offerTo(exporter); + } + + public static void offerStableDoorRecipe(RecipeExporter exporter, ItemConvertible output, Either> body, ItemConvertible trim) { + CraftingMaterialHelper + .input(ShapedRecipeJsonBuilder.create(RecipeCategory.REDSTONE, output, 3), '#', body).criterion(CraftingMaterialHelper.hasEither(body), CraftingMaterialHelper.conditionsFromEither(body)) + .input('*', trim).criterion(hasItem(trim), conditionsFromItem(trim)) + .pattern("*#*") + .pattern("*#*") + .pattern("*#*") + .group("stable_door") + .offerTo(exporter); + } + + public static void offerWeatherVaneRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input) { + ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output) + .input('*', input).criterion(hasItem(input), conditionsFromItem(input)) + .pattern(" **") + .pattern("** ") + .pattern(" * ") + .offerTo(exporter); + } + + public static ShapedRecipeJsonBuilder createCustomBedRecipe(ItemConvertible output, Either> input, Either> planks) { + var builder = ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output); + CraftingMaterialHelper.input(builder, '#', input).criterion(CraftingMaterialHelper.hasEither(input), CraftingMaterialHelper.conditionsFromEither(input)); + return CraftingMaterialHelper.input(builder, 'X', planks) + .pattern("###") + .pattern("XXX") + .group("bed"); + } + + private void offerBedSheetRecipes(RecipeExporter exporter) { + PatternTemplate.ONE_COLOR.offerWithoutConversion(exporter, UItems.KELP_BED_SHEETS, Items.KELP); + WOOLS.forEach(wool -> PatternTemplate.ONE_COLOR.offerTo(exporter, CraftingMaterialHelper.getItem(Unicopia.id(Registries.ITEM.getId(wool).getPath().replace("_wool", "_bed_sheets"))), wool)); + + PatternTemplate.TWO_COLOR.offerTo(exporter, UItems.APPLE_BED_SHEETS, Items.GREEN_WOOL, Items.LIME_WOOL); + PatternTemplate.TWO_COLOR.offerTo(exporter, UItems.BARRED_BED_SHEETS, Items.LIGHT_BLUE_WOOL, Items.WHITE_WOOL); + PatternTemplate.TWO_COLOR.offerTo(exporter, UItems.CHECKERED_BED_SHEETS, Items.GREEN_WOOL, Items.BROWN_WOOL); + PatternTemplate.THREE_COLOR.offerTo(exporter, UItems.RAINBOW_PWR_BED_SHEETS, Items.WHITE_WOOL, Items.PINK_WOOL, Items.RED_WOOL); + PatternTemplate.THREE_COLOR.offerTo(exporter, UItems.RAINBOW_BPY_BED_SHEETS, Items.PINK_WOOL, Items.YELLOW_WOOL, Items.LIGHT_BLUE_WOOL); + PatternTemplate.THREE_COLOR.offerTo(exporter, UItems.RAINBOW_BPW_BED_SHEETS, Items.PINK_WOOL, Items.LIGHT_BLUE_WOOL, Items.WHITE_WOOL); + PatternTemplate.FOUR_COLOR.offerTo(exporter, UItems.RAINBOW_PBG_BED_SHEETS, Items.PURPLE_WOOL, Items.WHITE_WOOL, Items.LIGHT_GRAY_WOOL, Items.BLACK_WOOL); + PatternTemplate.SEVEN_COLOR.offerTo(exporter, UItems.RAINBOW_BED_SHEETS, UItems.RAINBOW_BED_SHEETS, Items.LIGHT_BLUE_WOOL, Items.RED_WOOL, Items.ORANGE_WOOL, Items.YELLOW_WOOL, Items.BLUE_WOOL, Items.GREEN_WOOL, Items.PURPLE_WOOL); + } + + public static void offerCompactingRecipe(RecipeExporter exporter, RecipeCategory category, ItemConvertible output, ItemConvertible input, int resultCount) { + offerCompactingRecipe(exporter, category, output, input, hasItem(input), resultCount); + } + + public static void offerCompactingRecipe(RecipeExporter exporter, RecipeCategory category, ItemConvertible output, ItemConvertible input, String criterionName, int resultCount) { + ShapelessRecipeJsonBuilder.create(category, output, resultCount) + .input(input, 9).criterion(criterionName, conditionsFromItem(input)) + .offerTo(exporter); + } + + public static void offerWaxingRecipes(RecipeExporter exporter) { + UBlockFamilies.WAXED_ZAP.getVariants().forEach((variant, output) -> { + Block input = UBlockFamilies.ZAP.getVariant(variant); + offerWaxingRecipe(exporter, output, input); + }); + offerWaxingRecipe(exporter, UBlocks.WAXED_ZAP_PLANKS, UBlocks.ZAP_PLANKS); + offerWaxingRecipe(exporter, UBlocks.WAXED_ZAP_LOG, UBlocks.ZAP_LOG); + offerWaxingRecipe(exporter, UBlocks.WAXED_ZAP_WOOD, UBlocks.ZAP_WOOD); + offerWaxingRecipe(exporter, UBlocks.WAXED_STRIPPED_ZAP_LOG, UBlocks.STRIPPED_ZAP_LOG); + offerWaxingRecipe(exporter, UBlocks.WAXED_STRIPPED_ZAP_WOOD, UBlocks.STRIPPED_ZAP_WOOD); + } + + public static void offerWaxingRecipe(RecipeExporter exporter, ItemConvertible output, ItemConvertible input) { + ShapelessRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, output) + .input(Items.HONEYCOMB) + .input(input).criterion(hasItem(input), conditionsFromItem(input)) + .group(getItemPath(output)) + .offerTo(exporter, convertBetween(output, Items.HONEYCOMB)); + } + + public static void offerCloudShapingRecipe(RecipeExporter exporter, RecipeCategory category, ItemConvertible output, ItemConvertible input) { + offerCloudShapingRecipe(exporter, category, output, input, 1); + } + + public static void offerCloudShapingRecipe(RecipeExporter exporter, RecipeCategory category, ItemConvertible output, ItemConvertible input, int count) { + CraftingMaterialHelper.createCloudShaping(Ingredient.ofItems(input), category, output, count) + .criterion(RecipeProvider.hasItem(input), RecipeProvider.conditionsFromItem(input)) + .offerTo(exporter, RecipeProvider.convertBetween(output, input) + "_cloud_shaping"); + } + + public static void offerGrowing(RecipeExporter exporter, Block output, Block fuel, Block target) { + GrowingRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output.getDefaultState()) + .fuel(fuel.getDefaultState()) + .target(target).criterion(hasItem(target), conditionsFromItem(target)) + .offerTo(exporter); + } + + public void offerSpell(RecipeExporter exporter, ItemConvertible gemstone, SpellType output, SpellTraits.Builder traits) { + SpellcraftingRecipeJsonBuilder.create(RecipeCategory.MISC, gemstone, output) + .traits(traits) + .offerTo(exporter); + } + + public void offerSpellFromSpell(RecipeExporter exporter, ItemConvertible gemstone, SpellType output, SpellType input, SpellTraits.Builder traits) { + SpellcraftingRecipeJsonBuilder.create(RecipeCategory.MISC, gemstone, output) + .input(gemstone, input) + .traits(traits) + .offerTo(exporter); + } + + public void offerSpellFromTwoSpells(RecipeExporter exporter, ItemConvertible gemstone, SpellType output, SpellType input1, SpellType input2, SpellTraits.Builder traits) { + SpellcraftingRecipeJsonBuilder.create(RecipeCategory.MISC, gemstone, output) + .input(gemstone, input1) + .input(gemstone, input2) + .traits(traits) + .offerTo(exporter); + } + + public static AdvancementCriterion conditionsFromMultipleItems(ItemConvertible... items) { + return conditionsFromItemPredicates( + Stream.of(items).map(item -> ItemPredicate.Builder.create().items(item).build()).toArray(ItemPredicate[]::new) + ); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockTagProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UBlockTagProvider.java similarity index 79% rename from src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockTagProvider.java rename to src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UBlockTagProvider.java index 2deff29f..a576582d 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockTagProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UBlockTagProvider.java @@ -1,7 +1,9 @@ -package com.minelittlepony.unicopia.datagen.providers; +package com.minelittlepony.unicopia.datagen.providers.tag; +import java.util.Arrays; import java.util.concurrent.CompletableFuture; +import com.minelittlepony.unicopia.UConventionalTags; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.block.UBlocks; @@ -12,12 +14,14 @@ import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; import net.fabricmc.fabric.api.tag.convention.v1.ConventionalBlockTags; import net.minecraft.block.Block; import net.minecraft.block.Blocks; +import net.minecraft.registry.Registries; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.RegistryWrapper.WrapperLookup; import net.minecraft.registry.tag.BlockTags; import net.minecraft.registry.tag.TagBuilder; import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.DyeColor; import net.minecraft.util.Identifier; public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { @@ -32,6 +36,7 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { @Override protected void configure(WrapperLookup registries) { + populateConventionalTags(); Block[] crops = { UBlocks.OATS, UBlocks.OATS_STEM, UBlocks.OATS_CROWN, UBlocks.ROCKS, UBlocks.PINEAPPLE, @@ -39,15 +44,18 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { UBlocks.GOLDEN_OAK_SPROUT }; - getOrCreateTagBuilder(UTags.CATAPULT_IMMUNE).add(Blocks.BEDROCK).forceAddTag(BlockTags.DOORS).forceAddTag(BlockTags.TRAPDOORS); + getOrCreateTagBuilder(UTags.Blocks.CATAPULT_IMMUNE).add(Blocks.BEDROCK).forceAddTag(BlockTags.DOORS).forceAddTag(BlockTags.TRAPDOORS); + getOrCreateTagBuilder(UTags.Blocks.BUTTERFLIES_SPAWNABLE_ON).forceAddTag(BlockTags.ANIMALS_SPAWNABLE_ON).forceAddTag(BlockTags.LEAVES).forceAddTag(BlockTags.FLOWERS).forceAddTag(BlockTags.FLOWER_POTS); + getOrCreateTagBuilder(UTags.Blocks.JARS).add(UBlocks.JAR, UBlocks.CLOUD_JAR, UBlocks.STORM_JAR, UBlocks.LIGHTNING_JAR, UBlocks.ZAP_JAR); getOrCreateTagBuilder(BlockTags.CROPS).add(crops); getOrCreateTagBuilder(BlockTags.BEE_GROWABLES).add(crops); getOrCreateTagBuilder(BlockTags.MAINTAINS_FARMLAND).add(crops); getOrCreateTagBuilder(BlockTags.NEEDS_DIAMOND_TOOL).add(UBlocks.FROSTED_OBSIDIAN); - getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE).add(UBlocks.ROCKS, UBlocks.FROSTED_OBSIDIAN, UBlocks.WEATHER_VANE); + getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE).add(UBlocks.ROCKS, UBlocks.FROSTED_OBSIDIAN, UBlocks.WEATHER_VANE).forceAddTag(UTags.Blocks.JARS); getOrCreateTagBuilder(BlockTags.DRAGON_IMMUNE).add(UBlocks.FROSTED_OBSIDIAN, UBlocks.GOLDEN_OAK_LOG, UBlocks.GOLDEN_OAK_LEAVES); getOrCreateTagBuilder(BlockTags.FIRE).add(UBlocks.SPECTRAL_FIRE); getOrCreateTagBuilder(BlockTags.HOE_MINEABLE).add(UBlocks.HAY_BLOCK).addOptional(Unicopia.id("rice_block")).addOptional(Unicopia.id("straw_block")); + getOrCreateTagBuilder(BlockTags.SHOVEL_MINEABLE).add(UBlocks.WORM_BLOCK); addZapWoodset(); addPalmWoodset(); @@ -55,30 +63,31 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { addChitinBlocksets(); addFruitTrees(); - getOrCreateTagBuilder(UTags.CRYSTAL_HEART_BASE).add( + getOrCreateTagBuilder(UTags.Blocks.CRYSTAL_HEART_BASE).add( Blocks.DIAMOND_BLOCK, Blocks.QUARTZ_BLOCK, Blocks.QUARTZ_BRICKS, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_STAIRS, Blocks.QUARTZ_PILLAR, Blocks.SMOOTH_QUARTZ, Blocks.SMOOTH_QUARTZ_SLAB, Blocks.SMOOTH_QUARTZ_STAIRS, Blocks.CHISELED_QUARTZ_BLOCK, Blocks.AMETHYST_BLOCK, Blocks.NETHERITE_BLOCK, Blocks.EMERALD_BLOCK ); - getOrCreateTagBuilder(UTags.CRYSTAL_HEART_ORNAMENT).add(Blocks.END_ROD); + getOrCreateTagBuilder(UTags.Blocks.CRYSTAL_HEART_ORNAMENT).add(Blocks.END_ROD); - getOrCreateTagBuilder(UTags.FRAGILE) + getOrCreateTagBuilder(UTags.Blocks.FRAGILE) .forceAddTag(ConventionalBlockTags.GLASS_BLOCKS) .forceAddTag(ConventionalBlockTags.GLASS_PANES) + .forceAddTag(UTags.Blocks.JARS) .add(Blocks.VINE, Blocks.LILY_PAD); - getOrCreateTagBuilder(UTags.INTERESTING).add( + getOrCreateTagBuilder(UTags.Blocks.INTERESTING).add( Blocks.SEA_LANTERN, Blocks.ENDER_CHEST, Blocks.END_PORTAL_FRAME, Blocks.JUKEBOX, Blocks.SPAWNER ).forceAddTag(ConventionalBlockTags.ORES); - getOrCreateTagBuilder(UTags.KICKS_UP_DUST).forceAddTag(BlockTags.SAND).add( + getOrCreateTagBuilder(UTags.Blocks.KICKS_UP_DUST).forceAddTag(BlockTags.SAND).add( Blocks.SUSPICIOUS_SAND, Blocks.GRAVEL, Blocks.SUSPICIOUS_GRAVEL ).forceAddTag(TagKey.of(RegistryKeys.BLOCK, new Identifier("c", "concrete_powders"))); - getOrCreateTagBuilder(UTags.UNAFFECTED_BY_GROW_ABILITY).add(Blocks.GRASS_BLOCK); + getOrCreateTagBuilder(UTags.Blocks.UNAFFECTED_BY_GROW_ABILITY).add(Blocks.GRASS_BLOCK); } private void addFruitTrees() { @@ -103,7 +112,7 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { private void addZapWoodset() { getOrCreateTagBuilder(BlockTags.LEAVES).add(UBlocks.ZAP_LEAVES, UBlocks.FLOWERING_ZAP_LEAVES); - getOrCreateTagBuilder(UTags.POLEARM_MINEABLE).add( + getOrCreateTagBuilder(UTags.Blocks.POLEARM_MINEABLE).add( UBlocks.ZAP_LEAVES, UBlocks.FLOWERING_ZAP_LEAVES, UBlocks.ZAP_PLANKS, UBlocks.ZAP_LOG, UBlocks.ZAP_WOOD, UBlocks.STRIPPED_ZAP_LOG, UBlocks.STRIPPED_ZAP_WOOD, @@ -201,4 +210,13 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { getOrCreateTagBuilder(BlockTags.CEILING_HANGING_SIGNS).add(hanging); getOrCreateTagBuilder(BlockTags.WALL_HANGING_SIGNS).add(wallHanging); } + + private void populateConventionalTags() { + getOrCreateTagBuilder(UConventionalTags.Blocks.CONCRETES).add(Arrays.stream(DyeColor.values()).map(i -> Registries.BLOCK.get(new Identifier(i.getName() + "_concrete"))).toArray(Block[]::new)); + getOrCreateTagBuilder(UConventionalTags.Blocks.CONCRETE_POWDERS).add(Arrays.stream(DyeColor.values()).map(i -> Registries.BLOCK.get(new Identifier(i.getName() + "_concrete_powder"))).toArray(Block[]::new)); + getOrCreateTagBuilder(UConventionalTags.Blocks.GLAZED_TERRACOTTAS).add(Arrays.stream(DyeColor.values()).map(i -> Registries.BLOCK.get(new Identifier(i.getName() + "_glazed_terracotta"))).toArray(Block[]::new)); + getOrCreateTagBuilder(UConventionalTags.Blocks.CORAL_BLOCKS).add(Blocks.TUBE_CORAL_BLOCK, Blocks.BRAIN_CORAL_BLOCK, Blocks.BUBBLE_CORAL_BLOCK, Blocks.FIRE_CORAL_BLOCK, Blocks.HORN_CORAL_BLOCK); + getOrCreateTagBuilder(UConventionalTags.Blocks.CORAL_FANS).add(Blocks.TUBE_CORAL_FAN, Blocks.BRAIN_CORAL_FAN, Blocks.BUBBLE_CORAL_FAN, Blocks.FIRE_CORAL_FAN, Blocks.HORN_CORAL_FAN); + getOrCreateTagBuilder(UConventionalTags.Blocks.CORALS).add(Blocks.TUBE_CORAL, Blocks.BRAIN_CORAL, Blocks.BUBBLE_CORAL, Blocks.FIRE_CORAL, Blocks.HORN_CORAL); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UDamageTypeProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UDamageTypeProvider.java new file mode 100644 index 00000000..d0b265b1 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UDamageTypeProvider.java @@ -0,0 +1,30 @@ +package com.minelittlepony.unicopia.datagen.providers.tag; + +import java.util.concurrent.CompletableFuture; + +import com.minelittlepony.unicopia.UTags; +import com.minelittlepony.unicopia.entity.damage.UDamageTypes; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.entity.damage.DamageType; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper.WrapperLookup; +import net.minecraft.registry.tag.DamageTypeTags; + +public class UDamageTypeProvider extends FabricTagProvider { + public UDamageTypeProvider(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, RegistryKeys.DAMAGE_TYPE, registriesFuture); + } + + @Override + protected void configure(WrapperLookup lookup) { + getOrCreateTagBuilder(UTags.DamageTypes.SPELLBOOK_IMMUNE_TO).add( + UDamageTypes.ZAP_APPLE, UDamageTypes.LOVE_DRAINING, UDamageTypes.LIFE_DRAINING, + UDamageTypes.RAINBOOM, UDamageTypes.SUN, UDamageTypes.SUNLIGHT, UDamageTypes.SMASH + ).forceAddTag(DamageTypeTags.IS_FALL).forceAddTag(DamageTypeTags.IS_FREEZING).forceAddTag(DamageTypeTags.IS_LIGHTNING).forceAddTag(DamageTypeTags.IS_PROJECTILE); + getOrCreateTagBuilder(UTags.DamageTypes.FROM_ROCKS).add(UDamageTypes.ROCK); + getOrCreateTagBuilder(UTags.DamageTypes.FROM_HORSESHOES).add(UDamageTypes.HORSESHOE); + getOrCreateTagBuilder(UTags.DamageTypes.BREAKS_SUNGLASSES).add(UDamageTypes.BAT_SCREECH, UDamageTypes.RAINBOOM); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UItemTagProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UItemTagProvider.java new file mode 100644 index 00000000..4ee54051 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UItemTagProvider.java @@ -0,0 +1,348 @@ +package com.minelittlepony.unicopia.datagen.providers.tag; + +import java.util.Objects; +import java.util.concurrent.CompletableFuture; + +import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.UConventionalTags; +import com.minelittlepony.unicopia.UTags; +import com.minelittlepony.unicopia.block.UBlocks; +import com.minelittlepony.unicopia.datagen.Datagen; +import com.minelittlepony.unicopia.datagen.ItemFamilies; +import com.minelittlepony.unicopia.item.BedsheetsItem; +import com.minelittlepony.unicopia.item.UItems; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.RegistryWrapper.WrapperLookup; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.registry.tag.TagBuilder; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +public class UItemTagProvider extends FabricTagProvider.ItemTagProvider { + + + private final UBlockTagProvider blockTagProvider; + + public UItemTagProvider(FabricDataOutput output, CompletableFuture registriesFuture, UBlockTagProvider blockTagProvider) { + super(output, registriesFuture, blockTagProvider); + this.blockTagProvider = blockTagProvider; + } + + @Override + public void copy(TagKey blockTag, TagKey itemTag) { + TagBuilder blockTagBuilder = Objects.requireNonNull(blockTagProvider, "Pass Block tag provider via constructor to use copy").getTagBuilder(blockTag); + TagBuilder itemTagBuilder = getTagBuilder(itemTag); + blockTagBuilder.build().forEach(entry -> { + if (entry.canAdd(Registries.ITEM::containsId, tagId -> getTagBuilder(TagKey.of(RegistryKeys.ITEM, tagId)) != null)) { + itemTagBuilder.add(entry); + } else { + Datagen.LOGGER.warn("Cannot copy missing entry {} to item tag {}", entry, itemTag.id()); + } + }); + } + + @Override + protected void configure(WrapperLookup arg) { + copyBlockTags(); + exportConventionalTags(); + getOrCreateTagBuilder(ItemTags.BOOKSHELF_BOOKS).add(UItems.SPELLBOOK); + getOrCreateTagBuilder(ItemTags.BEDS).add(UItems.CLOTH_BED, UItems.CLOUD_BED); + + getOrCreateTagBuilder(ItemTags.CHEST_BOATS).add(UItems.PALM_CHEST_BOAT); + getOrCreateTagBuilder(ItemTags.BOATS).add(UItems.PALM_BOAT); + getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(ItemFamilies.MUSIC_DISCS); + getOrCreateTagBuilder(ItemTags.CREEPER_DROP_MUSIC_DISCS).add(UItems.MUSIC_DISC_CRUSADE, UItems.MUSIC_DISC_FUNK, UItems.MUSIC_DISC_PET, UItems.MUSIC_DISC_POPULAR); + + getOrCreateTagBuilder(ItemTags.SIGNS).add(UBlocks.PALM_SIGN.asItem()); + getOrCreateTagBuilder(ItemTags.HANGING_SIGNS).add(UBlocks.PALM_HANGING_SIGN.asItem()); + + getOrCreateTagBuilder(UTags.Items.HORSE_SHOES).add(ItemFamilies.HORSE_SHOES); + getOrCreateTagBuilder(UTags.Items.POLEARMS).add(ItemFamilies.POLEARMS); + + getOrCreateTagBuilder(ItemTags.TOOLS).addTag(UTags.Items.HORSE_SHOES).addTag(UTags.Items.POLEARMS); + + getOrCreateTagBuilder(UTags.Items.BASKETS).add(ItemFamilies.BASKETS); + getOrCreateTagBuilder(UTags.Items.BADGES).add(Race.REGISTRY.stream() + .map(race -> race.getId().withPath(p -> p + "_badge")) + .flatMap(id -> Registries.ITEM.getOrEmpty(id).stream()) + .toArray(Item[]::new)); + getOrCreateTagBuilder(UTags.Items.WOOL_BED_SHEETS).add(BedsheetsItem.ITEMS.values().stream().filter(sheet -> sheet != UItems.KELP_BED_SHEETS).toArray(Item[]::new)); + getOrCreateTagBuilder(UTags.Items.BED_SHEETS).forceAddTag(UTags.Items.WOOL_BED_SHEETS).add(UItems.KELP_BED_SHEETS); + getOrCreateTagBuilder(UTags.Items.APPLE_SEEDS).add(UItems.GREEN_APPLE_SEEDS, UItems.SWEET_APPLE_SEEDS, UItems.SOUR_APPLE_SEEDS); + getOrCreateTagBuilder(UTags.Items.MAGIC_FEATHERS).add(UItems.PEGASUS_FEATHER, UItems.GRYPHON_FEATHER); + getOrCreateTagBuilder(UTags.Items.FRESH_APPLES).add(Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE); + getOrCreateTagBuilder(UTags.Items.CLOUD_JARS).add(UItems.RAIN_CLOUD_JAR, UItems.STORM_CLOUD_JAR); + getOrCreateTagBuilder(UTags.Items.PIES).add(UItems.APPLE_PIE, UItems.APPLE_PIE_HOOF); + + // technical tags + getOrCreateTagBuilder(ItemTags.VILLAGER_PLANTABLE_SEEDS).addTag(UTags.Items.APPLE_SEEDS); + getOrCreateTagBuilder(UTags.Items.CAN_CUT_PIE).forceAddTag(ConventionalItemTags.SHEARS).addOptionalTag(UConventionalTags.Items.TOOL_KNIVES); + getOrCreateTagBuilder(UTags.Items.COOLS_OFF_KIRINS).add(Items.MELON_SLICE, UItems.JUICE).forceAddTag(ConventionalItemTags.WATER_BUCKETS); + getOrCreateTagBuilder(UTags.Items.FALLS_SLOWLY).add(Items.FEATHER, UItems.CLOUD_LUMP).forceAddTag(UTags.Items.MAGIC_FEATHERS); + getOrCreateTagBuilder(UTags.Items.IS_DELIVERED_AGGRESSIVELY).forceAddTag(ItemTags.ANVIL); + getOrCreateTagBuilder(UTags.Items.SPOOKED_MOB_DROPS).add(Items.BRICK); + getOrCreateTagBuilder(UTags.Items.SHADES).add( + Items.CARVED_PUMPKIN, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL, Items.PLAYER_HEAD, + Items.ZOMBIE_HEAD, Items.CREEPER_HEAD, Items.DRAGON_HEAD, Items.PIGLIN_HEAD, + UItems.SUNGLASSES + ); + getOrCreateTagBuilder(UTags.Items.FLOATS_ON_CLOUDS) + .forceAddTag(UTags.Items.CLOUD_BEDS) + .forceAddTag(UTags.Items.CLOUD_SLABS) + .forceAddTag(UTags.Items.CLOUD_STAIRS) + .forceAddTag(UTags.Items.CLOUD_BLOCKS) + .add(UItems.CLOUD_LUMP); + getOrCreateTagBuilder(UTags.Items.CONTAINER_WITH_LOVE).add(UItems.LOVE_BOTTLE, UItems.LOVE_BUCKET, UItems.LOVE_MUG); + getOrCreateTagBuilder(UTags.Items.HAS_NO_TRAITS).add( + Items.AIR, Items.SPAWNER, Items.STRUCTURE_VOID, Items.STRUCTURE_BLOCK, + Items.COMMAND_BLOCK, Items.CHAIN_COMMAND_BLOCK, Items.REPEATING_COMMAND_BLOCK, + Items.LIGHT, Items.JIGSAW, Items.BARRIER, Items.BEDROCK, Items.END_PORTAL_FRAME, + Items.DEBUG_STICK, Items.COMMAND_BLOCK_MINECART, + UItems.PLUNDER_VINE + ).forceAddTag(UTags.Items.BADGES); + getOrCreateTagBuilder(UTags.Items.LOOT_BUG_COMMON_DROPS).forceAddTag(ConventionalItemTags.NUGGETS); + getOrCreateTagBuilder(UTags.Items.LOOT_BUG_RARE_DROPS).add( + Items.DIAMOND, Items.GOLDEN_APPLE, Items.GOLDEN_CARROT, + Items.GOLDEN_HELMET, Items.GOLDEN_BOOTS, Items.GOLDEN_LEGGINGS, Items.GOLDEN_CHESTPLATE, + Items.GOLDEN_HORSE_ARMOR, + Items.GOLDEN_PICKAXE, Items.GOLDEN_SHOVEL, Items.GOLDEN_AXE, Items.GOLDEN_SWORD, Items.GOLDEN_HOE, + UItems.GOLDEN_HORSE_SHOE, UItems.GOLDEN_POLEARM, UItems.GOLDEN_FEATHER, UItems.GOLDEN_WING, + UItems.GOLDEN_OAK_SEEDS + ).forceAddTag(ConventionalItemTags.GOLD_INGOTS).forceAddTag(ConventionalItemTags.RAW_GOLD_ORES).forceAddTag(ConventionalItemTags.RAW_GOLD_BLOCKS) + .addOptionalTag(new Identifier("farmersdelight:golden_knife")); + getOrCreateTagBuilder(UTags.Items.LOOT_BUG_EPIC_DROPS).add( + Items.DIAMOND_BLOCK, + Items.DIAMOND_HELMET, Items.DIAMOND_BOOTS, Items.DIAMOND_LEGGINGS, Items.DIAMOND_CHESTPLATE, + Items.DIAMOND_HORSE_ARMOR, + Items.DIAMOND_PICKAXE, Items.DIAMOND_SHOVEL, Items.DIAMOND_AXE, Items.DIAMOND_SWORD, Items.DIAMOND_HOE, + UItems.DIAMOND_POLEARM + ).forceAddTag(UTags.Items.BADGES).forceAddTag(ConventionalItemTags.GOLD_INGOTS); + getOrCreateTagBuilder(UTags.Items.SHELLS).add(Items.NAUTILUS_SHELL, UItems.CLAM_SHELL, UItems.SCALLOP_SHELL, UItems.TURRET_SHELL); + getOrCreateTagBuilder(UTags.Items.SPECIAL_SHELLS).add(UItems.SHELLY); + getOrCreateTagBuilder(UTags.Items.ROCK_STEWS).add(UItems.ROCK_STEW); + getOrCreateTagBuilder(UTags.Items.HIGH_QUALITY_SEA_VEGETABLES) + .add(Items.DRIED_KELP_BLOCK, Items.GLOW_LICHEN) + .forceAddTag(UConventionalTags.Items.CORAL_BLOCKS); + getOrCreateTagBuilder(UTags.Items.LOW_QUALITY_SEA_VEGETABLES) + .add(Items.KELP, Items.DRIED_KELP, Items.SEAGRASS, Items.SEA_PICKLE) + .forceAddTag(UConventionalTags.Items.CORALS).forceAddTag(UConventionalTags.Items.CORAL_FANS); + + exportForagingTags(); + exportFarmersDelightItems(); + } + + private void copyBlockTags() { + copy(BlockTags.LEAVES, ItemTags.LEAVES); + copy(BlockTags.LOGS_THAT_BURN, ItemTags.LOGS_THAT_BURN); + copy(BlockTags.LOGS, ItemTags.LOGS); + copy(BlockTags.PLANKS, ItemTags.PLANKS); + copy(BlockTags.WOODEN_BUTTONS, ItemTags.WOODEN_BUTTONS); + copy(BlockTags.WOODEN_DOORS, ItemTags.WOODEN_DOORS); + copy(BlockTags.FENCE_GATES, ItemTags.FENCE_GATES); + copy(BlockTags.WOODEN_FENCES, ItemTags.WOODEN_FENCES); + copy(BlockTags.WOODEN_PRESSURE_PLATES, ItemTags.WOODEN_PRESSURE_PLATES); + copy(BlockTags.SLABS, ItemTags.SLABS); + copy(BlockTags.WOODEN_SLABS, ItemTags.WOODEN_SLABS); + copy(BlockTags.STAIRS, ItemTags.STAIRS); + copy(BlockTags.WOODEN_STAIRS, ItemTags.WOODEN_STAIRS); + copy(BlockTags.TRAPDOORS, ItemTags.TRAPDOORS); + copy(BlockTags.WOODEN_TRAPDOORS, ItemTags.WOODEN_TRAPDOORS); + copy(BlockTags.SAPLINGS, ItemTags.SAPLINGS); + + copy(UTags.Blocks.ZAP_LOGS, UTags.Items.ZAP_LOGS); + copy(UTags.Blocks.WAXED_ZAP_LOGS, UTags.Items.WAXED_ZAP_LOGS); + copy(UTags.Blocks.PALM_LOGS, UTags.Items.PALM_LOGS); + copy(UTags.Blocks.CLOUD_BEDS, UTags.Items.CLOUD_BEDS); + copy(UTags.Blocks.CLOUD_SLABS, UTags.Items.CLOUD_SLABS); + copy(UTags.Blocks.CLOUD_STAIRS, UTags.Items.CLOUD_STAIRS); + copy(UTags.Blocks.CLOUD_BLOCKS, UTags.Items.CLOUD_BLOCKS); + copy(UTags.Blocks.CHITIN_BLOCKS, UTags.Items.CHITIN_BLOCKS); + } + + private void exportForagingTags() { + getOrCreateTagBuilder(UTags.Items.FORAGE_BLINDING).add(Items.OXEYE_DAISY); + getOrCreateTagBuilder(UTags.Items.FORAGE_DANGEROUS).add(Items.POPPY, Items.LILY_OF_THE_VALLEY); + getOrCreateTagBuilder(UTags.Items.FORAGE_FILLING).add(Items.HAY_BLOCK); + getOrCreateTagBuilder(UTags.Items.FORAGE_SAFE).add(Items.BLUE_ORCHID, Items.RED_TULIP, Items.ORANGE_TULIP, + Items.PINK_TULIP, Items.CORNFLOWER, Items.PEONY, Items.SUNFLOWER, Items.DANDELION, Items.LILAC, Items.TALL_GRASS, + Items.DEAD_BUSH, Items.PINK_PETALS + ).forceAddTag(UConventionalTags.Items.MUSHROOMS).forceAddTag(ItemTags.SAPLINGS); + getOrCreateTagBuilder(UTags.Items.FORAGE_NAUSEATING).add(Items.SHORT_GRASS, UItems.CIDER); + getOrCreateTagBuilder(UTags.Items.FORAGE_PRICKLY).add(Items.ROSE_BUSH).forceAddTag(ItemTags.SAPLINGS); + getOrCreateTagBuilder(UTags.Items.FORAGE_GLOWING).add(Items.AZURE_BLUET, Items.TORCHFLOWER); + getOrCreateTagBuilder(UTags.Items.FORAGE_RISKY).add(Items.ALLIUM, Items.WHITE_TULIP, UItems.BURNED_JUICE); + getOrCreateTagBuilder(UTags.Items.FORAGE_STRENGHENING).add(Items.FERN); + getOrCreateTagBuilder(UTags.Items.FORAGE_SEVERE_NAUSEATING).add(Items.PITCHER_PLANT); + getOrCreateTagBuilder(UTags.Items.FORAGE_SEVERE_PRICKLY).add(Items.LARGE_FERN); + } + + private void exportConventionalTags() { + copy(UConventionalTags.Blocks.CONCRETES, UConventionalTags.Items.CONCRETES); + copy(UConventionalTags.Blocks.CONCRETE_POWDERS, UConventionalTags.Items.CONCRETE_POWDERS); + copy(UConventionalTags.Blocks.GLAZED_TERRACOTTAS, UConventionalTags.Items.GLAZED_TERRACOTTAS); + copy(UConventionalTags.Blocks.CORAL_BLOCKS, UConventionalTags.Items.CORAL_BLOCKS); + copy(UConventionalTags.Blocks.CORAL_FANS, UConventionalTags.Items.CORAL_FANS); + copy(UConventionalTags.Blocks.CORALS, UConventionalTags.Items.CORALS); + getOrCreateTagBuilder(UConventionalTags.Items.ACORNS).add(UItems.ACORN); + getOrCreateTagBuilder(UConventionalTags.Items.APPLES) + .add(Items.APPLE, Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE, UItems.ROTTEN_APPLE) + .forceAddTag(UTags.Items.FRESH_APPLES) + .addOptionalTag(new Identifier("c", "pyrite_apples")) // no idea which mod add pyrite apples + ; + getOrCreateTagBuilder(UConventionalTags.Items.BANANAS).add(UItems.BANANA); + getOrCreateTagBuilder(UConventionalTags.Items.RAW_FISH).add(Items.COD, Items.SALMON, Items.PUFFERFISH, Items.TROPICAL_FISH).addOptionalTag(new Identifier("c", "mollusks")); + getOrCreateTagBuilder(UConventionalTags.Items.COOKED_FISH).add(Items.COOKED_COD, Items.COOKED_SALMON, UItems.COOKED_TROPICAL_FISH, UItems.COOKED_PUFFERFISH, UItems.FRIED_AXOLOTL); + getOrCreateTagBuilder(UConventionalTags.Items.ROTTEN_FISH).add(UItems.ROTTEN_COD, UItems.ROTTEN_TROPICAL_FISH, UItems.ROTTEN_SALMON, UItems.ROTTEN_PUFFERFISH); + getOrCreateTagBuilder(ItemTags.FISHES).add( + UItems.COOKED_TROPICAL_FISH, UItems.COOKED_PUFFERFISH, UItems.FRIED_AXOLOTL, + UItems.ROTTEN_COD, UItems.ROTTEN_TROPICAL_FISH, UItems.ROTTEN_SALMON, UItems.ROTTEN_PUFFERFISH + ); + getOrCreateTagBuilder(UConventionalTags.Items.COOKED_MEAT) + .add(Items.COOKED_PORKCHOP, Items.COOKED_BEEF, Items.COOKED_MUTTON, Items.COOKED_RABBIT, Items.COOKED_CHICKEN, Items.RABBIT_STEW) + .addOptionalTag(new Identifier("c", "cooked_bacon")) + .addOptionalTag(new Identifier("c", "cooked_beef")) + .addOptionalTag(new Identifier("c", "cooked_chicken")) + .addOptionalTag(new Identifier("c", "cooked_mutton")) + .addOptionalTag(new Identifier("c", "cooked_pork")) + .addOptionalTag(new Identifier("c", "fried_chickens")) + .addOptionalTag(new Identifier("c", "hamburgers")) + .addOptionalTag(new Identifier("c", "pork_and_beans")) + .addOptionalTag(new Identifier("c", "pork_jerkies")) + .addOptionalTag(new Identifier("c", "protien")); + getOrCreateTagBuilder(UConventionalTags.Items.RAW_MEAT) + .add(Items.PORKCHOP, Items.BEEF, Items.MUTTON, Items.RABBIT, Items.CHICKEN) + .addOptionalTag(new Identifier("c", "raw_bacon")) + .addOptionalTag(new Identifier("c", "raw_beef")) + .addOptionalTag(new Identifier("c", "raw_chicken")) + .addOptionalTag(new Identifier("c", "raw_mutton")) + .addOptionalTag(new Identifier("c", "raw_pork")) + .addOptionalTag(new Identifier("c", "lemon_chickens")); + getOrCreateTagBuilder(UConventionalTags.Items.ROTTEN_MEAT).add(Items.ROTTEN_FLESH); + getOrCreateTagBuilder(UConventionalTags.Items.ROTTEN_INSECT).add(Items.FERMENTED_SPIDER_EYE); + getOrCreateTagBuilder(UConventionalTags.Items.COOKED_INSECT);//.add(Items.FERMENTED_SPIDER_EYE); TODO + getOrCreateTagBuilder(UConventionalTags.Items.RAW_INSECT).add(Items.SPIDER_EYE, UItems.BUTTERFLY, UItems.WHEAT_WORMS, UBlocks.WORM_BLOCK.asItem()); + getOrCreateTagBuilder(UConventionalTags.Items.WORMS).add(UItems.WHEAT_WORMS); + getOrCreateTagBuilder(UConventionalTags.Items.STICKS).add(Items.STICK); + getOrCreateTagBuilder(UConventionalTags.Items.ROCKS).add(UItems.ROCK); + getOrCreateTagBuilder(UConventionalTags.Items.PINECONES).add(UItems.PINECONE); + getOrCreateTagBuilder(UConventionalTags.Items.PINEAPPLES).add(UItems.PINEAPPLE); + getOrCreateTagBuilder(UConventionalTags.Items.MANGOES).add(UItems.MANGO); + getOrCreateTagBuilder(UConventionalTags.Items.MUSHROOMS).add(Items.RED_MUSHROOM, Items.BROWN_MUSHROOM); + getOrCreateTagBuilder(UConventionalTags.Items.MUFFINS).add(UItems.MUFFIN); + getOrCreateTagBuilder(UConventionalTags.Items.SEEDS).add(Items.BEETROOT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.TORCHFLOWER_SEEDS, Items.WHEAT_SEEDS) + .add(UItems.OAT_SEEDS) + .forceAddTag(UTags.Items.APPLE_SEEDS); + getOrCreateTagBuilder(UConventionalTags.Items.COOKIES).add(Items.COOKIE, UItems.OATMEAL_COOKIE, UItems.CHOCOLATE_OATMEAL_COOKIE, UItems.PINECONE_COOKIE); + getOrCreateTagBuilder(UConventionalTags.Items.OATMEALS).add(UItems.OATMEAL); + getOrCreateTagBuilder(UConventionalTags.Items.GRAIN).add(Items.WHEAT, UItems.OATS); + getOrCreateTagBuilder(UConventionalTags.Items.NUTS).add(UItems.BOWL_OF_NUTS) + .addOptionalTag(UConventionalTags.Items.CROPS_PEANUTS) + .forceAddTag(UConventionalTags.Items.ACORNS) + .addOptional(new Identifier("garnished", "nuts")) + .addOptional(new Identifier("garnished", "nut_mix")) + .addOptional(new Identifier("garnished", "neverable_delecacies")); + getOrCreateTagBuilder(UConventionalTags.Items.FRUITS) + .add(Items.MELON_SLICE, Items.SWEET_BERRIES, Items.GLOW_BERRIES, Items.CHORUS_FRUIT) + .add(UItems.JUICE, UItems.ZAP_APPLE, UItems.ZAP_BULB) + .forceAddTag(UConventionalTags.Items.MANGOES) + .forceAddTag(UConventionalTags.Items.PINEAPPLES) + .forceAddTag(UConventionalTags.Items.APPLES) + .forceAddTag(UConventionalTags.Items.BANANAS) + .addOptionalTag(new Identifier("garnished", "berries")); + getOrCreateTagBuilder(UConventionalTags.Items.DESSERTS).add(Items.CAKE, UItems.APPLE_PIE_SLICE).forceAddTag(UTags.Items.PIES); + getOrCreateTagBuilder(UConventionalTags.Items.CANDY).add(Items.SUGAR, UItems.ROCK_CANDY, UItems.CANDIED_APPLE); + getOrCreateTagBuilder(UTags.Items.BAKED_GOODS).add( + Items.BREAD, Items.COOKIE, Items.PUMPKIN_PIE, + UItems.MUFFIN, UItems.SCONE, UItems.COOKED_ZAP_APPLE, UItems.TOAST, UItems.BURNED_TOAST, UItems.JAM_TOAST, UItems.IMPORTED_OATS, + UItems.HAY_FRIES, UItems.CRISPY_HAY_FRIES, UItems.HORSE_SHOE_FRIES) + .forceAddTag(UConventionalTags.Items.OATMEALS) + .forceAddTag(UConventionalTags.Items.COOKIES); + } + + private void exportFarmersDelightItems() { + getOrCreateTagBuilder(UTags.Items.COOLS_OFF_KIRINS) + .addOptional(new Identifier("farmersdelight", "melon_popsicle")) + .addOptional(new Identifier("farmersdelight", "melon_juice")); + getOrCreateTagBuilder(TagKey.of(RegistryKeys.ITEM, new Identifier("farmersdelight", "cabbage_roll_ingredients"))).add(UItems.OATS, UItems.ROCK, UItems.WHEAT_WORMS); + getOrCreateTagBuilder(TagKey.of(RegistryKeys.ITEM, new Identifier("farmersdelight", "comfort_foods"))).add(UItems.OATMEAL, UItems.ROCK_STEW, UItems.MUFFIN); + getOrCreateTagBuilder(UConventionalTags.Items.RAW_FISH) + .addOptional(new Identifier("farmersdelight", "cod_roll")) + .addOptional(new Identifier("farmersdelight", "salmon_roll")) + .addOptional(new Identifier("farmersdelight", "cod_slice")) + .addOptional(new Identifier("farmersdelight", "salmon_slice")); + getOrCreateTagBuilder(UConventionalTags.Items.COOKED_FISH) + .addOptional(new Identifier("farmersdelight", "fish_stew")) + .addOptional(new Identifier("farmersdelight", "baked_cod_stew")) + .addOptional(new Identifier("farmersdelight", "grilled_salmon")); + getOrCreateTagBuilder(UConventionalTags.Items.RAW_MEAT) + .addOptional(new Identifier("farmersdelight", "ham")); + getOrCreateTagBuilder(UConventionalTags.Items.COOKED_MEAT) + .addOptional(new Identifier("farmersdelight", "chicken_soup")) + .addOptional(new Identifier("farmersdelight", "bacon_and_eggs")) + .addOptional(new Identifier("farmersdelight", "pasta_with_meatballs")) + .addOptional(new Identifier("farmersdelight", "beef_stew")) + .addOptional(new Identifier("farmersdelight", "bone_broth")) + .addOptional(new Identifier("farmersdelight", "mutton_wrap")) + .addOptional(new Identifier("farmersdelight", "bacon_sandwich")) + .addOptional(new Identifier("farmersdelight", "hamburger")) + .addOptional(new Identifier("farmersdelight", "chicken_sandwich")) + .addOptional(new Identifier("farmersdelight", "barbecue_stick")) + .addOptional(new Identifier("farmersdelight", "smoked_ham")) + .addOptional(new Identifier("farmersdelight", "honey_glazed_ham")) + .addOptional(new Identifier("farmersdelight", "honey_glazed_ham_block")) + .addOptional(new Identifier("farmersdelight", "roast_chicken")) + .addOptional(new Identifier("farmersdelight", "roast_chicken_block")) + .addOptional(new Identifier("farmersdelight", "steak_and_potatoes")) + .addOptional(new Identifier("farmersdelight", "roasted_mutton_chops")) + .addOptional(new Identifier("farmersdelight", "pasta_with_mutton_chop")); + getOrCreateTagBuilder(UConventionalTags.Items.FRUITS) + .addOptional(new Identifier("farmersdelight", "pumpkin_slice")) + .addOptional(new Identifier("farmersdelight", "tomato")) + .addOptional(new Identifier("farmersdelight", "melon_juice")) + .addOptional(new Identifier("farmersdelight", "fruit_salad")); + getOrCreateTagBuilder(UConventionalTags.Items.DESSERTS) + .addOptional(new Identifier("farmersdelight", "sweet_berry_cheesecake")) + .addOptional(new Identifier("farmersdelight", "sweet_berry_cheesecake_slice")) + .addOptional(new Identifier("farmersdelight", "chocolate_pie_slice")) + .addOptional(new Identifier("farmersdelight", "cake_slice")) + .addOptional(new Identifier("farmersdelight", "apple_pie_slice")) + .addOptional(new Identifier("farmersdelight", "glow_berry_custard")); + getOrCreateTagBuilder(UConventionalTags.Items.COOKIES) + .addOptional(new Identifier("farmersdelight", "sweet_berry_cookie")) + .addOptional(new Identifier("farmersdelight", "honey_cookie")); + getOrCreateTagBuilder(UTags.Items.BAKED_GOODS) + .addOptional(new Identifier("farmersdelight", "wheat_dough")) + .addOptional(new Identifier("farmersdelight", "raw_pasta")) + .addOptional(new Identifier("farmersdelight", "pie_crust")) + .addOptional(new Identifier("farmersdelight", "egg_sandwich")); + getOrCreateTagBuilder(UTags.Items.HIGH_QUALITY_SEA_VEGETABLES) + .addOptional(new Identifier("farmersdelight", "kelp_roll")); + getOrCreateTagBuilder(UTags.Items.LOW_QUALITY_SEA_VEGETABLES) + .addOptional(new Identifier("farmersdelight", "kelp_roll_slice")); + getOrCreateTagBuilder(UTags.Items.FORAGE_FILLING) + .addOptional(new Identifier("farmersdelight", "horse_feed")) + .addOptional(new Identifier("farmersdelight", "rice_bale")) + .addOptional(new Identifier("farmersdelight", "straw_bale")); + getOrCreateTagBuilder(UTags.Items.FORAGE_SAFE) + .addOptional(new Identifier("farmersdelight", "sandy_shrub")) + .addOptional(new Identifier("farmersdelight", "wild_cabbages")) + .addOptional(new Identifier("farmersdelight", "wild_onions")) + .addOptional(new Identifier("farmersdelight", "wild_carrots")) + .addOptional(new Identifier("farmersdelight", "wild_beetroots")) + .addOptional(new Identifier("farmersdelight", "wild_rice")); + getOrCreateTagBuilder(UTags.Items.FORAGE_RISKY) + .addOptional(new Identifier("farmersdelight", "wild_tomatoes")) + .addOptional(new Identifier("farmersdelight", "wild_potatoes")) + .addOptionalTag(new Identifier("c", "meads")); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/diet/DietProfile.java b/src/main/java/com/minelittlepony/unicopia/diet/DietProfile.java index a71c8499..b10a8143 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/DietProfile.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/DietProfile.java @@ -5,11 +5,11 @@ import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; +import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Collectors; import org.jetbrains.annotations.Nullable; - import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.ItemDuck; import com.mojang.datafixers.util.Pair; @@ -19,33 +19,53 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.client.item.TooltipContext; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.FoodComponent; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.tag.TagKey; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import net.minecraft.util.Identifier; import net.minecraft.util.UseAction; public record DietProfile( float defaultMultiplier, float foragingMultiplier, List multipliers, - List effects, - Optional defaultEffect + List effects, + Optional defaultEffect ) { public static final DietProfile EMPTY = new DietProfile(1, 1, List.of(), List.of(), Optional.empty()); public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( Codec.FLOAT.fieldOf("default_multiplier").forGetter(DietProfile::defaultMultiplier), Codec.FLOAT.fieldOf("foraging_multiplier").forGetter(DietProfile::foragingMultiplier), Codec.list(Multiplier.CODEC).fieldOf("multipliers").forGetter(DietProfile::multipliers), - Codec.list(Effect.CODEC).fieldOf("effects").forGetter(DietProfile::effects), - Effect.CODEC.optionalFieldOf("default_effect").forGetter(DietProfile::defaultEffect) + Codec.list(FoodGroupEffects.CODEC).fieldOf("effects").forGetter(DietProfile::effects), + FoodGroupEffects.CODEC.optionalFieldOf("default_effect").forGetter(DietProfile::defaultEffect) ).apply(instance, DietProfile::new)); public DietProfile(PacketByteBuf buffer) { - this(buffer.readFloat(), buffer.readFloat(), buffer.readList(Multiplier::new), buffer.readList(Effect::new), buffer.readOptional(Effect::new)); + this(buffer.readFloat(), buffer.readFloat(), + buffer.readList(Multiplier::new), + buffer.readList(b -> new FoodGroupEffects(b, FoodGroupKey.LOOKUP)), + buffer.readOptional(b -> new FoodGroupEffects(b, FoodGroupKey.LOOKUP)) + ); + } + + public void validate(Consumer issues, Predicate foodGroupExists) { + multipliers.stream().flatMap(i -> i.tags().stream()).forEach(key -> { + if (!foodGroupExists.test(key.id())) { + issues.accept("Multiplier referenced unknown food group: " + key.id()); + } + }); + effects.stream().flatMap(i -> i.tags().stream()).forEach(key -> { + if (!foodGroupExists.test(key.id())) { + issues.accept("Override defined for unknown food group: " + key.id()); + } + }); + defaultEffect.stream().flatMap(i -> i.tags().stream()).forEach(key -> { + if (!foodGroupExists.test(key.id())) { + issues.accept("Default override defined for unknown food group: " + key.id()); + } + }); } public void toBuffer(PacketByteBuf buffer) { @@ -61,7 +81,7 @@ public record DietProfile( } public Optional findEffect(ItemStack stack) { - return effects.stream().filter(m -> m.test(stack)).findFirst().or(this::defaultEffect); + return effects.stream().filter(m -> m.test(stack)).findFirst().or(this::defaultEffect).map(Effect.class::cast); } static boolean isForaged(ItemStack stack) { @@ -145,11 +165,11 @@ public record DietProfile( } public record Multiplier( - Set> tags, + Set tags, float hunger, float saturation ) implements Predicate { - public static final Codec>> TAGS_CODEC = Codec.list(TagKey.unprefixedCodec(RegistryKeys.ITEM)).xmap( + public static final Codec> TAGS_CODEC = FoodGroupKey.CODEC.listOf().xmap( l -> l.stream().distinct().collect(Collectors.toSet()), set -> new ArrayList<>(set) ); @@ -160,12 +180,12 @@ public record DietProfile( ).apply(instance, Multiplier::new)); public Multiplier(PacketByteBuf buffer) { - this(buffer.readCollection(HashSet::new, p -> TagKey.of(RegistryKeys.ITEM, p.readIdentifier())), buffer.readFloat(), buffer.readFloat()); + this(buffer.readCollection(HashSet::new, p -> FoodGroupKey.LOOKUP.apply(p.readIdentifier())), buffer.readFloat(), buffer.readFloat()); } @Override public boolean test(ItemStack stack) { - return tags.stream().anyMatch(tag -> stack.isIn(tag)); + return tags.stream().anyMatch(tag -> tag.contains(stack)); } public void toBuffer(PacketByteBuf buffer) { @@ -173,5 +193,30 @@ public record DietProfile( buffer.writeFloat(hunger); buffer.writeFloat(saturation); } + + public static final class Builder { + private Set tags = new HashSet<>(); + private float hunger = 1; + private float saturation = 1; + + public Builder tag(Identifier tag) { + tags.add(FoodGroupKey.LOOKUP.apply(tag)); + return this; + } + + public Builder hunger(float hunger) { + this.hunger = hunger; + return this; + } + + public Builder saturation(float saturation) { + this.saturation = saturation; + return this; + } + + public Multiplier build() { + return new Multiplier(tags, hunger, saturation); + } + } } } diff --git a/src/main/java/com/minelittlepony/unicopia/diet/DietsLoader.java b/src/main/java/com/minelittlepony/unicopia/diet/DietsLoader.java index 963efb77..0c4eb7f5 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/DietsLoader.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/DietsLoader.java @@ -1,12 +1,9 @@ package com.minelittlepony.unicopia.diet; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; - import org.slf4j.Logger; import com.google.gson.JsonElement; @@ -36,9 +33,24 @@ public class DietsLoader implements IdentifiableResourceReloadListener { Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor) { - var dietsLoadTask = loadData(manager, prepareExecutor, "diets/races").thenApplyAsync(data -> { + CompletableFuture> foodGroupsFuture = CompletableFuture.supplyAsync(() -> { + Map foodGroups = new HashMap<>(); + for (var group : loadData(manager, prepareExecutor, "diet/food_groups").entrySet()) { + try { + FoodGroup.CODEC.parse(JsonOps.INSTANCE, group.getValue()) + .resultOrPartial(error -> LOGGER.error("Could not load food group {}: {}", group.getKey(), error)) + .ifPresent(value -> { + foodGroups.put(group.getKey(), new FoodGroup(group.getKey(), value)); + }); + } catch (Throwable t) { + LOGGER.error("Could not load food effects {}", group.getKey(), t); + } + } + return foodGroups; + }, prepareExecutor); + CompletableFuture> profilesFuture = CompletableFuture.supplyAsync(() -> { Map profiles = new HashMap<>(); - for (var entry : data.entrySet()) { + for (var entry : loadData(manager, prepareExecutor, "diet/races").entrySet()) { Identifier id = entry.getKey(); try { Race.REGISTRY.getOrEmpty(id).ifPresentOrElse(race -> { @@ -53,33 +65,26 @@ public class DietsLoader implements IdentifiableResourceReloadListener { return profiles; }, prepareExecutor); - var effectsLoadTask = loadData(manager, prepareExecutor, "diets/food_effects").thenApplyAsync(data -> data.entrySet().stream() - .map(entry -> { - try { - return Effect.CODEC.parse(JsonOps.INSTANCE, entry.getValue()) - .resultOrPartial(error -> LOGGER.error("Could not load food effect {}: {}", entry.getKey(), error)); - } catch (Throwable t) { - LOGGER.error("Could not load food effects {}", entry.getKey(), t); - } - return Optional.empty(); - }) - .filter(Optional::isPresent) - .map(Optional::get) - .toList(), prepareExecutor); - - return CompletableFuture.allOf(dietsLoadTask, effectsLoadTask).thenCompose(sync::whenPrepared).thenRunAsync(() -> { - PonyDiets.load(new PonyDiets( - dietsLoadTask.getNow(Map.of()), - effectsLoadTask.getNow(List.of()) - )); + return CompletableFuture.allOf(foodGroupsFuture, profilesFuture).thenCompose(sync::whenPrepared).thenAcceptAsync(v -> { + var profiles = profilesFuture.getNow(Map.of()); + var foodGroups = foodGroupsFuture.getNow(Map.of()); + profiles.entrySet().removeIf(entry -> { + StringBuilder issueList = new StringBuilder(); + entry.getValue().validate(issue -> { + issueList.append(System.lineSeparator()).append(issue); + }, foodGroups::containsKey); + if (!issueList.isEmpty()) { + LOGGER.error("Could not load diet profile {}. Caused by {}", entry.getKey(), issueList.toString()); + } + return issueList.isEmpty(); + }); + PonyDiets.load(new PonyDiets(profiles, foodGroups)); }, applyExecutor); } - private static CompletableFuture> loadData(ResourceManager manager, Executor prepareExecutor, String path) { - return CompletableFuture.supplyAsync(() -> { - Map results = new HashMap<>(); - JsonDataLoader.load(manager, path, Resources.GSON, results); - return results; - }); + private static Map loadData(ResourceManager manager, Executor prepareExecutor, String path) { + Map results = new HashMap<>(); + JsonDataLoader.load(manager, path, Resources.GSON, results); + return results; } } diff --git a/src/main/java/com/minelittlepony/unicopia/diet/Effect.java b/src/main/java/com/minelittlepony/unicopia/diet/Effect.java index 9b7ba05d..af9ad3d9 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/Effect.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/Effect.java @@ -4,54 +4,29 @@ import java.util.List; import java.util.Optional; import java.util.function.Predicate; -import com.minelittlepony.unicopia.entity.player.Pony; -import com.mojang.serialization.Codec; -import com.mojang.serialization.codecs.RecordCodecBuilder; - import net.minecraft.client.item.TooltipContext; import net.minecraft.item.FoodComponent; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.tag.TagKey; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.UseAction; -import net.minecraft.util.Util; -public record Effect( - List> tags, - Optional foodComponent, - Ailment ailment -) implements Predicate { - public static final Effect EMPTY = new Effect(List.of(), Optional.empty(), Ailment.EMPTY); - public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - TagKey.unprefixedCodec(RegistryKeys.ITEM).listOf().fieldOf("tags").forGetter(Effect::tags), - FoodAttributes.CODEC.optionalFieldOf("food_component").forGetter(Effect::foodComponent), - Ailment.CODEC.fieldOf("ailment").forGetter(Effect::ailment) - ).apply(instance, Effect::new)); +public interface Effect extends Predicate { + Effect EMPTY = new FoodGroupEffects(List.of(), Optional.empty(), Ailment.EMPTY); - public Effect(PacketByteBuf buffer) { - this(buffer.readList(b -> TagKey.of(RegistryKeys.ITEM, b.readIdentifier())), buffer.readOptional(FoodAttributes::read), new Ailment(buffer)); - } + List tags(); - public void afflict(Pony pony, ItemStack stack) { - ailment().effects().afflict(pony.asEntity(), stack); - } + Optional foodComponent(); - public void appendTooltip(ItemStack stack, List tooltip, TooltipContext context) { - int size = tooltip.size(); - tags.forEach(tag -> { - if (stack.isIn(tag)) { - tooltip.add(Text.literal(" ").append(Text.translatable(Util.createTranslationKey("tag", tag.id()))).formatted(Formatting.GRAY)); - } - }); - if (tooltip.size() == size) { + Ailment ailment(); + + default void appendTooltip(ItemStack stack, List tooltip, TooltipContext context) { + if (!test(stack)) { if (stack.isFood()) { - tooltip.add(Text.literal(" ").append(Text.translatable("tag.unicopia.food_types.misc")).formatted(Formatting.GRAY)); + tooltip.add(Text.literal(" ").append(Text.translatable("food_group.unicopia.misc")).formatted(Formatting.GRAY)); } else if (stack.getUseAction() == UseAction.DRINK) { - tooltip.add(Text.literal(" ").append(Text.translatable("tag.unicopia.food_types.drinks")).formatted(Formatting.GRAY)); + tooltip.add(Text.literal(" ").append(Text.translatable("food_group.unicopia.drinks")).formatted(Formatting.GRAY)); } } @@ -63,14 +38,14 @@ public record Effect( } } - public void toBuffer(PacketByteBuf buffer) { - buffer.writeCollection(tags, (b, t) -> b.writeIdentifier(t.id())); - buffer.writeOptional(foodComponent, FoodAttributes::write); - ailment.toBuffer(buffer); + default void toBuffer(PacketByteBuf buffer) { + buffer.writeCollection(tags(), (b, t) -> b.writeIdentifier(t.id())); + buffer.writeOptional(foodComponent(), FoodAttributes::write); + ailment().toBuffer(buffer); } @Override - public boolean test(ItemStack stack) { - return tags.stream().anyMatch(stack::isIn); + default boolean test(ItemStack stack) { + return tags().stream().anyMatch(tag -> tag.contains(stack)); } -} \ No newline at end of file +} diff --git a/src/main/java/com/minelittlepony/unicopia/diet/FoodGroup.java b/src/main/java/com/minelittlepony/unicopia/diet/FoodGroup.java new file mode 100644 index 00000000..173b1fef --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/diet/FoodGroup.java @@ -0,0 +1,56 @@ +package com.minelittlepony.unicopia.diet; + +import java.util.List; +import java.util.Optional; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; + +import net.minecraft.client.item.TooltipContext; +import net.minecraft.item.FoodComponent; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import net.minecraft.util.Identifier; +import net.minecraft.util.Util; + +public record FoodGroup( + Identifier id, + FoodGroupEffects attributes) implements Effect { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + FoodGroupKey.TAG_CODEC.listOf().fieldOf("tags").forGetter(FoodGroupEffects::tags), + FoodAttributes.CODEC.optionalFieldOf("food_component").forGetter(FoodGroupEffects::foodComponent), + Ailment.CODEC.fieldOf("ailment").forGetter(FoodGroupEffects::ailment) + ).apply(instance, FoodGroupEffects::new)); + + public FoodGroup(PacketByteBuf buffer) { + this(buffer.readIdentifier(), new FoodGroupEffects(buffer, FoodGroupKey.TAG_ID_LOOKUP)); + } + + @Override + public List tags() { + return attributes.tags(); + } + + @Override + public Optional foodComponent() { + return attributes.foodComponent(); + } + + @Override + public Ailment ailment() { + return attributes.ailment(); + } + @Override + public void appendTooltip(ItemStack stack, List tooltip, TooltipContext context) { + tooltip.add(Text.literal(" ").append(Text.translatable(Util.createTranslationKey("food_group", id()))).formatted(Formatting.GRAY)); + Effect.super.appendTooltip(stack, tooltip, context); + } + + @Override + public void toBuffer(PacketByteBuf buffer) { + buffer.writeIdentifier(id()); + Effect.super.toBuffer(buffer); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/diet/FoodGroupEffects.java b/src/main/java/com/minelittlepony/unicopia/diet/FoodGroupEffects.java new file mode 100644 index 00000000..ad207ed1 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/diet/FoodGroupEffects.java @@ -0,0 +1,86 @@ +package com.minelittlepony.unicopia.diet; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; + +import com.minelittlepony.unicopia.diet.affliction.Affliction; +import com.minelittlepony.unicopia.item.UFoodComponents; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; + +import net.minecraft.client.item.TooltipContext; +import net.minecraft.item.FoodComponent; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import net.minecraft.util.Identifier; +import net.minecraft.util.Util; + +public record FoodGroupEffects( + List tags, + Optional foodComponent, + Ailment ailment +) implements Effect { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + FoodGroupKey.CODEC.listOf().fieldOf("tags").forGetter(FoodGroupEffects::tags), + FoodAttributes.CODEC.optionalFieldOf("food_component").forGetter(FoodGroupEffects::foodComponent), + Ailment.CODEC.fieldOf("ailment").forGetter(FoodGroupEffects::ailment) + ).apply(instance, FoodGroupEffects::new)); + + public FoodGroupEffects(PacketByteBuf buffer, Function lookup) { + this(buffer.readList(b -> lookup.apply(b.readIdentifier())), buffer.readOptional(FoodAttributes::read), new Ailment(buffer)); + } + + @Override + public void appendTooltip(ItemStack stack, List tooltip, TooltipContext context) { + tags.forEach(tag -> { + if (tag.contains(stack)) { + tooltip.add(Text.literal(" ").append(Text.translatable(Util.createTranslationKey("tag", tag.id()))).formatted(Formatting.GRAY)); + } + }); + Effect.super.appendTooltip(stack, tooltip, context); + } + + public static final class Builder { + private final List tags = new ArrayList<>(); + private Optional foodComponent = Optional.empty(); + private Ailment ailment = new Ailment(Affliction.EMPTY); + + public Builder tag(Identifier tag) { + return tag(TagKey.of(RegistryKeys.ITEM, tag)); + } + + public Builder tag(TagKey tag) { + tags.add(FoodGroupKey.TAG_LOOKUP.apply(tag)); + return this; + } + + public Builder ailment(Affliction affliction) { + ailment = new Ailment(affliction); + return this; + } + + public Builder food(int hunger, float saturation) { + return food(UFoodComponents.builder(hunger, saturation)); + } + + public Builder food(FoodComponent.Builder food) { + return food(food.build()); + } + + public Builder food(FoodComponent food) { + foodComponent = Optional.of(food); + return this; + } + + public FoodGroupEffects build() { + return new FoodGroupEffects(tags, foodComponent, ailment); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/diet/FoodGroupKey.java b/src/main/java/com/minelittlepony/unicopia/diet/FoodGroupKey.java new file mode 100644 index 00000000..567c4a36 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/diet/FoodGroupKey.java @@ -0,0 +1,80 @@ +package com.minelittlepony.unicopia.diet; + +import java.util.function.Function; + +import com.minelittlepony.unicopia.Debug; +import com.minelittlepony.unicopia.Unicopia; +import com.mojang.serialization.Codec; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; +import net.minecraft.util.Util; + +public interface FoodGroupKey { + Function LOOKUP = Util.memoize(id -> { + return new FoodGroupKey() { + @Override + public Identifier id() { + return id; + } + + @Override + public boolean contains(ItemStack stack) { + var group = PonyDiets.getEffect(id); + return group != null && group.test(stack); + } + + @Override + public boolean equals(Object o) { + return o == this && (o instanceof FoodGroupKey k && k.id().equals(id())); + } + + @Override + public int hashCode() { + return id().hashCode(); + } + }; + }); + Function, FoodGroupKey> TAG_LOOKUP = Util.memoize(tag -> { + return new FoodGroupKey() { + private boolean check; + @Override + public Identifier id() { + return tag.id(); + } + + @Override + public boolean contains(ItemStack stack) { + if (Debug.CHECK_GAME_VALUES && !check) { + check = true; + if (Registries.ITEM.getEntryList(tag).isEmpty()) { + Unicopia.LOGGER.info("Tag is empty: " + tag.id()); + } + } + + return stack.isIn(tag); + } + + @Override + public boolean equals(Object o) { + return o == this && (o instanceof FoodGroupKey k && k.id().equals(id())); + } + + @Override + public int hashCode() { + return id().hashCode(); + } + }; + }); + Function TAG_ID_LOOKUP = id -> TAG_LOOKUP.apply(TagKey.of(RegistryKeys.ITEM, id)); + Codec CODEC = Identifier.CODEC.xmap(LOOKUP, FoodGroupKey::id); + Codec TAG_CODEC = TagKey.unprefixedCodec(RegistryKeys.ITEM).xmap(TAG_LOOKUP, k -> TagKey.of(RegistryKeys.ITEM, k.id())); + + Identifier id(); + + boolean contains(ItemStack stack); +} diff --git a/src/main/java/com/minelittlepony/unicopia/diet/PonyDiets.java b/src/main/java/com/minelittlepony/unicopia/diet/PonyDiets.java index 8e4558a9..54990fee 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/PonyDiets.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/PonyDiets.java @@ -1,8 +1,11 @@ package com.minelittlepony.unicopia.diet; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; import org.jetbrains.annotations.Nullable; @@ -18,35 +21,44 @@ import net.minecraft.network.PacketByteBuf; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; import net.minecraft.util.TypedActionResult; import net.minecraft.world.World; public class PonyDiets implements DietView { private final Map diets; - private final List effects; + private final Map effects; - private static PonyDiets INSTANCE = new PonyDiets(Map.of(), List.of()); + private static PonyDiets INSTANCE = new PonyDiets(Map.of(), Map.of()); public static PonyDiets getInstance() { return INSTANCE; } + @Nullable + static Effect getEffect(Identifier id) { + return INSTANCE.effects.get(id); + } + public static void load(PonyDiets diets) { INSTANCE = diets; } - PonyDiets(Map diets, List effects) { + PonyDiets(Map diets, Map effects) { this.diets = diets; this.effects = effects; } public PonyDiets(PacketByteBuf buffer) { - this(buffer.readMap(b -> b.readRegistryValue(Race.REGISTRY), DietProfile::new), buffer.readList(Effect::new)); + this( + buffer.readMap(b -> b.readRegistryValue(Race.REGISTRY), DietProfile::new), + buffer.readCollection(ArrayList::new, FoodGroup::new).stream().collect(Collectors.toMap(FoodGroup::id, Function.identity())) + ); } public void toBuffer(PacketByteBuf buffer) { buffer.writeMap(diets, (b, r) -> b.writeRegistryValue(Race.REGISTRY, r), (b, e) -> e.toBuffer(b)); - buffer.writeCollection(effects, (b, e) -> e.toBuffer(b)); + buffer.writeCollection(effects.values(), (b, e) -> e.toBuffer(b)); } private DietProfile getDiet(Pony pony) { @@ -54,7 +66,7 @@ public class PonyDiets implements DietView { } Effect getEffects(ItemStack stack) { - return effects.stream().filter(effect -> effect.test(stack)).findFirst().orElse(Effect.EMPTY); + return effects.values().stream().filter(effect -> effect.test(stack)).findFirst().orElse(Effect.EMPTY); } private Effect getEffects(ItemStack stack, Pony pony) { @@ -71,27 +83,21 @@ public class PonyDiets implements DietView { @Override public void finishUsing(ItemStack stack, World world, LivingEntity entity) { if (initEdibility(stack, entity)) { - Pony.of(entity).ifPresent(pony -> getEffects(stack, pony).afflict(pony, stack)); + Pony.of(entity).ifPresent(pony -> getEffects(stack, pony).ailment().effects().afflict(pony.asEntity(), stack)); } } @Override public void appendTooltip(ItemStack stack, @Nullable PlayerEntity user, List tooltip, TooltipContext context) { + if (initEdibility(stack, user)) { - Pony pony = Pony.of(user); + if (!((ItemDuck)stack.getItem()).getOriginalFoodComponent().isEmpty() || stack.getItem().getFoodComponent() != null) { + Pony pony = Pony.of(user); - tooltip.add(Text.translatable("unicopia.diet.information").formatted(Formatting.DARK_PURPLE)); - getEffects(stack, pony).appendTooltip(stack, tooltip, context); - - /*for (Race race : Race.REGISTRY) { - var diet = diets.get(race); - if (diet != null) { - tooltip.add(race.getDisplayName()); - diet.appendTooltip(stack, user, tooltip, context); - } - }*/ - - getDiet(pony).appendTooltip(stack, user, tooltip, context); + tooltip.add(Text.translatable("unicopia.diet.information").formatted(Formatting.DARK_PURPLE)); + getEffects(stack, pony).appendTooltip(stack, tooltip, context); + getDiet(pony).appendTooltip(stack, user, tooltip, context); + } } } diff --git a/src/main/java/com/minelittlepony/unicopia/diet/affliction/Affliction.java b/src/main/java/com/minelittlepony/unicopia/diet/affliction/Affliction.java index 013d3f51..ff228b31 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/affliction/Affliction.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/affliction/Affliction.java @@ -37,7 +37,7 @@ public interface Affliction { affliction -> ((CompoundAffliction)affliction).afflictions )).xmap( either -> either.left().or(either::right).get(), - affliction -> affliction instanceof CompoundAffliction ? Either.left(affliction) : Either.right(affliction) + affliction -> affliction instanceof CompoundAffliction ? Either.right(affliction) : Either.left(affliction) ); void afflict(PlayerEntity player, ItemStack stack); diff --git a/src/main/java/com/minelittlepony/unicopia/diet/affliction/ClearLoveSicknessAffliction.java b/src/main/java/com/minelittlepony/unicopia/diet/affliction/ClearLoveSicknessAffliction.java index 79343432..ab8786a4 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/affliction/ClearLoveSicknessAffliction.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/affliction/ClearLoveSicknessAffliction.java @@ -7,7 +7,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; -final class ClearLoveSicknessAffliction implements Affliction { +public final class ClearLoveSicknessAffliction implements Affliction { public static final ClearLoveSicknessAffliction INSTANCE = new ClearLoveSicknessAffliction(); public static final Codec CODEC = Codec.unit(INSTANCE); @@ -21,6 +21,7 @@ final class ClearLoveSicknessAffliction implements Affliction { player.heal(stack.isFood() ? stack.getItem().getFoodComponent().getHunger() : 1); player.removeStatusEffect(StatusEffects.NAUSEA); player.removeStatusEffect(UEffects.FOOD_POISONING); + player.removeStatusEffect(StatusEffects.WEAKNESS); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/diet/affliction/CompoundAffliction.java b/src/main/java/com/minelittlepony/unicopia/diet/affliction/CompoundAffliction.java index 4ebc1469..9861f7e7 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/affliction/CompoundAffliction.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/affliction/CompoundAffliction.java @@ -7,13 +7,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; import net.minecraft.text.Text; -class CompoundAffliction implements Affliction { +public class CompoundAffliction implements Affliction { public final List afflictions; public CompoundAffliction(List afflictions) { this.afflictions = afflictions; } + public static CompoundAffliction of(Affliction...afflictions) { + return new CompoundAffliction(List.of(afflictions)); + } + public CompoundAffliction(PacketByteBuf buffer) { this(buffer.readList(Affliction::read)); } diff --git a/src/main/java/com/minelittlepony/unicopia/diet/affliction/HealingAffliction.java b/src/main/java/com/minelittlepony/unicopia/diet/affliction/HealingAffliction.java index 71590879..8e6bc53d 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/affliction/HealingAffliction.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/affliction/HealingAffliction.java @@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; import net.minecraft.text.Text; -record HealingAffliction(float health) implements Affliction { +public record HealingAffliction(float health) implements Affliction { public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( Codec.FLOAT.fieldOf("health").forGetter(HealingAffliction::health) ).apply(instance, HealingAffliction::new)); diff --git a/src/main/java/com/minelittlepony/unicopia/diet/affliction/Range.java b/src/main/java/com/minelittlepony/unicopia/diet/affliction/Range.java index ed84ad97..78c3abe1 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/affliction/Range.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/affliction/Range.java @@ -7,7 +7,7 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.network.PacketByteBuf; import net.minecraft.util.dynamic.Codecs; -record Range(int min, int max) { +public record Range(int min, int max) { public static final Codec CODEC = Codecs.xor( Codec.INT.xmap(value -> Range.of(value, -1), range -> range.min()), RecordCodecBuilder.create(instance -> instance.group( @@ -20,6 +20,10 @@ record Range(int min, int max) { return new Range(min, max); } + public static Range of(int exact) { + return of(exact, exact); + } + public static Range of(PacketByteBuf buffer) { return of(buffer.readInt(), buffer.readInt()); } diff --git a/src/main/java/com/minelittlepony/unicopia/diet/affliction/StatusEffectAffliction.java b/src/main/java/com/minelittlepony/unicopia/diet/affliction/StatusEffectAffliction.java index 5d13bb27..5e11f226 100644 --- a/src/main/java/com/minelittlepony/unicopia/diet/affliction/StatusEffectAffliction.java +++ b/src/main/java/com/minelittlepony/unicopia/diet/affliction/StatusEffectAffliction.java @@ -5,6 +5,7 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; @@ -12,25 +13,24 @@ import net.minecraft.network.PacketByteBuf; import net.minecraft.registry.Registries; import net.minecraft.text.MutableText; import net.minecraft.text.Text; -import net.minecraft.util.Identifier; import net.minecraft.util.StringHelper; import net.minecraft.util.math.MathHelper; -record StatusEffectAffliction(Identifier effect, Range seconds, Range amplifier, int chance) implements Affliction { +public record StatusEffectAffliction(StatusEffect effect, Range seconds, Range amplifier, int chance) implements Affliction { public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - Identifier.CODEC.fieldOf("effect").forGetter(StatusEffectAffliction::effect), + Registries.STATUS_EFFECT.getCodec().fieldOf("effect").forGetter(StatusEffectAffliction::effect), Range.CODEC.fieldOf("seconds").forGetter(StatusEffectAffliction::seconds), Range.CODEC.optionalFieldOf("amplifier", Range.of(0, -1)).forGetter(StatusEffectAffliction::amplifier), Codec.INT.optionalFieldOf("chance", 0).forGetter(StatusEffectAffliction::chance) ).apply(instance, StatusEffectAffliction::new)); public StatusEffectAffliction(PacketByteBuf buffer) { - this(buffer.readIdentifier(), Range.of(buffer), Range.of(buffer), buffer.readInt()); + this(Registries.STATUS_EFFECT.get(buffer.readIdentifier()), Range.of(buffer), Range.of(buffer), buffer.readInt()); } @Override public void toBuffer(PacketByteBuf buffer) { - buffer.writeIdentifier(effect); + buffer.writeIdentifier(Registries.STATUS_EFFECT.getId(effect)); seconds.toBuffer(buffer); amplifier.toBuffer(buffer); buffer.writeInt(chance); @@ -46,36 +46,32 @@ record StatusEffectAffliction(Identifier effect, Range seconds, Range amplifier, if (chance > 0 && player.getWorld().random.nextInt(chance) > 0) { return; } - Registries.STATUS_EFFECT.getOrEmpty(effect).ifPresent(effect -> { - float health = player.getHealth(); - StatusEffectInstance current = player.getStatusEffect(effect); - player.addStatusEffect(new StatusEffectInstance(effect, - seconds.getClamped(current == null ? 0 : current.getDuration(), 20), - amplifier.getClamped(current == null ? 0 : current.getAmplifier(), 1) - )); - // keep original health - if (effect.getAttributeModifiers().containsKey(EntityAttributes.GENERIC_MAX_HEALTH)) { - player.setHealth(MathHelper.clamp(health, 0, player.getMaxHealth())); - } - }); + float health = player.getHealth(); + StatusEffectInstance current = player.getStatusEffect(effect); + player.addStatusEffect(new StatusEffectInstance(effect, + seconds.getClamped(current == null ? 0 : current.getDuration(), 20), + amplifier.getClamped(current == null ? 0 : current.getAmplifier(), 1) + )); + // keep original health + if (effect.getAttributeModifiers().containsKey(EntityAttributes.GENERIC_MAX_HEALTH)) { + player.setHealth(MathHelper.clamp(health, 0, player.getMaxHealth())); + } } @Override public Text getName() { - return Registries.STATUS_EFFECT.getOrEmpty(effect).map(effect -> { - MutableText text = effect.getName().copy(); + MutableText text = effect.getName().copy(); - if (amplifier.min() > 0) { - text = Text.translatable("potion.withAmplifier", text, Text.translatable("potion.potency." + (amplifier.min()))); - } + if (amplifier.min() > 0) { + text = Text.translatable("potion.withAmplifier", text, Text.translatable("potion.potency." + (amplifier.min()))); + } - float tickRate = MinecraftClient.getInstance().world == null ? 20 : MinecraftClient.getInstance().world.getTickManager().getTickRate(); - text = Text.translatable("potion.withDuration", text, StringHelper.formatTicks(seconds.min() * 20, tickRate)); + float tickRate = MinecraftClient.getInstance().world == null ? 20 : MinecraftClient.getInstance().world.getTickManager().getTickRate(); + text = Text.translatable("potion.withDuration", text, StringHelper.formatTicks(seconds.min() * 20, tickRate)); - if (chance > 0) { - text = Text.translatable("potion.withChance", chance, text); - } - return (Text)text; - }).orElse(EMPTY.getName()); + if (chance > 0) { + text = Text.translatable("potion.withChance", chance, text); + } + return text; } } \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java index 1529989b..749ee3cf 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java @@ -4,7 +4,6 @@ import com.minelittlepony.unicopia.entity.mob.UEntityAttributes; import com.minelittlepony.unicopia.util.Copyable; import com.minelittlepony.unicopia.util.Tickable; -import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.FenceGateBlock; import net.minecraft.entity.Entity; @@ -12,8 +11,6 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.mob.MobEntity; import net.minecraft.nbt.NbtCompound; -import net.minecraft.particle.BlockStateParticleEffect; -import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; @@ -38,11 +35,9 @@ public class EntityPhysics implements Physics, Copyable entity.getWorld().getHeight() + 64) { entity.damage(entity.getDamageSources().outOfWorld(), 4.0F); } - - entity.setOnGround(entity.verticalCollision && entity.getVelocity().getY() > 0); } - float gravity = this.getGravityModifier(); + float gravity = getGravityModifier(); if (gravity != lastGravity) { lastGravity = gravity; @@ -77,8 +72,6 @@ public class EntityPhysics implements Physics, Copyable implements Physics, Copyable The type of the entity this reference points to. */ public class EntityReference implements NbtSerialisable { + private static final Serializer SERIALIZER = Serializer.of(EntityReference::new); + + @SuppressWarnings("unchecked") + public static Serializer> getSerializer() { + return (Serializer>)SERIALIZER; + } + @Nullable private EntityValues reference; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java b/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java index 3d594ea7..27e8ca7f 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java @@ -111,7 +111,7 @@ public class ItemImpl implements Equine { }); } - if (stack.isIn(UTags.FALLS_SLOWLY)) { + if (stack.isIn(UTags.Items.FALLS_SLOWLY)) { if (!entity.isOnGround() && Math.signum(entity.getVelocity().y) != getPhysics().getGravitySignum()) { double ticks = ((Entity)entity).age; double shift = Math.sin(ticks / 9D) / 9D; @@ -160,7 +160,7 @@ public class ItemImpl implements Equine { @Override public boolean collidesWithClouds() { - return entity.getStack().isIn(UTags.FLOATS_ON_CLOUDS) || getSpecies().canInteractWithClouds(); + return entity.getStack().isIn(UTags.Items.FLOATS_ON_CLOUDS) || getSpecies().hasPersistentWeatherMagic(); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index 92b7ba95..46aca94f 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -20,7 +20,6 @@ import com.minelittlepony.unicopia.advancement.UCriteria; import com.minelittlepony.unicopia.compat.trinkets.TrinketsDelegate; import com.minelittlepony.unicopia.entity.behaviour.EntityAppearance; import com.minelittlepony.unicopia.entity.behaviour.Guest; -import com.minelittlepony.unicopia.entity.collision.MultiBoundingBoxEntity; import com.minelittlepony.unicopia.entity.damage.MagicalDamageSource; import com.minelittlepony.unicopia.entity.duck.LivingEntityDuck; import com.minelittlepony.unicopia.entity.effect.CorruptInfluenceStatusEffect; @@ -31,6 +30,7 @@ import com.minelittlepony.unicopia.input.Heuristic; import com.minelittlepony.unicopia.input.Interactable; import com.minelittlepony.unicopia.item.GlassesItem; import com.minelittlepony.unicopia.item.UItems; +import com.minelittlepony.unicopia.item.enchantment.UEnchantments; import com.minelittlepony.unicopia.network.datasync.EffectSync; import com.minelittlepony.unicopia.network.datasync.Transmittable; import com.minelittlepony.unicopia.particle.ParticleUtils; @@ -67,7 +67,6 @@ import net.minecraft.sound.SoundCategory; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -88,14 +87,6 @@ public abstract class Living implements Equine, Caste private boolean invisible = false; - @Nullable - private Entity supportingEntity; - - @Nullable - private Vec3d supportPositionOffset; - private int ticksOutsideVehicle; - private int ticksInVehicle; - @Nullable private Caster attacker; @Nullable @@ -109,6 +100,8 @@ public abstract class Living implements Equine, Caste private final Enchantments enchants = addTicker(new Enchantments(this)); private final ItemTracker armour = addTicker(new ItemTracker(this)); + //private final Transportation transportation = new Transportation<>(this); + private final Transportation transportation = new Transportation<>(this); protected Living(T entity, TrackedData effect) { this.entity = entity; @@ -171,6 +164,10 @@ public abstract class Living implements Equine, Caste return armour; } + public Transportation getTransportation() { + return transportation; + } + @Override public final T asEntity() { return entity; @@ -202,71 +199,9 @@ public abstract class Living implements Equine, Caste return vehicle != null && getCarrierId().filter(vehicle.getUuid()::equals).isPresent(); } - public boolean setSupportingEntity(@Nullable Entity supportingEntity) { - this.supportingEntity = supportingEntity; - if (supportingEntity != null) { - ticksOutsideVehicle = 0; - } - return true; - } - - @Nullable - public Entity getSupportingEntity() { - return supportingEntity; - } - - public int getTicksInVehicle() { - return ticksInVehicle; - } - - public void setPositionOffset(@Nullable Vec3d positionOffset) { - this.supportPositionOffset = positionOffset; - } - - public void updatePositionOffset() { - setPositionOffset(supportingEntity == null ? null : entity.getPos().subtract(supportingEntity.getPos())); - } - - public void updateRelativePosition(Box box) { - if (supportingEntity == null || supportPositionOffset == null) { - return; - } - if (getPhysics().isFlying()) { - return; - } - - Vec3d newPos = supportingEntity.getPos().add(supportPositionOffset); - Vec3d posChange = entity.getPos().subtract(newPos); - entity.setPosition(newPos); - if (isClient()) { - Vec3d newServerPos = LivingEntityDuck.serverPos(entity); - if (newServerPos.lengthSquared() != 0) { - newServerPos = newServerPos.subtract(posChange); - entity.updateTrackedPositionAndAngles( - newServerPos.x, newServerPos.y, newServerPos.z, - entity.getYaw(), entity.getPitch(), 3); - } - } else { - entity.updateTrackedPosition(newPos.x, newPos.y, newPos.z); - } - - if (!(entity instanceof PlayerEntity)) { - entity.lastRenderX = supportingEntity.lastRenderX + supportPositionOffset.x; - entity.lastRenderY = supportingEntity.lastRenderY + supportPositionOffset.y; - entity.lastRenderZ = supportingEntity.lastRenderZ + supportPositionOffset.z; - - if (entity.getVelocity().length() < 0.1) { - LimbAnimationUtil.resetToZero(entity.limbAnimator); - } - } - - entity.horizontalSpeed = 0; - entity.prevHorizontalSpeed = 0; - entity.speed = 0; - entity.setOnGround(true); - entity.verticalCollision = true; - entity.groundCollision = true; - entity.fallDistance = 0; + @Override + public boolean hasFeatherTouch() { + return EnchantmentHelper.getEquipmentLevel(UEnchantments.FEATHER_TOUCH, entity) > 0; } @Override @@ -276,44 +211,9 @@ public abstract class Living implements Equine, Caste updateVelocity(); } - updateSupportingEntity(); return false; } - public void updateSupportingEntity() { - if (supportingEntity != null) { - Box ownBox = entity.getBoundingBox() - .stretch(entity.getVelocity()) - .expand(0.1, 0.5, 0.1) - .stretch(supportingEntity.getVelocity().multiply(-2)); - - MultiBoundingBoxEntity.getBoundingBoxes(supportingEntity).stream() - .filter(box -> box.stretch(supportingEntity.getVelocity()).expand(0, 0.5, 0).intersects(ownBox)) - .findFirst() - .ifPresentOrElse(box -> { - ticksOutsideVehicle = 0; - if (supportPositionOffset == null) { - updatePositionOffset(); - } else { - updateRelativePosition(box); - } - entity.setOnGround(true); - entity.verticalCollision = true; - entity.groundCollision = true; - }, () -> { - // Rubberband passengers to try and prevent players falling out when the velocity changes suddenly - if (ticksOutsideVehicle++ > 30) { - supportingEntity = null; - supportPositionOffset = null; - Unicopia.LOGGER.info("Entity left vehicle"); - } else { - supportPositionOffset = supportPositionOffset.multiply(0.25, 1, 0.25); - } - }); - } - - } - @Override public void tick() { tickers.forEach(Tickable::tick); @@ -358,13 +258,7 @@ public abstract class Living implements Equine, Caste updateDragonBreath(); - if (ticksOutsideVehicle == 0) { - updatePositionOffset(); - - ticksInVehicle++; - } else { - ticksInVehicle = 0; - } + transportation.tick(); } public void updateAttributeModifier(UUID id, EntityAttribute attribute, float desiredValue, Float2ObjectFunction modifierSupplier, boolean permanent) { @@ -414,7 +308,7 @@ public abstract class Living implements Equine, Caste ItemStack payload = stack.payload(); Item item = payload.getItem(); - boolean deliverAggressively = payload.isIn(UTags.IS_DELIVERED_AGGRESSIVELY); + boolean deliverAggressively = payload.isIn(UTags.Items.IS_DELIVERED_AGGRESSIVELY); Vec3d randomPos = deliverAggressively ? targetPos.add(0, 2, 0) : targetPos.add(VecHelper.supply(() -> entity.getRandom().nextTriangular(0.1, 0.5))); @@ -474,12 +368,6 @@ public abstract class Living implements Equine, Caste return false; } - public void onJump() { - if (getPhysics().isGravityNegative()) { - entity.setVelocity(entity.getVelocity().multiply(1, -1, 1)); - } - } - @Nullable public final Caster getAttacker() { return attacker; @@ -510,7 +398,7 @@ public abstract class Living implements Equine, Caste this.attacker = attacker; } - if (magical.isIn(UTags.BREAKS_SUNGLASSES)) { + if (magical.isIn(UTags.DamageTypes.BREAKS_SUNGLASSES)) { ItemStack glasses = GlassesItem.getForEntity(entity); if (glasses.getItem() == UItems.SUNGLASSES) { ItemStack broken = UItems.BROKEN_SUNGLASSES.getDefaultStack(); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Physics.java b/src/main/java/com/minelittlepony/unicopia/entity/Physics.java index c7aff817..bbc2d1ce 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Physics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Physics.java @@ -21,8 +21,6 @@ public interface Physics extends NbtSerialisable { BlockPos getHeadPosition(); - void spawnSprintingParticles(); - default boolean isGravityNegative() { return getGravityModifier() < 0; } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Transportation.java b/src/main/java/com/minelittlepony/unicopia/entity/Transportation.java new file mode 100644 index 00000000..34632a16 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/entity/Transportation.java @@ -0,0 +1,145 @@ +package com.minelittlepony.unicopia.entity; + +import java.util.ArrayList; +import java.util.List; +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.advancement.UCriteria; +import com.minelittlepony.unicopia.entity.collision.MultiBoundingBoxEntity; +import com.minelittlepony.unicopia.entity.duck.EntityDuck; +import com.minelittlepony.unicopia.entity.mob.AirBalloonEntity; +import com.minelittlepony.unicopia.util.Tickable; + +import net.minecraft.block.ShapeContext; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.MovementType; +import net.minecraft.predicate.entity.EntityPredicates; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.event.GameEvent; + +public class Transportation implements Tickable { + + private final Living living; + + @Nullable + private MultiBoundingBoxEntity vehicle; + @Nullable + private Entity vehicleEntity; + @Nullable + private Box vehicleBox; + + private int ticksInVehicle; + + private Vec3d lastVehiclePosition = Vec3d.ZERO; + + Transportation(Living living) { + this.living = living; + } + + public void setVehicle(@Nullable E vehicle) { + this.vehicle = vehicle; + this.vehicleEntity = vehicle; + updatePreviousPosition(); + } + + @Override + public void tick() { + if (vehicle != null) { + ticksInVehicle++; + } else { + ticksInVehicle = 0; + } + + if (ticksInVehicle > 20 && vehicle instanceof AirBalloonEntity) { + UCriteria.RIDE_BALLOON.trigger(living.asEntity()); + } + } + + public void updatePreviousPosition() { + vehicleBox = getVehicleBox(); + lastVehiclePosition = vehicleEntity == null ? Vec3d.ZERO : vehicleEntity.getPos(); + Entity entity = living.asEntity(); + if (vehicleBox != null && living.asEntity().getBoundingBox().intersects(vehicleBox.expand(0.001, 0.5001, 0.001))) { + entity.setOnGround(true); + entity.onLanding(); + entity.verticalCollision = true; + entity.groundCollision = true; + entity.velocityDirty = true; + entity.velocityModified = true; + } + } + + public void onMove(MovementType movementType) { + if (vehicleBox == null || vehicleEntity == null) { + return; + } + + Entity entity = living.asEntity(); + + Box passengerBox = entity.getBoundingBox().expand(0.001); + Vec3d vehicleMovement = vehicleEntity.getPos().subtract(lastVehiclePosition); + + List shapes = new ArrayList<>(); + vehicle.getCollissionShapes(ShapeContext.of(entity), shapes::add); + vehicleMovement = vehicleMovement.add(vehicleEntity.getVelocity()); + vehicleMovement = Entity.adjustMovementForCollisions(entity, vehicleMovement, passengerBox, entity.getWorld(), shapes); + + Vec3d newPos = entity.getPos().add(vehicleMovement); + + if (!vehicleEntity.isOnGround()) { + // surface check to prevent the player from floating + if (newPos.getY() > vehicleBox.minY + 0.1 || newPos.getY() < vehicleBox.minY + 0.1) { + newPos = new Vec3d(newPos.getX(), vehicleBox.minY + 0.01, newPos.getZ()); + } + // containment checks to prevent the player from falling out of the basket when in flight + if (newPos.getY() < vehicleEntity.getPos().getY() + 3) { + double maxDeviation = 0.1; + double z = MathHelper.clamp(newPos.getZ(), vehicleBox.minZ + maxDeviation, vehicleBox.maxZ - maxDeviation); + double x = MathHelper.clamp(newPos.getX(), vehicleBox.minX + maxDeviation, vehicleBox.maxX - maxDeviation); + + newPos = new Vec3d(x, newPos.getY(), z); + } + + entity.setPosition(newPos); + entity.updateTrackedPosition(newPos.x, newPos.y, newPos.z); + entity.setVelocity(Vec3d.ZERO); + } + + entity.setOnGround(true); + entity.onLanding(); + entity.verticalCollision = true; + entity.groundCollision = true; + + if (entity.distanceTraveled > ((EntityDuck)entity).getNextStepSoundDistance()) { + entity.distanceTraveled -= 0.5; + entity.playSound(vehicle.getWalkedOnSound(entity.getY()), 0.5F, 1); + if (!entity.isSneaky()) { + entity.getWorld().emitGameEvent(entity, GameEvent.STEP, entity.getBlockPos()); + } + } + } + + @Nullable + private Box getVehicleBox() { + if (!EntityPredicates.EXCEPT_SPECTATOR.test(living.asEntity())) { + return null; + } + if (vehicle == null) { + return null; + } + + Box entityBox = living.asEntity().getBoundingBox().stretch(living.asEntity().getVelocity()); + for (Box box : vehicle.getGravityZoneBoxes()) { + if (entityBox.intersects(box.expand(0.001).stretch(vehicleEntity.getVelocity().multiply(1)))) { + return box; + } + } + + setVehicle(null); + return null; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBoundingBoxEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBoundingBoxEntity.java index 82ab40ed..ac7b951e 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBoundingBoxEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBoundingBoxEntity.java @@ -1,13 +1,37 @@ package com.minelittlepony.unicopia.entity.collision; import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.stream.Stream; +import com.minelittlepony.unicopia.entity.collision.EntityCollisions.ComplexCollidable; + +import net.minecraft.block.ShapeContext; import net.minecraft.entity.Entity; +import net.minecraft.sound.SoundEvent; import net.minecraft.util.math.Box; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; -public interface MultiBoundingBoxEntity { +public interface MultiBoundingBoxEntity extends ComplexCollidable { List getBoundingBoxes(); + default List getGravityZoneBoxes() { + return getBoundingBoxes(); + } + + Map> getCollidingEntities(Stream boundingBoxes); + + SoundEvent getWalkedOnSound(double y); + + @Override + default void getCollissionShapes(ShapeContext context, Consumer output) { + for (Box box : getBoundingBoxes()) { + output.accept(VoxelShapes.cuboid(box)); + } + } + static List getBoundingBoxes(Entity entity) { return entity instanceof MultiBoundingBoxEntity multi ? multi.getBoundingBoxes() : List.of(entity.getBoundingBox()); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBox.java b/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBox.java index 921cafbe..e39b6ffc 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBox.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/collision/MultiBox.java @@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.entity.collision; import java.util.Arrays; import java.util.List; import java.util.Optional; +import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -24,6 +25,12 @@ public final class MultiBox extends Box { return box instanceof MultiBox m ? m.first : box; } + public static void forEach(Box box, Consumer consumer) { + if (box instanceof MultiBox m) { + m.children.forEach(consumer); + } + } + private MultiBox(Box first, BoxChildren children) { super(first.minX, first.minY, first.minZ, first.maxX, first.maxY, first.maxZ); this.first = unbox(first); @@ -148,6 +155,12 @@ public final class MultiBox extends Box { return false; } + public void forEach(Consumer consumer) { + for (int i = 0; i < children.length; i++) { + consumer.accept(children[i]); + } + } + @Override public String toString() { return toString.get(); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/damage/UDamageTypes.java b/src/main/java/com/minelittlepony/unicopia/entity/damage/UDamageTypes.java index eae9bb47..3bdc4a8f 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/damage/UDamageTypes.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/damage/UDamageTypes.java @@ -1,18 +1,14 @@ package com.minelittlepony.unicopia.entity.damage; -import java.util.ArrayList; -import java.util.List; - import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.util.registry.DynamicRegistry; -import net.fabricmc.fabric.api.event.registry.DynamicRegistrySetupCallback; import net.minecraft.entity.damage.DamageType; -import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; public interface UDamageTypes { - List> REGISTRY = new ArrayList<>(); + DynamicRegistry REGISTRY = new DynamicRegistry<>(RegistryKeys.DAMAGE_TYPE, key -> new DamageType(key.getValue().getNamespace() + "." + key.getValue().getPath(), 0)); RegistryKey EXHAUSTION = register("magical_exhaustion"); RegistryKey ALICORN_AMULET = register("alicorn_amulet"); @@ -34,18 +30,8 @@ public interface UDamageTypes { RegistryKey SPIKES = register("spikes"); private static RegistryKey register(String name) { - var key = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, Unicopia.id(name)); - REGISTRY.add(key); - return key; + return REGISTRY.register(Unicopia.id(name)); } - static void bootstrap() { - DynamicRegistrySetupCallback.EVENT.register(registries -> { - registries.getOptional(RegistryKeys.DAMAGE_TYPE).ifPresent(registry -> { - REGISTRY.forEach(key -> { - Registry.register(registry, key.getValue(), new DamageType(key.getValue().getNamespace() + "." + key.getValue().getPath(), 0)); - }); - }); - }); - } + static void bootstrap() {} } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/duck/RotatedView.java b/src/main/java/com/minelittlepony/unicopia/entity/duck/RotatedView.java index e5c60d40..0bc5855b 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/duck/RotatedView.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/duck/RotatedView.java @@ -39,7 +39,8 @@ public interface RotatedView { if (!hasTransform() || rotations.isEmpty()) { return y; } - return y - ((y - rotations.peek()) * 2); + + return (rotations.peek() * 2) - y; } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java b/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java index c9f679c6..10e607a9 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java @@ -72,8 +72,8 @@ public class SunBlindnessStatusEffect extends StatusEffect { return true; } - if (entity.getEquippedStack(EquipmentSlot.HEAD).isIn(UTags.SHADES) - || TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(i -> i.isIn(UTags.SHADES)) + if (entity.getEquippedStack(EquipmentSlot.HEAD).isIn(UTags.Items.SHADES) + || TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(i -> i.isIn(UTags.Items.SHADES)) || entity.isSubmergedInWater()) { return false; } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/AirBalloonEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/AirBalloonEntity.java index df970c97..554e84f7 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/AirBalloonEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/AirBalloonEntity.java @@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.entity.mob; import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; import net.minecraft.block.BlockState; import net.minecraft.block.ShapeContext; +import net.minecraft.block.entity.FurnaceBlockEntity; import net.minecraft.entity.*; import net.minecraft.entity.data.*; import net.minecraft.entity.mob.MobEntity; @@ -13,7 +14,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.NbtCompound; import net.minecraft.particle.ParticleTypes; +import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.registry.RegistryKey; +import net.minecraft.sound.SoundEvent; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; @@ -22,22 +25,24 @@ import net.minecraft.util.function.ValueLists; import net.minecraft.util.math.*; import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; -import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.World; import net.minecraft.world.event.GameEvent; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; -import java.util.Set; -import java.util.function.Consumer; +import java.util.function.Function; import java.util.function.IntFunction; -import org.jetbrains.annotations.Nullable; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; +import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.EquineContext; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.USounds; @@ -47,7 +52,6 @@ import com.minelittlepony.unicopia.entity.MagicImmune; import com.minelittlepony.unicopia.entity.collision.EntityCollisions; import com.minelittlepony.unicopia.entity.collision.MultiBoundingBoxEntity; import com.minelittlepony.unicopia.entity.collision.MultiBox; -import com.minelittlepony.unicopia.entity.duck.EntityDuck; import com.minelittlepony.unicopia.item.BasketItem; import com.minelittlepony.unicopia.item.HotAirBalloonItem; import com.minelittlepony.unicopia.item.UItems; @@ -61,12 +65,26 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp private static final TrackedData BASKET_TYPE = DataTracker.registerData(AirBalloonEntity.class, TrackedDataHandlerRegistry.STRING); private static final TrackedData BALLOON_DESIGN = DataTracker.registerData(AirBalloonEntity.class, TrackedDataHandlerRegistry.INTEGER); + public static final byte STATUS_BURNER_INTERACT = (byte)105; + + private static final Predicate RIDER_PREDICATE = EntityPredicates.EXCEPT_SPECTATOR.and(e -> { + return !(e instanceof PlayerEntity p && p.getAbilities().flying); + }); + private boolean prevBoosting; private int prevInflation; - private Vec3d oldPosition = Vec3d.ZERO; private Vec3d manualVelocity = Vec3d.ZERO; - private int ticksFlying; + private int maxFuel = 10000; + private int fuel; + + private final Animatable[] sandbags = IntStream.range(0, 5).mapToObj(Animatable::new).toArray(Animatable[]::new); + private final Animatable burner = new Animatable(5); + + private double prevXDelta; + private double xDelta; + private double prevZDelta; + private double zDelta; public AirBalloonEntity(EntityType type, World world) { super(type, world); @@ -80,12 +98,12 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp dataTracker.startTracking(ASCENDING, false); dataTracker.startTracking(BOOSTING, 0); dataTracker.startTracking(INFLATION, 0); - dataTracker.startTracking(BASKET_TYPE, ""); + dataTracker.startTracking(BASKET_TYPE, BasketType.DEFAULT.id().toString()); dataTracker.startTracking(BALLOON_DESIGN, 0); } public BasketType getBasketType() { - return BasketType.REGISTRY.get(Identifier.tryParse(dataTracker.get(BASKET_TYPE))); + return BasketType.of(dataTracker.get(BASKET_TYPE)); } public void setBasketType(BasketType type) { @@ -100,12 +118,20 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp dataTracker.set(BALLOON_DESIGN, design.ordinal()); } + public Animatable getSandbag(int index) { + return sandbags[MathHelper.clamp(index, 0, sandbags.length - 1)]; + } + + public Animatable getBurner() { + return burner; + } + public boolean hasBalloon() { return getDesign() != BalloonDesign.NONE; } public boolean hasBurner() { - return !getStackInHand(Hand.MAIN_HAND).isEmpty(); + return getHandItems() != null && !getStackInHand(Hand.MAIN_HAND).isEmpty(); } public float getInflation(float tickDelta) { @@ -144,12 +170,12 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp return hasBalloon() && hasBurner() && getInflation() >= getMaxInflation(); } - @Override - public List getBoundingBoxes() { - if (hasBalloon() && getInflation(1) > 0.999F) { - return List.of(getInteriorBoundingBox(), getBalloonBoundingBox()); - } - return List.of(getInteriorBoundingBox()); + public float getXVelocity(float tickDelta) { + return (float)MathHelper.lerp(tickDelta, prevXDelta, xDelta); + } + + public float getZVelocity(float tickDelta) { + return (float)MathHelper.lerp(tickDelta, prevZDelta, zDelta); } @Override @@ -178,6 +204,14 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp } setInflation(inflation); } + + if (fuel > -6 && age % 2 == 0) { + fuel -= boosting ? 50 : 1; + if (fuel <= -6) { + setBoostTicks(0); + setAscending(false); + } + } } else { if (inflation < getMaxInflation() && inflation > 0) { setInflation(--inflation); @@ -200,15 +234,16 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (hasBurner() && isAscending()) { Vec3d burnerPos = getPos().add(0, 3, 0); for (int i = 0; i < (boosting ? 6 : 1); i++) { - getWorld().addParticle( - getStackInHand(Hand.MAIN_HAND).isOf(Items.SOUL_LANTERN) + getWorld().addParticle(fuel <= 0 + ? ParticleTypes.SMOKE + : getStackInHand(Hand.MAIN_HAND).isOf(Items.SOUL_LANTERN) ? ParticleTypes.SOUL_FIRE_FLAME : ParticleTypes.FLAME, rng.nextTriangular(burnerPos.x, 0.25), rng.nextTriangular(burnerPos.y, 1), rng.nextTriangular(burnerPos.z, 0.25), 0, - Math.max(0, getVelocity().y + (boosting ? 0.1 : 0)), + (boosting ? 0.1 : 0), 0 ); } @@ -240,7 +275,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (leashPost.distanceTo(pos) >= 5) { Vec3d newVel = leashPost.subtract(pos).multiply(0.01); if (isAirworthy()) { - setVelocity(newVel.lengthSquared() < 0.03 ? Vec3d.ZERO : newVel); + setVelocity(newVel.lengthSquared() < 0.0001 ? Vec3d.ZERO : newVel); } else { setVelocity(getVelocity().multiply(0.9).add(newVel)); } @@ -248,94 +283,31 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp } prevBoosting = boosting; - oldPosition = getPos(); if (getFireTicks() > 0) { setFireTicks(1); } - if (!isOnGround() && (isAirworthy() || isSubmergedInWater() || isLeashed())) { - ticksFlying++; - } else { - ticksFlying = 0; + for (Animatable bag : sandbags) { + bag.tick(); } + burner.tick(); - updatePassengers(false); super.tick(); - setBoundingBox(MultiBox.of(getBoundingBox(), getBoundingBoxes())); - } - private void updatePassengers(boolean move) { - Set alreadyTicked = new HashSet<>(); - for (Box box : getBoundingBoxes()) { - for (Entity e : getWorld().getOtherEntities(this, box.stretch(getVelocity().multiply(-1)).expand(0, 0.5, 0))) { - - if (e instanceof PlayerEntity p && p.getAbilities().flying) { - continue; - } - - if (!alreadyTicked.add(e)) { - continue; - } - - updatePassenger(e, box, e.getY() > getY() + 3); - } - } - } - - private void updatePassenger(Entity e, Box box, boolean inBalloon) { - - if (e instanceof AirBalloonEntity) { - return; - } - - if (ticksFlying > 0) { - if (Living.getOrEmpty(e).filter(living -> !living.setSupportingEntity(this)).isPresent()) { - return; - } - - Vec3d vel = getVelocity(); - - double height = box.getLengthY(); - - if (height < 3 || e.getBoundingBox().minY > box.minY + height / 2D) { - if (vel.y > 0 && e.getBoundingBox().minY < box.maxY + 0.02) { - e.setPos(e.getX(), box.maxY, e.getZ()); - e.setOnGround(true); - } - if (vel.y < 0 && e.getBoundingBox().minY > box.maxY) { - e.setPos(e.getX(), box.maxY, e.getZ()); - e.setOnGround(true); - } - } - - Living.getOrEmpty(e).ifPresent(living -> { - living.setPositionOffset(e.getPos().subtract(oldPosition)); - living.updateRelativePosition(box); - - if (ticksFlying > 20 && living.getTicksInVehicle() > 20) { - UCriteria.RIDE_BALLOON.trigger(e); - } - }); - } - - if (getWorld().isClient) { - if (e.distanceTraveled > ((EntityDuck)e).getNextStepSoundDistance()) { - e.distanceTraveled--; - e.playSound(inBalloon ? USounds.ENTITY_HOT_AIR_BALLOON_STEP : USounds.ENTITY_HOT_AIR_BALLOON_BASKET_STEP, 0.5F, 1); - if (!e.isSneaky()) { - getWorld().emitGameEvent(e, GameEvent.STEP, getBlockPos()); - } - } - } + prevXDelta = xDelta; + prevZDelta = zDelta; + xDelta = getX() - prevX; + zDelta = getZ() - prevZ; } @Override public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand) { ItemStack stack = player.getStackInHand(hand); - if (hitPos.y > (3 * getInflation(1))) { - if (hasBalloon() && hasBurner()) { + if (hasBalloon() && hasBurner()) { + + if (getBurnerBoundingBox().expand(0.7).contains(getPos().add(hitPos))) { if (stack.isOf(Items.FLINT_AND_STEEL)) { setAscending(!isAscending()); if (isAscending()) { @@ -346,20 +318,43 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (!player.isSneaky()) { getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos()); } + burner.setPulling(); return ActionResult.SUCCESS; } - if (stack.isEmpty() && Math.abs(hitPos.x) > 1 && Math.abs(hitPos.z) > 1) { - double xPush = Math.signum(hitPos.x); - double zPush = Math.signum(hitPos.z); - if (!getWorld().isClient) { - manualVelocity = manualVelocity.add(0.3 * xPush, 0, 0.3 * zPush); - } - } else if (stack.isEmpty() && isAscending()) { + if (stack.isEmpty() && isAscending()) { setBoostTicks(50); + playSound(USounds.ENTITY_HOT_AIR_BALLOON_BOOST, 1, 1); + burner.setPulling(); if (!player.isSneaky()) { getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos()); } + return ActionResult.SUCCESS; + } + } + + if (getInflation(1) >= 1) { + int xPush = (int)Math.signum(hitPos.x); + int zPush = (int)Math.signum(hitPos.z); + + Vec3d absHitPos = getPos().add(hitPos); + + if (stack.isEmpty() && MultiBox.unbox(getBoundingBox()).expand(0.5, 1, 0.5).offset(2 * xPush, 3, 2 * zPush).contains(absHitPos)) { + if (!getWorld().isClient) { + manualVelocity = manualVelocity.add(1.7 * xPush, 0, 1.7 * zPush); + } + getWorld().playSound(null, getX() + hitPos.getX(), getY() + hitPos.getY(), getZ() + hitPos.getZ(), USounds.Vanilla.ENTITY_LEASH_KNOT_PLACE, getSoundCategory(), 1, 1); + if (!player.isSneaky()) { + getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos()); + } + + Vec3d interactCoordinate = new Vec3d(xPush, 0, zPush) + .rotateY((180 + getHorizontalFacing().asRotation()) * MathHelper.RADIANS_PER_DEGREE) + ; + + getSandbag(MathHelper.clamp((int)interactCoordinate.getX(), 0, 1) + MathHelper.clamp((int)interactCoordinate.getZ(), 0, 1) * 2).setPulling(); + + return ActionResult.SUCCESS; } } } @@ -380,13 +375,14 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp getWorld().emitGameEvent(player, GameEvent.EQUIP, getBlockPos()); } setDesign(HotAirBalloonItem.getDesign(getWorld(), stack)); + if (hasBurner() && hasBalloon()) { + UCriteria.CONSTRUCT_BALLOON.trigger(player); + } return ActionResult.SUCCESS; } if (stack.isIn(ConventionalItemTags.SHEARS) && hasBalloon()) { - if (!player.getAbilities().creativeMode) { - stack.damage(1, player, p -> p.sendToolBreakStatus(hand)); - } + stack.damage(1, player, p -> p.sendToolBreakStatus(hand)); setDesign(BalloonDesign.NONE); dropItem(UItems.GIANT_BALLOON); playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 1); @@ -405,9 +401,32 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (!player.isSneaky()) { getWorld().emitGameEvent(player, GameEvent.EQUIP, getBlockPos()); } + if (hasBurner() && hasBalloon()) { + UCriteria.CONSTRUCT_BALLOON.trigger(player); + } return ActionResult.SUCCESS; } + if (hasBurner()) { + int fuel = FurnaceBlockEntity.createFuelTimeMap().getOrDefault(stack.getItem(), 0); + if (fuel > 0) { + if (this.fuel < maxFuel) { + if (this.fuel < 0) { + this.fuel = fuel; + } else { + this.fuel += fuel; + } + if (!player.getAbilities().creativeMode) { + stack.decrement(1); + } + burner.setPulling(); + playSound(USounds.Vanilla.ENTITY_VILLAGER_YES, 1, 1); + return ActionResult.SUCCESS; + } + return ActionResult.FAIL; + } + } + return ActionResult.PASS; } @@ -453,12 +472,16 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp } @Override - protected void fall(double heightDifference, boolean onGround, BlockState state, BlockPos landedPosition) { + public Race getSpecies() { + return Race.UNSET; } @Override - public Race getSpecies() { - return Race.UNSET; + public SoundEvent getWalkedOnSound(double y) { + if (y >= getBalloonBoundingBox().minY) { + return USounds.ENTITY_HOT_AIR_BALLOON_STEP; + } + return USounds.ENTITY_HOT_AIR_BALLOON_BASKET_STEP; } @Override @@ -491,6 +514,18 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp move(MovementType.SELF, getVelocity()); setVelocity(getVelocity().multiply(slipperyness)); } + } else { + Map> collidingEntities = getCollidingEntities(getBoundingBoxes().stream()); + + for (Map.Entry> passengers : collidingEntities.entrySet()) { + for (Entity passenger : passengers.getValue()) { + Living living = Living.living(passenger); + if (living != null) { + living.getTransportation().setVehicle(this); + } + + } + } } updateLimbs(false); } @@ -501,17 +536,41 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp return false; } + @Override + protected Box calculateBoundingBox() { + List boxes = getBoundingBoxes(); + Box box = super.calculateBoundingBox(); + + if (hasBalloon() && getInflation(1) > 0.999F) { + double horScale = -0.5; + // x+ z+ + boxes.add(box.expand(horScale, 1, horScale).offset(2, 3, 2)); + // x- z+ + boxes.add(box.expand(horScale, 1, horScale).offset(-2, 3, 2)); + + // x+ z- + boxes.add(box.expand(horScale, 1, horScale).offset(2, 3, -2)); + // x- z- + boxes.add(box.expand(horScale, 1, horScale).offset(-2, 3, -2)); + } + if (hasBurner()) { + boxes.add(getBurnerBoundingBox()); + } + + return MultiBox.of(box, boxes); + } + @Override public Box getVisibilityBoundingBox() { if (hasBalloon()) { - return MultiBox.unbox(getBoundingBox()).union(getBalloonBoundingBox()); + return getBalloonBoundingBox().withMinY(getY()); } - return MultiBox.unbox(getBoundingBox()); + return getInteriorBoundingBox(); } protected Box getInteriorBoundingBox() { Box box = MultiBox.unbox(getBoundingBox()); - return box.withMinY(box.minY - 0.2).contract(0.2, 0, 0.2); + return box.withMinY(box.minY - 0.05).contract(0.15, 0, 0.15); } protected Box getBalloonBoundingBox() { @@ -521,35 +580,137 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp .expand(2.25, 3.7 * inflation, 2.25); } + protected Box getBurnerBoundingBox() { + float inflation = getInflation(1); + float horScale = -0.9F; + return MultiBox.unbox(getBoundingBox()) + .offset(0, 2.6F * inflation + 0.4F, 0) + .expand(horScale, 0.4, horScale); + } + @Override - public void getCollissionShapes(ShapeContext context, Consumer output) { + public List getGravityZoneBoxes() { + Box balloon = getBalloonBoundingBox().expand(0.001); + Box interior = getInteriorBoundingBox().expand(0.001); + if (hasBalloon() && getInflation(1) > 0.999F) { + return List.of( + // interior - basket to top of balloon + interior.withMaxY(balloon.minY).withMinY(interior.maxY), + // balloon + balloon.withMaxY(balloon.maxY + 0.5).withMinY(balloon.maxY) + ); + } + return List.of(interior.withMaxY(balloon.minY).withMinY(interior.maxY)); + } - Box box = MultiBox.unbox(getBoundingBox()).expand(0.3, 0, 0.3); + @Override + public List getBoundingBoxes() { + List boxes = new ArrayList<>(); + Box box = getInteriorBoundingBox(); + Box mainBox = MultiBox.unbox(getBoundingBox()); - double wallheight = box.maxY + 0.7; - double wallThickness = 0.7; + boxes.add(box); + + double wallheight = box.maxY + 0.72; + double wallThickness = 0.3; + double halfDoorWidth = 0.5; if (!getBasketType().isOf(BoatEntity.Type.BAMBOO)) { + // front left (next to door) - output.accept(VoxelShapes.cuboid(new Box(box.minX, box.minY, box.minZ, box.minX + wallThickness + 0.2, wallheight, box.minZ + wallThickness))); + boxes.add(new Box(mainBox.minX, mainBox.minY, mainBox.minZ, mainBox.minX + wallThickness + halfDoorWidth, wallheight, box.minZ + wallThickness)); // front right (next to door) - output.accept(VoxelShapes.cuboid(new Box(box.maxX - wallThickness - 0.2, box.minY, box.minZ, box.maxX, wallheight, box.minZ + wallThickness))); + boxes.add(new Box(mainBox.maxX - wallThickness - halfDoorWidth, mainBox.minY, mainBox.minZ, mainBox.maxX, wallheight, box.minZ + wallThickness)); // back - output.accept(VoxelShapes.cuboid(new Box(box.minX, box.minY, box.maxZ - wallThickness, box.maxX, wallheight, box.maxZ))); + boxes.add(new Box(mainBox.minX, mainBox.minY, box.maxZ - wallThickness, mainBox.maxX, wallheight, mainBox.maxZ)); // left - output.accept(VoxelShapes.cuboid(new Box(box.maxX - wallThickness, box.minY, box.minZ, box.maxX, wallheight, box.maxZ))); + boxes.add(new Box(box.maxX - wallThickness, mainBox.minY, mainBox.minZ, mainBox.maxX, wallheight, mainBox.maxZ)); // right - output.accept(VoxelShapes.cuboid(new Box(box.minX, box.minY, box.minZ, box.minX + wallThickness, wallheight, box.maxZ))); + boxes.add(new Box(mainBox.minX, mainBox.minY, mainBox.minZ, box.minX + wallThickness, wallheight, mainBox.maxZ)); } - // top of balloon - if (hasBalloon() && getInflation() > 0) { - output.accept(VoxelShapes.cuboid(getBalloonBoundingBox())); + if (hasBalloon() && getInflation(1) >= 1) { + Box balloonBox = getBalloonBoundingBox(); + boxes.add(balloonBox.withMinY(balloonBox.maxY - 0.5)); + boxes.add(balloonBox.withMaxX(balloonBox.minX + 0.5)); + boxes.add(balloonBox.withMinX(balloonBox.maxX - 0.5)); + boxes.add(balloonBox.withMaxZ(balloonBox.minZ + 0.5)); + boxes.add(balloonBox.withMinZ(balloonBox.maxZ - 0.5)); + + boxes.add(balloonBox.withMaxX(balloonBox.minX + 2).withMaxY(balloonBox.minY + 0.2)); + boxes.add(balloonBox.withMinX(balloonBox.maxX - 2).withMaxY(balloonBox.minY + 0.2)); + boxes.add(balloonBox.withMaxZ(balloonBox.minZ + 2).withMaxY(balloonBox.minY + 0.2)); + boxes.add(balloonBox.withMinZ(balloonBox.maxZ - 2).withMaxY(balloonBox.minY + 0.2)); + } + + float yaw = (180 - getHorizontalFacing().asRotation()) * MathHelper.RADIANS_PER_DEGREE; + if (yaw != 0) { + Vec3d center = getPos(); + for (int i = 0; i < boxes.size(); i++) { + Box b = boxes.get(i); + Vec3d min = new Vec3d(b.minX, b.minY, b.minZ).subtract(center).rotateY(yaw).add(center); + Vec3d max = new Vec3d(b.maxX, b.maxY, b.maxZ).subtract(center).rotateY(yaw).add(center); + boxes.set(i, new Box(min.x, min.y, min.z, max.x, max.y, max.z)); + } + } + + return boxes; + } + + @Override + public void move(MovementType movementType, Vec3d movement) { + Vec3d oldPos = this.getPos(); + List boundingBoxes = getGravityZoneBoxes(); + super.move(movementType, movement); + if (movementType == MovementType.SELF) { + Vec3d actualMovement = getPos().subtract(oldPos); + Map> collidingEntities = getCollidingEntities( + boundingBoxes.stream().map(box -> box.stretch(actualMovement)) + ); + + for (Map.Entry> passengers : collidingEntities.entrySet()) { + for (Entity passenger : passengers.getValue()) { + movePassenger(passenger, actualMovement); + } + } } } + private void movePassenger(Entity passenger, Vec3d movement) { + if (!EntityPredicates.EXCEPT_SPECTATOR.test(passenger)) { + return; + } + + Living living = Living.living(passenger); + if (living != null) { + if (living.getPhysics().isGravityNegative()) { + movement = movement.multiply(1, -1, 1); + } + living.getTransportation().setVehicle(this); + } + + List shapes = new ArrayList<>(); + getCollissionShapes(ShapeContext.of(passenger), shapes::add); + movement = Entity.adjustMovementForCollisions(passenger, movement, passenger.getBoundingBox(), getWorld(), shapes); + + passenger.setPosition(passenger.getPos().add(movement)); + passenger.updateTrackedPosition(passenger.getX(), passenger.getY(), passenger.getZ()); + } + + @Override + public Map> getCollidingEntities(Stream boundingBoxes) { + return boundingBoxes.collect(Collectors.toMap(Function.identity(), box -> { + return getWorld().getOtherEntities(this, box.expand(0.001).stretch(getVelocity().multiply(1)), RIDER_PREDICATE).stream().distinct().toList(); + })); + } + + @Override + protected void fall(double heightDifference, boolean onGround, BlockState state, BlockPos landedPosition) { + } + + @Override public void readCustomDataFromNbt(NbtCompound compound) { super.readCustomDataFromNbt(compound); @@ -559,6 +720,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp setBoostTicks(compound.getInt("boostTicks")); prevInflation = compound.getInt("inflationAmount"); setInflation(prevInflation); + fuel = MathHelper.clamp(compound.getInt("fuel"), 0, maxFuel); } @Override @@ -569,6 +731,55 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp compound.putBoolean("burnerActive", isAscending()); compound.putInt("boostTicks", getBoostTicks()); compound.putInt("inflationAmount", getInflation()); + compound.putInt("fuel", fuel); + } + + @Override + public void handleStatus(byte status) { + if (status >= 100 && status < 100 + sandbags.length) { + getSandbag(status % sandbags.length).setPulling(); + } else if (status == STATUS_BURNER_INTERACT) { + } else { + super.handleStatus(status); + } + } + + static boolean isBetween(double value, double min, double max) { + return value >= min && value <= max; + } + + public class Animatable { + private final int id; + private int pullTicks; + private int prevPullTicks; + private boolean pulling; + + public Animatable(int id) { + this.id = id; + } + + public void setPulling() { + if (!getWorld().isClient) { + getWorld().sendEntityStatus(AirBalloonEntity.this, (byte)(100 + id)); + } + pulling = true; + } + + public float getPullProgress(float tickDelta) { + return MathHelper.lerp(tickDelta, (float)prevPullTicks, pullTicks) / 6F; + } + + public void tick() { + prevPullTicks = pullTicks; + if (pulling && pullTicks < 6) { + pullTicks++; + } else { + pulling = false; + if (pullTicks > 0) { + pullTicks--; + } + } + } } @SuppressWarnings("deprecation") @@ -601,6 +812,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp public record BasketType(Identifier id, @Nullable BoatEntity.Type boatType) { private static final Map REGISTRY = new HashMap<>(); + public static final BasketType DEFAULT = of(BoatEntity.Type.OAK); static { Arrays.stream(BoatEntity.Type.values()).forEach(BasketType::of); } @@ -610,7 +822,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp } public static BasketType of(String name) { - Identifier id = Identifier.tryParse(name); + Identifier id = name == null || name.isEmpty() ? null : Identifier.tryParse(name); if (id == null) { return of(BoatEntity.Type.OAK); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java index 088529b2..6a0731b4 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java @@ -11,6 +11,7 @@ import java.util.stream.Collectors; import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.item.ButterflyItem; import com.minelittlepony.unicopia.util.NbtSerialisable; @@ -72,6 +73,10 @@ public class ButterflyEntity extends AmbientEntity { return createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2); } + public static boolean canSpawn(EntityType type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) { + return world.getBlockState(pos.down()).isIn(UTags.Blocks.BUTTERFLIES_SPAWNABLE_ON); + } + @Override public float getSoundPitch() { return super.getSoundPitch() * 0.95F; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/SpecterEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/SpecterEntity.java new file mode 100644 index 00000000..91f9b407 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/SpecterEntity.java @@ -0,0 +1,118 @@ +package com.minelittlepony.unicopia.entity.mob; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.particle.FootprintParticleEffect; +import com.minelittlepony.unicopia.particle.ParticleUtils; + +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ai.goal.ActiveTargetGoal; +import net.minecraft.entity.ai.goal.LookAroundGoal; +import net.minecraft.entity.ai.goal.LookAtEntityGoal; +import net.minecraft.entity.ai.goal.MeleeAttackGoal; +import net.minecraft.entity.ai.goal.RevengeGoal; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.goal.WanderAroundFarGoal; +import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.mob.HostileEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.particle.BlockStateParticleEffect; +import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.GameRules; +import net.minecraft.world.World; + +public class SpecterEntity extends HostileEntity { + public static DefaultAttributeContainer.Builder createAttributes() { + return HostileEntity.createHostileAttributes() + .add(EntityAttributes.GENERIC_MAX_HEALTH, 16F) + .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.5F); + } + + private double stepDistance; + private double nextStepDistance; + private boolean wasLeft; + + public SpecterEntity(EntityType entityType, World world) { + super(entityType, world); + } + + @Override + protected void initGoals() { + this.goalSelector.add(1, new SwimGoal(this)); + this.goalSelector.add(4, new MeleeAttackGoal(this, 1.0, true)); + this.goalSelector.add(5, new WanderAroundFarGoal(this, 0.8)); + this.goalSelector.add(6, new LookAtEntityGoal(this, PlayerEntity.class, 8.0f)); + this.goalSelector.add(6, new LookAroundGoal(this)); + this.targetSelector.add(1, new RevengeGoal(this)); + this.targetSelector.add(2, new TargetGoal<>(this, PlayerEntity.class)); + } + + @SuppressWarnings("deprecation") + @Override + public void tick() { + Vec3d prevPosition = getPos(); + super.tick(); + if (getBrightnessAtEyes() < 0.5F || getTarget() != null) { + ParticleUtils.spawnParticles(ParticleTypes.AMBIENT_ENTITY_EFFECT, this, 6); + + if (getWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) { + if (getWorld().getBlockState(getBlockPos()).isIn(BlockTags.REPLACEABLE_BY_TREES)) { + getWorld().breakBlock(getBlockPos(), true); + } + } + } + + if (!hasVehicle() && isOnGround()) { + stepDistance += getPos().subtract(prevPosition).horizontalLength() * 0.6F; + if (stepDistance >= nextStepDistance) { + nextStepDistance = stepDistance + 1; + wasLeft = !wasLeft; + float offset = 0.4F; + float yaw = getHeadYaw(); + Vec3d offsetVec = new Vec3d((wasLeft ? offset : -offset), 0, 0).rotateY(yaw); + getWorld().addParticle(new FootprintParticleEffect(yaw), true, getX() + offsetVec.getX(), getY(), getZ() + offsetVec.getZ(), 0, 0, 0); + ParticleUtils.spawnParticles(new BlockStateParticleEffect(ParticleTypes.BLOCK, getSteppingBlockState()), getWorld(), getPos(), 6); + playSound(getSteppingBlockState().getSoundGroup().getStepSound(), 0.5F, 1); + } + } + } + + @Override + public float getSoundPitch() { + return super.getSoundPitch() * 0.3F; + } + + @Override + @Nullable + protected SoundEvent getHurtSound(DamageSource source) { + return null; + } + + @Override + protected void playSwimSound(float volume) { + + } + + @Override + protected void onSwimmingStart() { + + } + + static class TargetGoal extends ActiveTargetGoal { + public TargetGoal(SpecterEntity specter, Class targetEntityClass) { + super(specter, targetEntityClass, true); + } + + @SuppressWarnings("deprecation") + @Override + public boolean canStart() { + return mob.getBrightnessAtEyes() < 0.5F && super.canStart(); + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java index 1f4289ac..f2034ea2 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java @@ -374,7 +374,7 @@ public class SpellbookEntity extends MobEntity implements MagicImmune { @Override public boolean isInvulnerableTo(DamageSource damageSource) { - return super.isInvulnerableTo(damageSource) || damageSource.isIn(UTags.SPELLBOOK_IMMUNE_TO); + return super.isInvulnerableTo(damageSource) || damageSource.isIn(UTags.DamageTypes.SPELLBOOK_IMMUNE_TO); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/UEntities.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/UEntities.java index 32fd4c3e..8b1b4d14 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/UEntities.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/UEntities.java @@ -8,7 +8,6 @@ import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.projectile.MagicBeamEntity; import com.minelittlepony.unicopia.projectile.MagicProjectileEntity; import com.minelittlepony.unicopia.projectile.PhysicsBodyProjectileEntity; - import net.fabricmc.fabric.api.biome.v1.BiomeModifications; import net.fabricmc.fabric.api.biome.v1.BiomeSelectionContext; import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; @@ -18,39 +17,48 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnGroup; +import net.minecraft.entity.SpawnRestriction.Location; import net.minecraft.entity.decoration.painting.PaintingVariant; import net.minecraft.entity.mob.FlyingEntity; +import net.minecraft.entity.mob.HostileEntity; import net.minecraft.registry.*; import net.minecraft.registry.tag.BiomeTags; +import net.minecraft.world.Heightmap.Type; public interface UEntities { - EntityType BUTTERFLY = register("butterfly", FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT, ButterflyEntity::new) + EntityType BUTTERFLY = register("butterfly", FabricEntityTypeBuilder.createMob().spawnGroup(SpawnGroup.AMBIENT).entityFactory(ButterflyEntity::new) + .spawnRestriction(Location.NO_RESTRICTIONS, Type.WORLD_SURFACE_WG, ButterflyEntity::canSpawn) .dimensions(EntityDimensions.fixed(0.25F, 0.25F))); EntityType THROWN_ITEM = register("thrown_item", FabricEntityTypeBuilder.create(SpawnGroup.MISC, MagicProjectileEntity::new) .trackRangeBlocks(100) + .disableSummon() .trackedUpdateRate(2) .dimensions(EntityDimensions.fixed(0.25F, 0.25F))); EntityType MUFFIN = register("muffin", FabricEntityTypeBuilder.create(SpawnGroup.MISC, (type, world) -> new PhysicsBodyProjectileEntity(type, world, UItems.MUFFIN.getDefaultStack())) .trackRangeBlocks(100) + .disableSummon() .trackedUpdateRate(2) .dimensions(EntityDimensions.fixed(0.25F, 0.25F))); EntityType MAGIC_BEAM = register("magic_beam", FabricEntityTypeBuilder.create(SpawnGroup.MISC, MagicBeamEntity::new) .trackRangeBlocks(100) + .disableSummon() .trackedUpdateRate(2) .dimensions(EntityDimensions.fixed(0.25F, 0.25F))); EntityType FLOATING_ARTEFACT = register("floating_artefact", FabricEntityTypeBuilder.create(SpawnGroup.MISC, FloatingArtefactEntity::new) .trackRangeBlocks(200) + .disableSummon() .dimensions(EntityDimensions.fixed(1, 1))); EntityType CAST_SPELL = register("cast_spell", FabricEntityTypeBuilder.create(SpawnGroup.MISC, CastSpellEntity::new) .trackRangeBlocks(200) + .disableSummon() .dimensions(EntityDimensions.changing(4, 4))); EntityType TWITTERMITE = register("twittermite", FabricEntityTypeBuilder.create(SpawnGroup.MISC, FairyEntity::new) .trackRangeBlocks(200) .dimensions(EntityDimensions.fixed(0.1F, 0.1F))); EntityType FRIENDLY_CREEPER = register("friendly_creeper", FabricEntityTypeBuilder.create(SpawnGroup.MISC, FriendlyCreeperEntity::new) .trackRangeChunks(8) - .dimensions(EntityDimensions.fixed(0.6f, 1.7f)) - ); + .disableSummon() + .dimensions(EntityDimensions.fixed(0.6f, 1.7f))); EntityType SPELLBOOK = register("spellbook", FabricEntityTypeBuilder.create(SpawnGroup.MISC, SpellbookEntity::new) .trackRangeBlocks(200) .dimensions(EntityDimensions.fixed(0.9F, 0.5F))); @@ -75,6 +83,11 @@ public interface UEntities { EntityType IGNOMINIOUS_BULB = register("ignominious_bulb", FabricEntityTypeBuilder.create(SpawnGroup.MISC, IgnominiousBulbEntity::new) .trackRangeChunks(8) .dimensions(EntityDimensions.fixed(3, 2))); + EntityType SPECTER = register("specter", FabricEntityTypeBuilder.createMob().spawnGroup(SpawnGroup.MONSTER).entityFactory(SpecterEntity::new) + .spawnRestriction(Location.ON_GROUND, Type.WORLD_SURFACE, HostileEntity::canSpawnInDark) + .fireImmune() + .spawnableFarFromPlayer() + .dimensions(EntityDimensions.fixed(1, 2))); static EntityType register(String name, FabricEntityTypeBuilder builder) { EntityType type = builder.build(); @@ -90,6 +103,7 @@ public interface UEntities { FabricDefaultAttributeRegistry.register(FRIENDLY_CREEPER, FriendlyCreeperEntity.createCreeperAttributes()); FabricDefaultAttributeRegistry.register(LOOT_BUG, LootBugEntity.createSilverfishAttributes()); FabricDefaultAttributeRegistry.register(IGNOMINIOUS_BULB, IgnominiousBulbEntity.createMobAttributes()); + FabricDefaultAttributeRegistry.register(SPECTER, SpecterEntity.createAttributes()); if (!Unicopia.getConfig().disableButterflySpawning.get()) { final Predicate butterflySpawnable = BiomeSelectors.foundInOverworld() @@ -106,6 +120,8 @@ public interface UEntities { ), SpawnGroup.AMBIENT, BUTTERFLY, 7, 5, 19); } + BiomeModifications.addSpawn(BiomeSelectors.spawnsOneOf(EntityType.ZOMBIE), SpawnGroup.MONSTER, SPECTER, 2, 1, 2); + UTradeOffers.bootstrap(); EntityBehaviour.bootstrap(); UEntityAttributes.bootstrap(); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java index ff73a2f8..74e38429 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java @@ -35,7 +35,7 @@ public interface UTradeOffers { factories.add(buyForEmeralds(UItems.GEMSTONE, 3, 1, 20, 1, 0.05F)); }); TradeOfferHelper.registerVillagerOffers(VillagerProfession.FARMER, 2, factories -> { - factories.add(buy(Items.EMERALD, 4, UTags.APPLE_SEEDS, 2, 20, 1, 0.05F)); + factories.add(buy(Items.EMERALD, 4, UTags.Items.APPLE_SEEDS, 2, 20, 1, 0.05F)); factories.add(buy(Items.EMERALD, 8, UItems.MANGO, 1, 15, 1, 0.025F)); }); @@ -47,7 +47,7 @@ public interface UTradeOffers { factories.add(buy(ItemTags.SMALL_FLOWERS, 2, UItems.DAFFODIL_DAISY_SANDWICH, 1, 10, 6, 0.08F)); factories.add(buy(UItems.ZAP_APPLE, 45, UItems.ZAP_APPLE_JAM_JAR, 5, 50, 3, 0.07F)); factories.add(buy(UItems.CIDER, 1, UItems.FRIENDSHIP_BRACELET, 1, 6, 1, 0.05F)); - factories.add(buy(UItems.GEMSTONE, 5, UTags.FRESH_APPLES, 2, 12, 3, 0.05F)); + factories.add(buy(UItems.GEMSTONE, 5, UTags.Items.FRESH_APPLES, 2, 12, 3, 0.05F)); factories.add(buy(Items.EMERALD, 4, UItems.MANGO, 1, 35, 1, 0.025F)); factories.add(new JarredItemTradeOfferFactory()); }); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/FlightStuntUtil.java b/src/main/java/com/minelittlepony/unicopia/entity/player/FlightStuntUtil.java new file mode 100644 index 00000000..c5975dbe --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/FlightStuntUtil.java @@ -0,0 +1,19 @@ +package com.minelittlepony.unicopia.entity.player; + +import com.minelittlepony.unicopia.entity.mob.StormCloudEntity; +import com.minelittlepony.unicopia.util.MutableVector; + +import net.minecraft.util.math.BlockPos; + +public class FlightStuntUtil { + public static boolean isPerformingDive(Pony pony, MutableVector velocity) { + double horizontalSpeed = velocity.horizontalLengthSquared(); + double verticalSpeed = velocity.y; + return horizontalSpeed != 0 && verticalSpeed < -0.3F && (verticalSpeed / horizontalSpeed) < -0.3F; + } + + public static boolean isFlyingLow(Pony pony, MutableVector velocity) { + BlockPos pos = pony.asEntity().getBlockPos(); + return velocity.horizontalLengthSquared() > 0.005F && (pos.getY() - StormCloudEntity.findSurfaceBelow(pony.asWorld(), pos).getY()) < 6; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java index 26c6d4c7..61effece 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java @@ -7,6 +7,7 @@ import com.minelittlepony.unicopia.ability.magic.SpellPredicate; import com.minelittlepony.unicopia.ability.magic.spell.AbstractDisguiseSpell; import com.minelittlepony.unicopia.client.render.spell.DarkVortexSpellRenderer; +import net.minecraft.client.MinecraftClient; import net.minecraft.util.math.Vec3d; public class PlayerCamera extends MotionCompositor { @@ -18,30 +19,28 @@ public class PlayerCamera extends MotionCompositor { } public float calculateRoll() { + return player.getInterpolator().interpolate("roll", (float)applyModifiers(-getMotionRoll()), 15); + } - double roll = 0; + public float calculateFirstPersonRoll() { + return player.getInterpolator().interpolate("roll_fp", (float)applyModifiers(-getMotionRoll() * getFovScale() * 0.25F), 25); + } - if (player.getMotion().isFlying()) { - Vec3d vel = player.asEntity().getVelocity(); - - roll -= calculateRoll(player.asEntity(), vel.x, vel.y, vel.z); - } - - if (player.getPhysics().isGravityNegative()) { - roll *= -1; - roll += 180; - } - - if (player.asEntity().age > 10) { - roll = player.getInterpolator().interpolate("roll", (float)roll, 15); + private double getMotionRoll() { + if (!player.getMotion().isFlying() || player.asEntity().hasVehicle() || player.asEntity().isOnGround()) { + return 0; } + Vec3d vel = player.asEntity().getVelocity(); + return calculateRoll(player.asEntity(), vel.x, vel.y, vel.z); + } + private double applyModifiers(double motionRoll) { if (player.getAcrobatics().isFloppy()) { - roll += 90; + motionRoll += 90; } - return (float)roll; + return player.getPhysics().isGravityNegative() ? 180 - motionRoll : motionRoll; } public float calculatePitch(float pitch) { @@ -61,13 +60,16 @@ public class PlayerCamera extends MotionCompositor { } public double calculateFieldOfView(double fov) { - fov += player.getMagicalReserves().getExertion().get() / 5F; - fov += getEnergyAddition(); + fov += (player.getMagicalReserves().getExertion().get() / 5F) * getFovScale(); + fov += getEnergyAddition() * getFovScale(); fov += DarkVortexSpellRenderer.getCameraDistortion() * 2.5F; - return fov; } + private float getFovScale() { + return MinecraftClient.getInstance().options.getFovEffectScale().getValue().floatValue(); + } + protected float getEnergyAddition() { int maxE = (int)Math.floor(player.getMagicalReserves().getEnergy().get() * 100); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerDimensions.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerDimensions.java index 70eee553..a2e5a329 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerDimensions.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerDimensions.java @@ -25,11 +25,7 @@ public final class PlayerDimensions { .or(() -> physics.isFlyingSurvival ? FLYING_EYE_HEIGHT : physics.isGravityNegative() ? Optional.of(dimensions.height) : Optional.empty()) .map(h -> { if (physics.isGravityNegative()) { - if (pony.asEntity().isSneaking()) { - h += 0.2F; - } - - return dimensions.height - h; + return dimensions.height - h + 0.1F; } return h; }); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index 35116ead..fc53f9b0 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -32,7 +32,6 @@ import com.minelittlepony.unicopia.util.*; import net.fabricmc.fabric.api.tag.convention.v1.ConventionalBlockTags; import net.minecraft.block.*; import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.EntityPose; import net.minecraft.entity.EntityType; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LightningEntity; @@ -61,6 +60,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab private int ticksInAir; private int ticksToGlide; private int ticksDiving; + private int ticksFlyingLow; private float thrustScale = 0; private float prevThrustScale; @@ -194,7 +194,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab private FlightType recalculateFlightType() { DimensionType dimension = entity.getWorld().getDimension(); - if ((RegistryUtils.isIn(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE, UTags.HAS_NO_ATMOSPHERE) + if ((RegistryUtils.isIn(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE, UTags.DimensionTypes.HAS_NO_ATMOSPHERE) || Unicopia.getConfig().dimensionsWithoutAtmosphere.get().contains(RegistryUtils.getId(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE).toString())) && !OxygenUtils.API.hasOxygen(entity)) { return FlightType.NONE; @@ -253,18 +253,6 @@ public class PlayerPhysics extends EntityPhysics implements Tickab final MutableVector velocity = new MutableVector(entity.getVelocity()); - if (isGravityNegative()) { - velocity.y *= -1; - } - - if (isGravityNegative() && !entity.isSneaking() && entity.isInSneakingPose()) { - float currentHeight = entity.getDimensions(entity.getPose()).height; - float sneakingHeight = entity.getDimensions(EntityPose.STANDING).height; - - entity.setPos(entity.getX(), entity.getY() + currentHeight - sneakingHeight, entity.getZ()); - entity.setPose(EntityPose.STANDING); - } - FlightType type = recalculateFlightType(); boolean typeChanged = type != lastFlightType; @@ -314,10 +302,6 @@ public class PlayerPhysics extends EntityPhysics implements Tickab if (entity.isOnGround() || (!creative && entity.horizontalCollision)) { cancelFlight(false); } - - if (entity.isClimbing() && (entity.horizontalCollision || ((LivingEntityDuck)entity).isJumping())) { - velocity.y = -0.2F; - } } isFlyingSurvival = entity.getAbilities().flying && !creative; @@ -352,28 +336,9 @@ public class PlayerPhysics extends EntityPhysics implements Tickab velocity.y /= 2F; } - double horizontalSpeed = this.getHorizontalMotion(); - double verticalSpeed = velocity.y; - - if (Abilities.RAINBOOM.canUse(pony.getCompositeRace()) && horizontalSpeed != 0 && verticalSpeed < -0.3F && (verticalSpeed / horizontalSpeed) < -0.3F) { - ticksDiving++; - } else { - ticksDiving = 0; - } - - if (ticksDiving > 0 && ticksDiving % 25 == 0) { - pony.getMagicalReserves().getCharge().addPercent(12.5F); - } + tickStunts(velocity); } else { - prevStrafe = 0; - strafe = 0; - ticksInAir = 0; - wallHitCooldown = MAX_WALL_HIT_CALLDOWN; - soundPlaying = false; - descentRate = 0; - ticksDiving = 0; - updraft.update(0, 100); - windStrength.update(0, 100); + tickGrounded(); if (Abilities.RAINBOOM.canUse(pony.getCompositeRace()) && entity.isOnGround()) { pony.getMagicalReserves().getCharge().set(0); @@ -384,10 +349,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab } } } else { - descentRate = 0; - soundPlaying = false; - updraft.update(0, 100); - windStrength.update(0, 100); + tickGrounded(); } if (!entity.isOnGround()) { @@ -396,10 +358,10 @@ public class PlayerPhysics extends EntityPhysics implements Tickab velocity.z /= heavyness; } - if (isGravityNegative()) { - velocity.y *= -1; - } - + float maximum = 1.5F; + velocity.x = MathHelper.clamp(velocity.x, -maximum, maximum); + velocity.y = MathHelper.clamp(velocity.y, -maximum, maximum); + velocity.z = MathHelper.clamp(velocity.z, -maximum, maximum); entity.setVelocity(velocity.toImmutable()); if (isFlying() && !entity.isFallFlying() && !pony.getAcrobatics().isHanging() && pony.isClient()) { @@ -418,6 +380,46 @@ public class PlayerPhysics extends EntityPhysics implements Tickab } } + private void tickGrounded() { + prevStrafe = 0; + strafe = 0; + ticksInAir = 0; + wallHitCooldown = MAX_WALL_HIT_CALLDOWN; + soundPlaying = false; + descentRate = 0; + ticksDiving = 0; + ticksFlyingLow = 0; + updraft.update(0, 0); + windStrength.update(0, 0); + } + + private void tickStunts(MutableVector velocity) { + boolean canPerformStunts = Abilities.RAINBOOM.canUse(pony.getCompositeRace()); + ticksDiving = canPerformStunts && FlightStuntUtil.isPerformingDive(pony, velocity) ? (ticksDiving + 1) : 0; + ticksFlyingLow = canPerformStunts && FlightStuntUtil.isFlyingLow(pony, velocity) ? (ticksFlyingLow + 1) : 0; + + if (ticksDiving > 0) { + float horDiveScale = MathHelper.clamp(ticksDiving / 100F, 0, 10); + float verDiveScale = MathHelper.clamp(ticksDiving / 90F, 0, 5); + velocity.multiply(1 + horDiveScale, 1 + verDiveScale, 1 + horDiveScale); + } + + if (ticksFlyingLow > 0) { + float horDiveScale = MathHelper.clamp(ticksFlyingLow / 1000F, 0, 0.9F); + float verDiveScale = MathHelper.clamp(ticksFlyingLow / 900F, 0, 0.5F); + velocity.multiply(1 + horDiveScale, 1 + verDiveScale, 1 + horDiveScale); + } + + if (pony.asEntity().age % 2 == 0) { + if (ticksDiving > 0) { + pony.getMagicalReserves().getCharge().addPercent(1F); + } + if (ticksFlyingLow > 0) { + pony.getMagicalReserves().getCharge().addPercent(ticksFlyingLow / 200F); + } + } + } + private void tickFlight(FlightType type, MutableVector velocity) { if (type.isArtifical()) { tickArtificialFlight(velocity); @@ -580,7 +582,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab if (entity.isOnGround() || !force) { BlockState steppingState = pony.asEntity().getSteppingBlockState(); - if (steppingState.isIn(UTags.KICKS_UP_DUST)) { + if (steppingState.isIn(UTags.Blocks.KICKS_UP_DUST)) { pony.addParticle(new BlockStateParticleEffect(UParticles.DUST_CLOUD, steppingState), pony.getOrigin().toCenterPos(), Vec3d.ZERO); } else { Supplier pos = VecHelper.sphere(pony.asWorld().getRandom(), 0.5D); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index 3cb7f3cf..fad4a95d 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -388,6 +388,13 @@ public class Pony extends Living implements Copyable, Update boolean mustAvoidAir = getCompositeRace().includes(Race.SEAPONY) && !sw.getFluidState(getOrigin()).isIn(FluidTags.WATER); if (mustAvoidSun || mustAvoidAir) { SpawnLocator.selectSpawnPosition(sw, entity, mustAvoidAir, mustAvoidSun); + if ((mustAvoidAir && !sw.getFluidState(getOrigin()).isIn(FluidTags.WATER)) + || (mustAvoidSun && MeteorlogicalUtil.isPositionExposedToSun(sw, getOrigin()))) { + Race suppressedRace = getSuppressedRace(); + if (suppressedRace != Race.UNSET) { + setSpecies(suppressedRace); + } + } } } ticksSunImmunity = INITIAL_SUN_IMMUNITY; @@ -544,7 +551,7 @@ public class Pony extends Living implements Copyable, Update } if (getObservedSpecies() == Race.BAT && !entity.hasPortalCooldown()) { - boolean hasShades = TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(s -> s.isIn(UTags.SHADES)); + boolean hasShades = TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(s -> s.isIn(UTags.Items.SHADES)); if (!this.hasShades && hasShades && getObservedSpecies() == Race.BAT) { UCriteria.WEAR_SHADES.trigger(entity); } @@ -631,7 +638,7 @@ public class Pony extends Living implements Copyable, Update float max = 0.6F; return Optional.of(new Vec3d( MathHelper.clamp(speed.x * factor, -max, max), - speed.y * ((speed.y * getPhysics().getGravitySignum()) > 0 ? 1.2 : 1.101), + speed.y * (speed.y > 0 ? 1.2 : 1.101), MathHelper.clamp(speed.z * factor, -max, max) )); } @@ -715,11 +722,8 @@ public class Pony extends Living implements Copyable, Update } public Optional onImpact(float distance, float damageMultiplier, DamageSource cause) { - float originalDistance = distance; - distance *= gravity.getGravityModifier(); - boolean extraProtection = getSpellSlot().get(SpellType.SHIELD, false).isPresent(); if (!entity.isCreative() && !entity.isSpectator()) { @@ -750,7 +754,7 @@ public class Pony extends Living implements Copyable, Update } if (getObservedSpecies() == Race.KIRIN - && (stack.isIn(UTags.COOLS_OFF_KIRINS) || PotionUtil.getPotion(stack) == Potions.WATER)) { + && (stack.isIn(UTags.Items.COOLS_OFF_KIRINS) || PotionUtil.getPotion(stack) == Potions.WATER)) { getMagicalReserves().getCharge().multiply(0.5F); getSpellSlot().get(SpellType.RAGE, false).ifPresent(RageAbilitySpell::setExtenguishing); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/BaitedFishingRodItem.java b/src/main/java/com/minelittlepony/unicopia/item/BaitedFishingRodItem.java new file mode 100644 index 00000000..3efa7744 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/BaitedFishingRodItem.java @@ -0,0 +1,41 @@ +package com.minelittlepony.unicopia.item; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.projectile.FishingBobberEntity; +import net.minecraft.item.FishingRodItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; +import net.minecraft.world.World; + +public class BaitedFishingRodItem extends FishingRodItem { + + public BaitedFishingRodItem(Settings settings) { + super(settings); + } + + @Override + public TypedActionResult use(World world, PlayerEntity user, Hand hand) { + TypedActionResult result = super.use(world, user, hand); + if (!world.isClient) { + if (user.fishHook != null) { + user.fishHook.discard(); + ItemStack stack = user.getStackInHand(hand); + int lure = (EnchantmentHelper.getLure(stack) + 1) * 2; + int luck = (EnchantmentHelper.getLuckOfTheSea(stack) + 1) * 2; + world.spawnEntity(new FishingBobberEntity(user, world, luck, lure)); + } + + if (result.getValue().isOf(this)) { + ItemStack stack = Items.FISHING_ROD.getDefaultStack(); + if (result.getValue().hasNbt()) { + stack.setNbt(result.getValue().getNbt().copy()); + } + return TypedActionResult.success(stack, world.isClient()); + } + } + return result; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/BasketItem.java b/src/main/java/com/minelittlepony/unicopia/item/BasketItem.java index 2c9e4f18..65a1deca 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/BasketItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/BasketItem.java @@ -68,7 +68,7 @@ public class BasketItem extends Item implements Dispensable { } if (hit.getType() == HitResult.Type.BLOCK) { - return placeEntity(stack, world, hit.getPos().x, hit.getPos().y, hit.getPos().z, user.getYaw() + 180, user); + return placeEntity(stack, world, hit.getPos().x, hit.getPos().y, hit.getPos().z, user.getHorizontalFacing().asRotation(), user); } return TypedActionResult.pass(stack); @@ -76,9 +76,11 @@ public class BasketItem extends Item implements Dispensable { private TypedActionResult placeEntity(ItemStack stack, World world, double x, double y, double z, float yaw, @Nullable PlayerEntity user) { AirBalloonEntity entity = UEntities.AIR_BALLOON.create(world); - entity.updatePositionAndAngles(x, y, z, 0, 0); + yaw += 180; + entity.updatePositionAndAngles(x, y, z, yaw, 0); entity.setHeadYaw(yaw); entity.setBodyYaw(yaw); + entity.setYaw(yaw); entity.setBasketType(type); if (!world.isSpaceEmpty(entity, entity.getBoundingBox())) { return TypedActionResult.fail(stack); @@ -92,7 +94,6 @@ public class BasketItem extends Item implements Dispensable { stack.decrement(1); } } - return TypedActionResult.success(stack, world.isClient()); } } \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/item/DrinkableItem.java b/src/main/java/com/minelittlepony/unicopia/item/ConsumableItem.java similarity index 84% rename from src/main/java/com/minelittlepony/unicopia/item/DrinkableItem.java rename to src/main/java/com/minelittlepony/unicopia/item/ConsumableItem.java index 23fa0dd1..dba7218d 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/DrinkableItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/ConsumableItem.java @@ -11,9 +11,13 @@ import net.minecraft.stat.Stats; import net.minecraft.util.UseAction; import net.minecraft.world.World; -public class DrinkableItem extends Item { - public DrinkableItem(Item.Settings settings) { +public class ConsumableItem extends Item { + + private final UseAction action; + + public ConsumableItem(Item.Settings settings, UseAction action) { super(settings); + this.action = action; } @Override @@ -30,6 +34,6 @@ public class DrinkableItem extends Item { @Override public UseAction getUseAction(ItemStack stack) { - return UseAction.DRINK; + return action; } } diff --git a/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java b/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java index d1e4d3b4..c334124f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java @@ -20,6 +20,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.EndRodBlock; import net.minecraft.entity.*; import net.minecraft.entity.mob.MobEntity; +import net.minecraft.entity.passive.MerchantEntity; import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.*; @@ -34,7 +35,9 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public class CrystalHeartItem extends Item implements FloatingArtefactEntity.Artifact { - static final Predicate TARGET_PREDICATE = EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR.and(EntityPredicates.VALID_ENTITY).and(e -> (e instanceof PlayerEntity || e instanceof MobEntity)); + static final Predicate TARGET_PREDICATE = EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR + .and(EntityPredicates.VALID_ENTITY) + .and(e -> (e instanceof PlayerEntity || e instanceof MobEntity)); private static final Supplier> ITEM_MAP = Suppliers.memoize(() -> { return Map.of( Items.BUCKET, UItems.LOVE_BUCKET, @@ -125,8 +128,9 @@ public class CrystalHeartItem extends Item implements FloatingArtefactEntity.Art LivingEntity living = (LivingEntity)e; if (e instanceof PlayerEntity - || (living instanceof TameableEntity && ((TameableEntity)living).isTamed()) - || (living instanceof Saddleable && ((Saddleable)living).isSaddled())) { + || (e instanceof TameableEntity t && t.isTamed()) + || (e instanceof Saddleable s && s.isSaddled()) + || (e instanceof MerchantEntity)) { if (living.getHealth() < living.getMaxHealth()) { outputs.add(living); } @@ -145,19 +149,8 @@ public class CrystalHeartItem extends Item implements FloatingArtefactEntity.Art return; } - float gives; - float takes; - - if (supply > demand) { - gives = supply / demand; - takes = 1; - } else if (demand > supply) { - takes = demand / supply; - gives = 1; - } else { - gives = 1; - takes = 1; - } + float gives = supply > demand ? supply / demand : 1; + float takes = demand > supply ? demand / supply : 1; inputs.forEach(input -> { input.damage(entity.damageOf(UDamageTypes.LIFE_DRAINING), takes); @@ -195,7 +188,7 @@ public class CrystalHeartItem extends Item implements FloatingArtefactEntity.Art BlockPos tip = entity.getBlockPos().offset(direction); BlockState tipState = entity.getWorld().getBlockState(tip); - if (!tipState.isIn(UTags.CRYSTAL_HEART_ORNAMENT) || (!tipState.contains(EndRodBlock.FACING)|| tipState.get(EndRodBlock.FACING) != direction.getOpposite())) { + if (!tipState.isIn(UTags.Blocks.CRYSTAL_HEART_ORNAMENT) || (!tipState.contains(EndRodBlock.FACING)|| tipState.get(EndRodBlock.FACING) != direction.getOpposite())) { return false; } @@ -214,6 +207,6 @@ public class CrystalHeartItem extends Item implements FloatingArtefactEntity.Art } private boolean isDiamond(BlockState state) { - return state.isIn(UTags.CRYSTAL_HEART_BASE); + return state.isIn(UTags.Blocks.CRYSTAL_HEART_BASE); } } diff --git a/src/main/java/com/minelittlepony/unicopia/item/EmptyJarItem.java b/src/main/java/com/minelittlepony/unicopia/item/EmptyJarItem.java new file mode 100644 index 00000000..e156ccb5 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/EmptyJarItem.java @@ -0,0 +1,60 @@ +package com.minelittlepony.unicopia.item; + +import com.minelittlepony.unicopia.block.UBlocks; +import com.minelittlepony.unicopia.entity.IItemEntity; +import com.minelittlepony.unicopia.entity.ItemImpl; + +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.minecraft.block.Block; +import net.minecraft.client.render.RenderLayer; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.ItemEntity; +import net.minecraft.entity.LightningEntity; +import net.minecraft.entity.Entity.RemovalReason; +import net.minecraft.item.BlockItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; + +public class EmptyJarItem extends BlockItem implements ItemImpl.GroundTickCallback { + public EmptyJarItem(Block block, Settings settings) { + super(block, settings); + } + + @Override + public ActionResult onGroundTick(IItemEntity item) { + ItemEntity entity = item.get().asEntity(); + + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), UBlocks.CLOUD_JAR, UBlocks.STORM_JAR, UBlocks.LIGHTNING_JAR, UBlocks.ZAP_JAR); + + entity.setInvulnerable(true); + + if (!entity.getWorld().isClient + && !entity.isRemoved() + && entity.getItemAge() > 100 + && entity.getWorld().isThundering() + && entity.getWorld().isSkyVisible(entity.getBlockPos()) + && entity.getWorld().random.nextInt(130) == 0) { + LightningEntity lightning = EntityType.LIGHTNING_BOLT.create(entity.getWorld()); + lightning.refreshPositionAfterTeleport(entity.getX(), entity.getY(), entity.getZ()); + + entity.remove(RemovalReason.DISCARDED); + entity.getWorld().spawnEntity(lightning); + + ItemEntity neu = EntityType.ITEM.create(entity.getWorld()); + neu.copyPositionAndRotation(entity); + neu.setStack(new ItemStack(this == UItems.RAIN_CLOUD_JAR ? UItems.STORM_CLOUD_JAR : UItems.LIGHTNING_JAR)); + neu.setInvulnerable(true); + + entity.getWorld().spawnEntity(neu); + + ItemEntity copy = EntityType.ITEM.create(entity.getWorld()); + copy.copyPositionAndRotation(entity); + copy.setInvulnerable(true); + copy.setStack(entity.getStack()); + copy.getStack().decrement(1); + + entity.getWorld().spawnEntity(copy); + } + return ActionResult.PASS; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/FancyBedItem.java b/src/main/java/com/minelittlepony/unicopia/item/FancyBedItem.java index cc63ea79..c9f2f404 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/FancyBedItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/FancyBedItem.java @@ -6,7 +6,6 @@ import org.jetbrains.annotations.Nullable; import com.google.common.base.Suppliers; import com.minelittlepony.unicopia.block.FancyBedBlock; - import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.entity.BlockEntity; diff --git a/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java b/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java index ee6dc0dc..f11c401a 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java @@ -1,10 +1,11 @@ package com.minelittlepony.unicopia.item; -import com.minelittlepony.unicopia.entity.IItemEntity; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.mob.ButterflyEntity; import com.minelittlepony.unicopia.entity.mob.UEntities; import com.minelittlepony.unicopia.projectile.MagicProjectileEntity; +import com.minelittlepony.unicopia.projectile.ProjectileDelegate; import net.minecraft.block.Block; import net.minecraft.block.Blocks; @@ -20,16 +21,20 @@ import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.item.ItemStack; import net.minecraft.particle.ParticleTypes; import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundEvent; import net.minecraft.text.Text; -import net.minecraft.util.ActionResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.MathHelper; import net.minecraft.world.WorldEvents; -public class FilledJarItem extends JarItem implements ChameleonItem { - +public class FilledJarItem extends ProjectileItem implements ProjectileDelegate.HitListener, ChameleonItem { public FilledJarItem(Settings settings) { - super(settings, false, false, false); + super(settings, 0); + } + + @Override + public SoundEvent getThrowSound(ItemStack stack) { + return USounds.ENTITY_JAR_THROW; } @Override @@ -42,20 +47,8 @@ public class FilledJarItem extends JarItem implements ChameleonItem { return false; } - @Override - public ActionResult onGroundTick(IItemEntity item) { - return ActionResult.PASS; - } - - @Override - protected float getProjectileDamage(ItemStack stack) { - return 0; - } - @Override public void onImpact(MagicProjectileEntity projectile, EntityHitResult hit) { - super.onImpact(projectile, hit); - Entity entity = hit.getEntity(); if (!entity.isAttackable() || !(projectile instanceof FlyingItemEntity)) { diff --git a/src/main/java/com/minelittlepony/unicopia/item/ForageableItem.java b/src/main/java/com/minelittlepony/unicopia/item/ForageableItem.java new file mode 100644 index 00000000..bb129cf6 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/ForageableItem.java @@ -0,0 +1,93 @@ +package com.minelittlepony.unicopia.item; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Supplier; + +import com.minelittlepony.unicopia.InteractionManager; +import com.minelittlepony.unicopia.item.enchantment.EnchantmentUtil; +import com.minelittlepony.unicopia.server.world.BlockDestructionManager; + +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.HoeItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ToolMaterials; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.sound.SoundCategory; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; + +public class ForageableItem extends Item { + private static final List REGISTRY = new ArrayList<>(); + static { + UseBlockCallback.EVENT.register((PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) -> { + if (player.shouldCancelInteraction()) { + return ActionResult.PASS; + } + + ItemStack stack = player.getStackInHand(hand); + if (!stack.isIn(ItemTags.HOES)) { + return ActionResult.PASS; + } + + BlockPos pos = hitResult.getBlockPos(); + BlockState state = world.getBlockState(pos); + + ActionResult result = ActionResult.PASS; + + if (state.isIn(BlockTags.LEAVES)) { + player.swingHand(hand); + world.playSound(player, pos, state.getSoundGroup().getHitSound(), SoundCategory.BLOCKS); + InteractionManager.instance().addBlockBreakingParticles(pos, hitResult.getSide()); + + int miningLevel = (stack.getItem() instanceof HoeItem hoe ? hoe.getMaterial().getMiningLevel() : 59); + + for (ForageableItem item : REGISTRY) { + if ((result = item.onTryForage(world, pos, state, stack, player, miningLevel)).isAccepted()) { + stack.damage(1, player, p -> p.sendToolBreakStatus(hand)); + return result; + } + } + } + + return result.isAccepted() ? ActionResult.SUCCESS : ActionResult.PASS; + }); + } + + private final Supplier targetBlock; + + public ForageableItem(Settings settings, Supplier targetBlock) { + super(settings); + this.targetBlock = targetBlock; + REGISTRY.add(this); + } + + public ActionResult onTryForage(World world, BlockPos pos, BlockState state, ItemStack stack, PlayerEntity player, int miningLevel) { + if (state.isOf(targetBlock.get())) { + int spawnChance = (int)((1F - MathHelper.clamp(miningLevel / (float)ToolMaterials.NETHERITE.getMiningLevel(), 0, 1)) * 32); + spawnChance -= EnchantmentUtil.getLuck(1, player); + + if (spawnChance <= 0 || world.random.nextInt(spawnChance) == 0) { + Block.dropStack(world, pos, new ItemStack(this, 1 + EnchantmentHelper.getLooting(player))); + world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(state)); + if (BlockDestructionManager.of(world).damageBlock(pos, world.getRandom().nextBetween(3, 7)) >= BlockDestructionManager.MAX_DAMAGE) { + world.breakBlock(pos, true); + } + return ActionResult.SUCCESS; + } + return ActionResult.FAIL; + } + return ActionResult.PASS; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java b/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java index 8a9c2416..40e10dc4 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java @@ -39,8 +39,11 @@ public class FriendshipBraceletItem extends WearableItem implements DyeableItem, public TypedActionResult use(World world, PlayerEntity player, Hand hand) { ItemStack stack = player.getStackInHand(hand); - if (!isSigned(stack) && (EquinePredicates.PLAYER_UNICORN.test(player) || EquinePredicates.PLAYER_PEGASUS.test(player) - || AmuletSelectors.PEARL_NECKLACE.test(player))) { + if (!isSigned(stack) && ( + EquinePredicates.PLAYER_UNICORN.test(player) + || EquinePredicates.RACE_CAN_INFLUENCE_WEATHER.test(player) + || AmuletSelectors.PEARL_NECKLACE.test(player) + )) { player.setCurrentHand(hand); ItemStack result = stack.copy(); diff --git a/src/main/java/com/minelittlepony/unicopia/item/HeavyProjectileItem.java b/src/main/java/com/minelittlepony/unicopia/item/HeavyProjectileItem.java index bf2aedf4..e76a2920 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/HeavyProjectileItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/HeavyProjectileItem.java @@ -5,37 +5,19 @@ import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.projectile.PhysicsBodyProjectileEntity; -import net.minecraft.block.DispenserBlock; -import net.minecraft.block.dispenser.ProjectileDispenserBehavior; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.PersistentProjectileEntity; -import net.minecraft.entity.projectile.ProjectileEntity; import net.minecraft.item.ItemStack; import net.minecraft.sound.SoundEvent; -import net.minecraft.util.math.Position; import net.minecraft.world.World; public class HeavyProjectileItem extends ProjectileItem { - public HeavyProjectileItem(Settings settings, float projectileDamage) { super(settings, projectileDamage); - DispenserBlock.registerBehavior(this, new ProjectileDispenserBehavior(){ - @Override - protected ProjectileEntity createProjectile(World world, Position position, ItemStack stack) { - ProjectileEntity projectile = HeavyProjectileItem.this.createProjectile(stack, world, null); - projectile.setPosition(position.getX(), position.getY(), position.getZ()); - return projectile; - } - - @Override - protected float getVariation() { - return 0; - } - }); } @Override - protected PhysicsBodyProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { + public PhysicsBodyProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { PhysicsBodyProjectileEntity projectile = player == null ? new PhysicsBodyProjectileEntity(world, stack.copyWithCount(1)) : new PhysicsBodyProjectileEntity(world, player, stack.copyWithCount(1)); @@ -47,7 +29,7 @@ public class HeavyProjectileItem extends ProjectileItem { } @Override - protected SoundEvent getThrowSound(ItemStack stack) { + public SoundEvent getThrowSound(ItemStack stack) { return USounds.ENTITY_JAR_THROW; } } diff --git a/src/main/java/com/minelittlepony/unicopia/item/HorseShoeItem.java b/src/main/java/com/minelittlepony/unicopia/item/HorseShoeItem.java index a9ed6129..d21f7fd2 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/HorseShoeItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/HorseShoeItem.java @@ -74,7 +74,7 @@ public class HorseShoeItem extends HeavyProjectileItem { } @Override - protected PhysicsBodyProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { + public PhysicsBodyProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { PhysicsBodyProjectileEntity projectile = super.createProjectile(stack, world, player); projectile.setDamageType(UDamageTypes.HORSESHOE); @@ -99,7 +99,7 @@ public class HorseShoeItem extends HeavyProjectileItem { } @Override - protected SoundEvent getThrowSound(ItemStack stack) { + public SoundEvent getThrowSound(ItemStack stack) { return USounds.Vanilla.ITEM_TRIDENT_THROW; } diff --git a/src/main/java/com/minelittlepony/unicopia/item/JarItem.java b/src/main/java/com/minelittlepony/unicopia/item/JarItem.java deleted file mode 100644 index 6943d0c5..00000000 --- a/src/main/java/com/minelittlepony/unicopia/item/JarItem.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.minelittlepony.unicopia.item; - -import com.minelittlepony.unicopia.AwaitTickQueue; -import com.minelittlepony.unicopia.USounds; -import com.minelittlepony.unicopia.entity.IItemEntity; -import com.minelittlepony.unicopia.entity.ItemImpl; -import com.minelittlepony.unicopia.particle.LightningBoltParticleEffect; -import com.minelittlepony.unicopia.particle.ParticleUtils; -import com.minelittlepony.unicopia.particle.UParticles; -import com.minelittlepony.unicopia.projectile.MagicProjectileEntity; -import com.minelittlepony.unicopia.projectile.ProjectileDelegate; - -import net.minecraft.block.Block; -import net.minecraft.block.Blocks; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.ItemEntity; -import net.minecraft.entity.LightningEntity; -import net.minecraft.entity.Entity.RemovalReason; -import net.minecraft.item.ItemStack; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.sound.SoundEvent; -import net.minecraft.util.ActionResult; -import net.minecraft.util.math.ChunkSectionPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.Heightmap; -import net.minecraft.world.WorldEvents; - -public class JarItem extends ProjectileItem implements ItemImpl.GroundTickCallback, ProjectileDelegate.HitListener { - - private final boolean rain; - private final boolean thunder; - private final boolean lightning; - - public JarItem(Settings settings, boolean rain, boolean thunder, boolean lightning) { - super(settings, 0.5F); - this.rain = rain; - this.thunder = thunder; - this.lightning = lightning; - } - - @Override - public ActionResult onGroundTick(IItemEntity item) { - ItemEntity entity = item.get().asEntity(); - - entity.setInvulnerable(true); - - if (!lightning - && !entity.getWorld().isClient - && !entity.isRemoved() - && entity.getItemAge() > 100 - && entity.getWorld().isThundering() - && entity.getWorld().isSkyVisible(entity.getBlockPos()) - && entity.getWorld().random.nextInt(130) == 0) { - LightningEntity lightning = EntityType.LIGHTNING_BOLT.create(entity.getWorld()); - lightning.refreshPositionAfterTeleport(entity.getX(), entity.getY(), entity.getZ()); - - entity.remove(RemovalReason.DISCARDED); - entity.getWorld().spawnEntity(lightning); - - ItemEntity neu = EntityType.ITEM.create(entity.getWorld()); - neu.copyPositionAndRotation(entity); - neu.setStack(new ItemStack(this == UItems.RAIN_CLOUD_JAR ? UItems.STORM_CLOUD_JAR : UItems.LIGHTNING_JAR)); - neu.setInvulnerable(true); - - entity.getWorld().spawnEntity(neu); - - ItemEntity copy = EntityType.ITEM.create(entity.getWorld()); - copy.copyPositionAndRotation(entity); - copy.setInvulnerable(true); - copy.setStack(entity.getStack()); - copy.getStack().decrement(1); - - entity.getWorld().spawnEntity(copy); - } - return ActionResult.PASS; - } - - @Override - protected SoundEvent getThrowSound(ItemStack stack) { - return USounds.ENTITY_JAR_THROW; - } - - @Override - public void onImpact(MagicProjectileEntity projectile) { - if (!projectile.getWorld().isClient()) { - ServerWorld world = (ServerWorld)projectile.getWorld(); - - if (rain || thunder) { - // clear weather time = number of ticks for which the weather is clear - // rain time = ticks until rain gets toggled (reset the tick after toggling) - // thunder time = ticks until thundering gets toggled (reset the tick after toggling) - - // clear weather time - // Number of ticks weather must stay clear. - // Raining and thundering, and raining/thundering times are kept to false and 0 - // when clear weather time is <= 0 - // - wait for thunder time to reach zero then toggle thundering - // - wait for rain time to reach zero then toggle raining - // when thunder time is <= 0 - // - randomly pick a new value for thunder time - // when rain time is <= 0 - // - randomly pick a new value for rain time - - world.setWeather(0, 0, rain, thunder); - - if (thunder) { - for (int i = world.random.nextInt(7); i > 0; i--) { - AwaitTickQueue.scheduleTask(world, w -> { - LightningEntity bolt = EntityType.LIGHTNING_BOLT.create(world); - bolt.setCosmetic(true); - bolt.refreshPositionAfterTeleport(Vec3d.ofBottomCenter(world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, world.getRandomPosInChunk( - ChunkSectionPos.getBlockCoord(ChunkSectionPos.getSectionCoord(projectile.getX())), - 0, - ChunkSectionPos.getBlockCoord(ChunkSectionPos.getSectionCoord(projectile.getZ())), - 15 - )).up(32))); - world.spawnEntity(bolt); - }, 15 + world.random.nextInt(12)); - } - } - } - - if (lightning) { - LightningEntity lightning = EntityType.LIGHTNING_BOLT.create(world); - lightning.refreshPositionAfterTeleport(projectile.getX(), projectile.getY(), projectile.getZ()); - - world.spawnEntity(lightning); - } - } - - if (lightning) { - ParticleUtils.spawnParticle(projectile.getWorld(), LightningBoltParticleEffect.DEFAULT, projectile.getPos(), Vec3d.ZERO); - } - - if (rain || thunder) { - projectile.getWorld().syncWorldEvent(WorldEvents.SPLASH_POTION_SPLASHED, projectile.getBlockPos(), thunder ? 0x888888 : 0xF8F8F8); - - for (int i = projectile.getWorld().random.nextInt(3) + 1; i >= 0; i--) { - ParticleUtils.spawnParticle(projectile.getWorld(), UParticles.CLOUDS_ESCAPING, - projectile.getX(), projectile.getY(), projectile.getZ(), - projectile.getWorld().random.nextFloat() - 0.5, - 0, - projectile.getWorld().random.nextFloat() - 0.5 - ); - } - } - - projectile.getWorld().syncWorldEvent(WorldEvents.BLOCK_BROKEN, projectile.getBlockPos(), Block.getRawIdFromState(Blocks.GLASS.getDefaultState())); - } -} diff --git a/src/main/java/com/minelittlepony/unicopia/item/MuffinItem.java b/src/main/java/com/minelittlepony/unicopia/item/MuffinItem.java index 3fb05b3d..260f7360 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/MuffinItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/MuffinItem.java @@ -10,13 +10,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class MuffinItem extends HeavyProjectileItem { - public MuffinItem(Settings settings, float projectileDamage) { super(settings, projectileDamage); } @Override - protected PhysicsBodyProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { + public PhysicsBodyProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { PhysicsBodyProjectileEntity projectile = super.createProjectile(stack, world, player); projectile.setBouncy(); projectile.setDamage(0); diff --git a/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java b/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java index 7098e7a4..9ff3941f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java @@ -29,7 +29,7 @@ public class PineappleItem extends Item { }); if (world.random.nextInt(20) == 0) { - RegistryUtils.pickRandom(world, UTags.PINEAPPLE_EFFECTS, e -> !user.hasStatusEffect(e)).ifPresent(effect -> { + RegistryUtils.pickRandom(world, UTags.StatusEffects.PINEAPPLE_EFFECTS, e -> !user.hasStatusEffect(e)).ifPresent(effect -> { user.addStatusEffect(new StatusEffectInstance(effect, 10, 1)); }); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java b/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java index a7f430c4..5dc90908 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java @@ -41,7 +41,7 @@ public class PolearmItem extends SwordItem { @Override public boolean isSuitableFor(BlockState state) { - return state.isIn(UTags.POLEARM_MINEABLE); + return state.isIn(UTags.Blocks.POLEARM_MINEABLE); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/item/ProjectileItem.java b/src/main/java/com/minelittlepony/unicopia/item/ProjectileItem.java index 5e7a643d..43c3608a 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/ProjectileItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/ProjectileItem.java @@ -1,72 +1,34 @@ package com.minelittlepony.unicopia.item; -import org.jetbrains.annotations.Nullable; - -import com.minelittlepony.unicopia.projectile.MagicProjectileEntity; -import com.minelittlepony.unicopia.util.SoundEmitter; - +import com.minelittlepony.unicopia.projectile.Projectile; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.projectile.ProjectileEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvent; -import net.minecraft.stat.Stats; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.world.World; -abstract class ProjectileItem extends Item { +abstract class ProjectileItem extends Item implements Projectile { private final float projectileDamage; public ProjectileItem(Settings settings, float projectileDamage) { super(settings); this.projectileDamage = projectileDamage; + Projectile.makeDispensable(this); } @Override public TypedActionResult use(World world, PlayerEntity player, Hand hand) { - - if (isFood() && !player.isSneaking()) { + if (isFood() && !player.shouldCancelInteraction()) { return super.use(world, player, hand); } - ItemStack stack = player.getStackInHand(hand); - - SoundEmitter.playSoundAt(player, - getThrowSound(stack), SoundCategory.NEUTRAL, - 0.5F, - 0.4F / (world.random.nextFloat() * 0.4F + 0.8F)); - - if (!world.isClient) { - world.spawnEntity(createProjectile(stack.copyWithCount(1), world, player)); - } - - player.incrementStat(Stats.USED.getOrCreateStat(this)); - - if (!player.isCreative()) { - stack.decrement(1); - } - - return TypedActionResult.success(stack, world.isClient()); + return triggerThrow(world, player, hand); } - protected ProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { - MagicProjectileEntity projectile = player == null ? new MagicProjectileEntity(world) : new MagicProjectileEntity(world, player); - projectile.setItem(stack); - projectile.setThrowDamage(getProjectileDamage(stack)); - projectile.setMaxAge(-1); - if (player != null) { - projectile.setVelocity(player, player.getPitch(), player.getYaw(), 0, 1.5F, 1); - } - return projectile; - } - - protected abstract SoundEvent getThrowSound(ItemStack stack); - - protected float getProjectileDamage(ItemStack stack) { + @Override + public float getProjectileDamage(ItemStack stack) { return projectileDamage; } - } diff --git a/src/main/java/com/minelittlepony/unicopia/item/UFoodComponents.java b/src/main/java/com/minelittlepony/unicopia/item/UFoodComponents.java index a7ff322a..80a2e9a5 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UFoodComponents.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UFoodComponents.java @@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.item; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.FoodComponent; +import net.minecraft.item.FoodComponents; public interface UFoodComponents { FoodComponent OATS = builder(1, 0.7F).build(); @@ -12,8 +13,8 @@ public interface UFoodComponents { .statusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 1200, 1), 0.3F) .statusEffect(new StatusEffectInstance(StatusEffects.SPEED, 1200, 1), 0.2F) .build(); - FoodComponent DAFODIL_DAISY_SANDWICH = builder(3, 2).build(); - FoodComponent HAY_BURGER = builder(7, 1.4F).build(); + FoodComponent DAFODIL_DAISY_SANDWICH = builder(3, 1.4F).build(); + FoodComponent BURGER = builder(7, 1.4F).build(); FoodComponent HAY_FRIES = builder(4, 2).build(); FoodComponent CRISPY_HAY_FRIES = builder(6, 7).build(); @@ -23,10 +24,13 @@ public interface UFoodComponents { FoodComponent JUICE = builder(2, 1.8F).alwaysEdible().build(); FoodComponent BURNED_JUICE = builder(3, 1).build(); - @Deprecated - FoodComponent RANDOM_FOLIAGE = builder(2, 1).build(); - @Deprecated - FoodComponent RANDOM_FOLIAGE_FILLING = builder(18, 1).build(); + FoodComponent NUT_BOWL = FoodComponents.BAKED_POTATO; //builder(4, 0.6F).build(); + + FoodComponent OATMEAL_COOKIE = FoodComponents.COOKIE; //builder(2, 0.1F).build(); + FoodComponent CHOCOLATE_OATMEAL_COOKIE = builder(3, 0.4F).build(); + FoodComponent SCONE = builder(2, 0.2F).build(); + FoodComponent FRIED_EGG = builder(4, 0.4F).build(); + FoodComponent WORMS = builder(1, 1.5F).alwaysEdible().meat().build(); FoodComponent INSECTS = builder(1, 0).alwaysEdible().build(); @@ -55,9 +59,7 @@ public interface UFoodComponents { FoodComponent POISON_JOKE = builder(0, 0F).alwaysEdible().snack().build(); - @Deprecated FoodComponent SHELL = builder(3, 5).build(); - @Deprecated FoodComponent SHELLY = builder(6, 7).build(); static FoodComponent.Builder builder(int hunger, float saturation) { diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index 8d30b634..5e69e0d6 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -12,10 +12,12 @@ import com.minelittlepony.unicopia.item.cloud.CloudBedItem; import com.minelittlepony.unicopia.item.enchantment.UEnchantments; import com.minelittlepony.unicopia.item.group.ItemGroupRegistry; import com.minelittlepony.unicopia.item.group.UItemGroups; +import com.minelittlepony.unicopia.recipe.URecipes; import com.terraformersmc.terraform.boat.api.TerraformBoatType; import com.terraformersmc.terraform.boat.api.TerraformBoatTypeRegistry; import com.terraformersmc.terraform.boat.api.item.TerraformBoatItemHelper; +import net.minecraft.block.Blocks; import net.minecraft.entity.attribute.EntityAttributeModifier; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.vehicle.BoatEntity; @@ -26,6 +28,7 @@ import net.fabricmc.fabric.api.registry.CompostingChanceRegistry; import net.fabricmc.fabric.api.registry.FuelRegistry; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Rarity; +import net.minecraft.util.UseAction; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.Registries; @@ -49,12 +52,12 @@ public interface UItems { FriendshipBraceletItem FRIENDSHIP_BRACELET = register("friendship_bracelet", new FriendshipBraceletItem(new FabricItemSettings().rarity(Rarity.UNCOMMON)), ItemGroups.TOOLS); Item PLUNDER_VINE = register("plunder_vine", new BlockItem(UBlocks.PLUNDER_VINE_BUD, new Item.Settings())); - Item EMPTY_JAR = register("empty_jar", new JarItem(new Item.Settings().maxCount(16).fireproof(), false, false, false), ItemGroups.FUNCTIONAL); - FilledJarItem FILLED_JAR = register("filled_jar", new FilledJarItem(new Item.Settings().maxCount(1).recipeRemainder(EMPTY_JAR))); - Item RAIN_CLOUD_JAR = register("rain_cloud_jar", new JarItem(new Item.Settings().maxCount(1).fireproof().recipeRemainder(EMPTY_JAR), true, false, false), ItemGroups.FUNCTIONAL); - Item STORM_CLOUD_JAR = register("storm_cloud_jar", new JarItem(new Item.Settings().maxCount(1).fireproof().recipeRemainder(EMPTY_JAR), true, true, false), ItemGroups.FUNCTIONAL); - Item LIGHTNING_JAR = register("lightning_jar", new JarItem(new Item.Settings().maxCount(1).fireproof().recipeRemainder(EMPTY_JAR), false, false, true), ItemGroups.FUNCTIONAL); - Item ZAP_APPLE_JAM_JAR = register("zap_apple_jam_jar", new JarItem(new Item.Settings().maxCount(1).fireproof().recipeRemainder(EMPTY_JAR), false, false, true), ItemGroups.FUNCTIONAL); + Item EMPTY_JAR = register("empty_jar", new EmptyJarItem(UBlocks.JAR, new Item.Settings().fireproof()), ItemGroups.FUNCTIONAL); + FilledJarItem FILLED_JAR = register("filled_jar", new FilledJarItem(new Item.Settings().maxCount(16).fireproof().recipeRemainder(EMPTY_JAR))); + Item RAIN_CLOUD_JAR = register("rain_cloud_jar", new WeatherJarItem(UBlocks.CLOUD_JAR, new Item.Settings().maxCount(16).fireproof().recipeRemainder(EMPTY_JAR), WeatherJarItem.Type.RAIN), ItemGroups.FUNCTIONAL); + Item STORM_CLOUD_JAR = register("storm_cloud_jar", new WeatherJarItem(UBlocks.STORM_JAR, new Item.Settings().maxCount(16).fireproof().recipeRemainder(EMPTY_JAR), WeatherJarItem.Type.THUNDER), ItemGroups.FUNCTIONAL); + Item LIGHTNING_JAR = register("lightning_jar", new WeatherJarItem(UBlocks.LIGHTNING_JAR, new Item.Settings().maxCount(16).fireproof().recipeRemainder(EMPTY_JAR), WeatherJarItem.Type.LIGHTNING), ItemGroups.FUNCTIONAL); + Item ZAP_APPLE_JAM_JAR = register("zap_apple_jam_jar", new WeatherJarItem(UBlocks.ZAP_JAR, new Item.Settings().maxCount(16).fireproof().recipeRemainder(EMPTY_JAR), WeatherJarItem.Type.LIGHTNING), ItemGroups.FUNCTIONAL); Item TOAST = register("toast", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.TOAST)), ItemGroups.FOOD_AND_DRINK); Item BURNED_TOAST = register("burned_toast", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.BURNED_TOAST)), ItemGroups.FOOD_AND_DRINK); @@ -74,8 +77,14 @@ public interface UItems { Item IMPORTED_OATS = register("imported_oats", new Item(new Item.Settings().food(UFoodComponents.IMPORTED_OATS)), ItemGroups.FOOD_AND_DRINK); Item OATMEAL = register("oatmeal", new OatmealItem(new Item.Settings().recipeRemainder(Items.BOWL).maxCount(1).food(UFoodComponents.OATMEAL)), ItemGroups.FOOD_AND_DRINK); + Item OATMEAL_COOKIE = register("oatmeal_cookie", new Item(new Item.Settings().food(UFoodComponents.OATMEAL_COOKIE)), ItemGroups.FOOD_AND_DRINK); + Item CHOCOLATE_OATMEAL_COOKIE = register("chocolate_oatmeal_cookie", new Item(new Item.Settings().food(UFoodComponents.CHOCOLATE_OATMEAL_COOKIE)), ItemGroups.FOOD_AND_DRINK); + Item PINECONE_COOKIE = register("pinecone_cookie", new Item(new Item.Settings().food(FoodComponents.COOKIE)), ItemGroups.FOOD_AND_DRINK); + Item BOWL_OF_NUTS = register("bowl_of_nuts", new StewItem(new Item.Settings().food(UFoodComponents.NUT_BOWL).recipeRemainder(Items.BOWL)), ItemGroups.FOOD_AND_DRINK); + Item SCONE = register("scone", new MuffinItem(new Item.Settings().maxCount(32).food(UFoodComponents.SCONE), 0), ItemGroups.FOOD_AND_DRINK); + Item DAFFODIL_DAISY_SANDWICH = register("daffodil_daisy_sandwich", new Item(new Item.Settings().food(UFoodComponents.DAFODIL_DAISY_SANDWICH)), ItemGroups.FOOD_AND_DRINK); - Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().maxCount(1).food(UFoodComponents.HAY_BURGER)), ItemGroups.FOOD_AND_DRINK); + Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().maxCount(1).food(UFoodComponents.BURGER)), ItemGroups.FOOD_AND_DRINK); Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.HAY_FRIES)), ItemGroups.FOOD_AND_DRINK); Item CRISPY_HAY_FRIES = register("crispy_hay_fries", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.CRISPY_HAY_FRIES)), ItemGroups.FOOD_AND_DRINK); /** @@ -84,9 +93,10 @@ public interface UItems { Item HORSE_SHOE_FRIES = register("horse_shoe_fries", new Item(new Item.Settings().maxCount(32).food(UFoodComponents.HAY_FRIES)), ItemGroups.FOOD_AND_DRINK); Item WHEAT_WORMS = register("wheat_worms", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.WORMS)), ItemGroups.NATURAL); + Item BAITED_FISHING_ROD = register("baited_fishing_rod", new BaitedFishingRodItem(new Item.Settings().maxDamage(64)), ItemGroups.TOOLS); Item MUFFIN = register("muffin", new MuffinItem(new Item.Settings().maxCount(32).food(FoodComponents.BREAD), 0), ItemGroups.FOOD_AND_DRINK); - Item PINECONE = register("pinecone", new Item(new Item.Settings().food(UFoodComponents.PINECONE).maxCount(3)), ItemGroups.FOOD_AND_DRINK); - Item ACORN = register("acorn", new Item(new Item.Settings().food(UFoodComponents.ACORN).maxCount(16)), ItemGroups.FOOD_AND_DRINK); + Item PINECONE = register("pinecone", new ForageableItem(new Item.Settings().food(UFoodComponents.PINECONE).maxCount(16), () -> Blocks.SPRUCE_LEAVES), ItemGroups.FOOD_AND_DRINK); + Item ACORN = register("acorn", new ForageableItem(new Item.Settings().food(UFoodComponents.ACORN).maxCount(16), () -> Blocks.OAK_LEAVES), ItemGroups.FOOD_AND_DRINK); Item MANGO = register("mango", new Item(new Item.Settings().food(UFoodComponents.MANGO)), ItemGroups.FOOD_AND_DRINK); Item BANANA = register("banana", new Item(new Item.Settings().food(UFoodComponents.BANANA)), ItemGroups.FOOD_AND_DRINK); Item CURING_JOKE = register("curing_joke", new CuringJokeItem(UBlocks.CURING_JOKE, new Item.Settings().food(UFoodComponents.POISON_JOKE)), ItemGroups.NATURAL); @@ -101,7 +111,7 @@ public interface UItems { Item TOM = register("tom", new BluntWeaponItem(new Item.Settings(), ImmutableMultimap.of( EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, new EntityAttributeModifier(BluntWeaponItem.KNOCKBACK_MODIFIER_ID, "Weapon modifier", 0.9, EntityAttributeModifier.Operation.ADDITION) )), ItemGroups.NATURAL); - Item ROCK_STEW = register("rock_stew", new Item(new Item.Settings().food(FoodComponents.MUSHROOM_STEW)), ItemGroups.FOOD_AND_DRINK); + Item ROCK_STEW = register("rock_stew", new StewItem(new Item.Settings().food(FoodComponents.MUSHROOM_STEW).recipeRemainder(Items.BOWL)), ItemGroups.FOOD_AND_DRINK); Item ROCK_CANDY = register("rock_candy", new Item(new Item.Settings().food(UFoodComponents.CANDY).maxCount(16)), ItemGroups.FOOD_AND_DRINK); Item SALT_CUBE = register("salt_cube", new Item(new Item.Settings().food(UFoodComponents.SALT_CUBE)), ItemGroups.FOOD_AND_DRINK); @@ -110,18 +120,18 @@ public interface UItems { Item SOUR_APPLE_SEEDS = register("sour_apple_seeds", new AliasedBlockItem(UBlocks.SOUR_APPLE_SPROUT, new Item.Settings()), ItemGroups.NATURAL); Item GOLDEN_OAK_SEEDS = register("golden_oak_seeds", new AliasedBlockItem(UBlocks.GOLDEN_OAK_SPROUT, new Item.Settings()), ItemGroups.NATURAL); - Item MUG = register("mug", new Item(new Settings().maxCount(16)), ItemGroups.TOOLS); - Item CIDER = register("cider", new DrinkableItem(new Item.Settings().food(UFoodComponents.CIDER).maxCount(1).recipeRemainder(MUG)), ItemGroups.FOOD_AND_DRINK); - Item JUICE = register("juice", new DrinkableItem(new Item.Settings().recipeRemainder(Items.GLASS_BOTTLE).maxCount(1).food(UFoodComponents.JUICE)), ItemGroups.FOOD_AND_DRINK); - Item BURNED_JUICE = register("burned_juice", new DrinkableItem(new Item.Settings().recipeRemainder(Items.GLASS_BOTTLE).maxCount(1).food(UFoodComponents.BURNED_JUICE)), ItemGroups.FOOD_AND_DRINK); + Item MUG = register("mug", new Item(new Settings()), ItemGroups.TOOLS); + Item CIDER = register("cider", new ConsumableItem(new Item.Settings().food(UFoodComponents.CIDER).maxCount(16).recipeRemainder(MUG), UseAction.DRINK), ItemGroups.FOOD_AND_DRINK); + Item JUICE = register("juice", new ConsumableItem(new Item.Settings().recipeRemainder(Items.GLASS_BOTTLE).maxCount(16).food(UFoodComponents.JUICE), UseAction.DRINK), ItemGroups.FOOD_AND_DRINK); + Item BURNED_JUICE = register("burned_juice", new ConsumableItem(new Item.Settings().recipeRemainder(Items.GLASS_BOTTLE).maxCount(16).food(UFoodComponents.BURNED_JUICE), UseAction.DRINK), ItemGroups.FOOD_AND_DRINK); Item APPLE_PIE = register("apple_pie", new BlockItem(UBlocks.APPLE_PIE, new Item.Settings().maxCount(1)), ItemGroups.FOOD_AND_DRINK); Item APPLE_PIE_HOOF = register("apple_pie_hoof", new AliasedBlockItem(UBlocks.APPLE_PIE, new Item.Settings().maxCount(1)), ItemGroups.FOOD_AND_DRINK); Item APPLE_PIE_SLICE = register("apple_pie_slice", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.PIE)), ItemGroups.FOOD_AND_DRINK); Item CANDIED_APPLE = register("candied_apple", new StagedFoodItem(new Item.Settings().food(UFoodComponents.CANDY).maxDamage(3), () -> Items.STICK), ItemGroups.FOOD_AND_DRINK); - Item LOVE_BOTTLE = register("love_bottle", new DrinkableItem(new Item.Settings().food(UFoodComponents.LOVE_BOTTLE).maxCount(1).recipeRemainder(Items.GLASS_BOTTLE)), ItemGroups.FOOD_AND_DRINK); - Item LOVE_BUCKET = register("love_bucket", new DrinkableItem(new Item.Settings().food(UFoodComponents.LOVE_BUCKET).recipeRemainder(Items.BUCKET)), ItemGroups.FOOD_AND_DRINK); - Item LOVE_MUG = register("love_mug", new DrinkableItem(new Item.Settings().food(UFoodComponents.LOVE_MUG).recipeRemainder(MUG)), ItemGroups.FOOD_AND_DRINK); + Item LOVE_BOTTLE = register("love_bottle", new ConsumableItem(new Item.Settings().food(UFoodComponents.LOVE_BOTTLE).maxCount(1).recipeRemainder(Items.GLASS_BOTTLE), UseAction.DRINK), ItemGroups.FOOD_AND_DRINK); + Item LOVE_BUCKET = register("love_bucket", new ConsumableItem(new Item.Settings().food(UFoodComponents.LOVE_BUCKET).recipeRemainder(Items.BUCKET), UseAction.DRINK), ItemGroups.FOOD_AND_DRINK); + Item LOVE_MUG = register("love_mug", new ConsumableItem(new Item.Settings().food(UFoodComponents.LOVE_MUG).recipeRemainder(MUG), UseAction.DRINK), ItemGroups.FOOD_AND_DRINK); Item GOLDEN_FEATHER = register("golden_feather", new Item(new Item.Settings().rarity(Rarity.UNCOMMON)), ItemGroups.NATURAL); Item GOLDEN_WING = register("golden_wing", new Item(new Item.Settings().rarity(Rarity.UNCOMMON)), ItemGroups.NATURAL); @@ -166,6 +176,7 @@ public interface UItems { Item GIANT_BALLOON = register("giant_balloon", new HotAirBalloonItem(new Item.Settings().maxCount(1)), ItemGroups.TOOLS); Item SPECTRAL_CLOCK = register("spectral_clock", new Item(new Item.Settings()), ItemGroups.TOOLS); + Item WHITE_BED_SHEETS = register(CloudBedBlock.SheetPattern.WHITE); Item LIGHT_GRAY_BED_SHEETS = register(CloudBedBlock.SheetPattern.LIGHT_GRAY); Item GRAY_BED_SHEETS = register(CloudBedBlock.SheetPattern.GRAY); Item BLACK_BED_SHEETS = register(CloudBedBlock.SheetPattern.BLACK); @@ -217,6 +228,16 @@ public interface UItems { Item TURRET_SHELL = register("turret_shell", new Item(new Item.Settings()), ItemGroups.INGREDIENTS); Item SHELLY = register("shelly", new Item(new Item.Settings()), ItemGroups.INGREDIENTS); + Item ROTTEN_COD = register("rotten_cod", new Item(new Item.Settings().food(FoodComponents.ROTTEN_FLESH)), ItemGroups.FOOD_AND_DRINK); + Item ROTTEN_SALMON = register("rotten_salmon", new Item(new Item.Settings().food(FoodComponents.ROTTEN_FLESH)), ItemGroups.FOOD_AND_DRINK); + Item ROTTEN_TROPICAL_FISH = register("rotten_tropical_fish", new Item(new Item.Settings().food(FoodComponents.ROTTEN_FLESH)), ItemGroups.FOOD_AND_DRINK); + Item ROTTEN_PUFFERFISH = register("rotten_pufferfish", new Item(new Item.Settings().food(FoodComponents.ROTTEN_FLESH)), ItemGroups.FOOD_AND_DRINK); + + Item COOKED_TROPICAL_FISH = register("cooked_tropical_fish", new Item(new Item.Settings().food(FoodComponents.COOKED_COD)), ItemGroups.FOOD_AND_DRINK); + Item COOKED_PUFFERFISH = register("cooked_pufferfish", new Item(new Item.Settings().food(FoodComponents.COOKED_COD)), ItemGroups.FOOD_AND_DRINK); + Item FRIED_AXOLOTL = register("fried_axolotl", new ConsumableItem(new Item.Settings().food(FoodComponents.COOKED_CHICKEN).recipeRemainder(Items.BUCKET), UseAction.EAT), ItemGroups.FOOD_AND_DRINK); + Item GREEN_FRIED_EGG = register("green_fried_egg", new Item(new Item.Settings().food(UFoodComponents.FRIED_EGG)), ItemGroups.FOOD_AND_DRINK); + Item CARAPACE = register("carapace", new Item(new Item.Settings()), ItemGroups.INGREDIENTS); Item CLOTH_BED = register("cloth_bed", new FancyBedItem(UBlocks.CLOTH_BED, new Item.Settings().maxCount(1)), ItemGroups.FUNCTIONAL); Item CLOUD_BED = register("cloud_bed", new CloudBedItem(UBlocks.CLOUD_BED, new Item.Settings().maxCount(1)), ItemGroups.FUNCTIONAL); @@ -263,7 +284,7 @@ public interface UItems { FuelRegistry.INSTANCE.add(SPELLBOOK, 9000); FuelRegistry.INSTANCE.add(MEADOWBROOKS_STAFF, 800); FuelRegistry.INSTANCE.add(BURNED_TOAST, 1600); - FuelRegistry.INSTANCE.add(UTags.BASKETS, 1700); + FuelRegistry.INSTANCE.add(UTags.Items.BASKETS, 1700); CompostingChanceRegistry.INSTANCE.add(GREEN_APPLE, 0.65F); CompostingChanceRegistry.INSTANCE.add(SWEET_APPLE, 0.65F); diff --git a/src/main/java/com/minelittlepony/unicopia/item/WeatherJarItem.java b/src/main/java/com/minelittlepony/unicopia/item/WeatherJarItem.java new file mode 100644 index 00000000..2708e6cf --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/WeatherJarItem.java @@ -0,0 +1,136 @@ +package com.minelittlepony.unicopia.item; + +import com.minelittlepony.unicopia.AwaitTickQueue; +import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.particle.LightningBoltParticleEffect; +import com.minelittlepony.unicopia.particle.ParticleUtils; +import com.minelittlepony.unicopia.particle.UParticles; +import com.minelittlepony.unicopia.projectile.MagicProjectileEntity; +import com.minelittlepony.unicopia.projectile.Projectile; +import com.minelittlepony.unicopia.projectile.ProjectileDelegate; + +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LightningEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.AliasedBlockItem; +import net.minecraft.item.ItemStack; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkSectionPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.Heightmap; +import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; + +public class WeatherJarItem extends AliasedBlockItem implements Projectile, ProjectileDelegate.HitListener { + private final Type type; + + public WeatherJarItem(Block block, Settings settings, Type type) { + super(block, settings); + this.type = type; + Projectile.makeDispensable(this); + } + + @Override + public SoundEvent getThrowSound(ItemStack stack) { + return USounds.ENTITY_JAR_THROW; + } + + @Override + public float getProjectileDamage(ItemStack stack) { + return 0.5F; + } + + @Override + public TypedActionResult use(World world, PlayerEntity player, Hand hand) { + if (player.shouldCancelInteraction()) { + return super.use(world, player, hand); + } + return triggerThrow(world, player, hand); + } + + @Override + public void onImpact(MagicProjectileEntity projectile) { + releaseContents(projectile.getWorld(), projectile.getBlockPos()); + } + + public void releaseContents(World world, BlockPos pos) { + if (!world.isClient()) { + ServerWorld sw = (ServerWorld)world; + + if (type == Type.RAIN || type == Type.THUNDER) { + // clear weather time = number of ticks for which the weather is clear + // rain time = ticks until rain gets toggled (reset the tick after toggling) + // thunder time = ticks until thundering gets toggled (reset the tick after toggling) + + // clear weather time + // Number of ticks weather must stay clear. + // Raining and thundering, and raining/thundering times are kept to false and 0 + // when clear weather time is <= 0 + // - wait for thunder time to reach zero then toggle thundering + // - wait for rain time to reach zero then toggle raining + // when thunder time is <= 0 + // - randomly pick a new value for thunder time + // when rain time is <= 0 + // - randomly pick a new value for rain time + + sw.setWeather(0, 0, type == Type.RAIN, type == Type.THUNDER); + + if (type == Type.THUNDER) { + for (int i = world.random.nextInt(7); i > 0; i--) { + AwaitTickQueue.scheduleTask(world, w -> { + LightningEntity bolt = EntityType.LIGHTNING_BOLT.create(world); + bolt.setCosmetic(true); + bolt.refreshPositionAfterTeleport(Vec3d.ofBottomCenter(world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, world.getRandomPosInChunk( + ChunkSectionPos.getBlockCoord(ChunkSectionPos.getSectionCoord(pos.getX())), + 0, + ChunkSectionPos.getBlockCoord(ChunkSectionPos.getSectionCoord(pos.getZ())), + 15 + )).up(32))); + world.spawnEntity(bolt); + }, 15 + world.random.nextInt(12)); + } + } + } + + if (type == Type.LIGHTNING) { + LightningEntity lightning = EntityType.LIGHTNING_BOLT.create(world); + lightning.refreshPositionAfterTeleport(pos.getX(), pos.getY(), pos.getZ()); + + world.spawnEntity(lightning); + } + } + + Vec3d centerPos = pos.toCenterPos(); + + if (type == Type.LIGHTNING) { + ParticleUtils.spawnParticle(world, LightningBoltParticleEffect.DEFAULT, centerPos, Vec3d.ZERO); + } + + if (type == Type.RAIN || type == Type.THUNDER) { + world.syncWorldEvent(WorldEvents.SPLASH_POTION_SPLASHED, pos, type == Type.THUNDER ? 0x888888 : 0xF8F8F8); + + for (int i = world.random.nextInt(3) + 1; i >= 0; i--) { + ParticleUtils.spawnParticle(world, UParticles.CLOUDS_ESCAPING, + centerPos.getX(), centerPos.getY(), centerPos.getZ(), + world.random.nextFloat() - 0.5, + 0, + world.random.nextFloat() - 0.5 + ); + } + } + + world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(Blocks.GLASS.getDefaultState())); + } + + public enum Type { + RAIN, + THUNDER, + LIGHTNING + } +} \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java b/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java index 63cfb026..f8fe1ee3 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java @@ -103,7 +103,7 @@ public class ZapAppleItem extends Item implements ChameleonItem, MultiItem { public List getDefaultStacks() { return Unicopia.SIDE.getPony().map(Pony::asWorld) .stream() - .flatMap(world -> RegistryUtils.valuesForTag(world, UConventionalTags.APPLES)) + .flatMap(world -> RegistryUtils.valuesForTag(world, UConventionalTags.Items.APPLES)) .filter(a -> a != this).map(item -> { ItemStack stack = new ItemStack(this); stack.getOrCreateNbt().putString("appearance", Registries.ITEM.getId(item).toString()); diff --git a/src/main/java/com/minelittlepony/unicopia/item/cloud/CloudBlockItem.java b/src/main/java/com/minelittlepony/unicopia/item/cloud/CloudBlockItem.java index f208e723..d4b34d81 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/cloud/CloudBlockItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/cloud/CloudBlockItem.java @@ -19,8 +19,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -public class CloudBlockItem -extends BlockItem { +public class CloudBlockItem extends BlockItem { public CloudBlockItem(Block block, Item.Settings settings) { super(block, settings); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java b/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java index 0010a097..d07383cc 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java +++ b/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java @@ -21,7 +21,7 @@ public class GemFindingEnchantment extends SimpleEnchantment { BlockPos origin = user.getOrigin(); - double volume = BlockPos.findClosest(origin, radius, radius, pos -> user.asWorld().getBlockState(pos).isIn(UTags.INTERESTING)) + double volume = BlockPos.findClosest(origin, radius, radius, pos -> user.asWorld().getBlockState(pos).isIn(UTags.Blocks.INTERESTING)) .map(p -> user.getOriginVector().squaredDistanceTo(p.getX(), p.getY(), p.getZ())) .map(find -> (1 - (Math.sqrt(find) / radius))) .orElse(-1D); diff --git a/src/main/java/com/minelittlepony/unicopia/item/enchantment/UEnchantments.java b/src/main/java/com/minelittlepony/unicopia/item/enchantment/UEnchantments.java index 2085f490..a5143773 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/enchantment/UEnchantments.java +++ b/src/main/java/com/minelittlepony/unicopia/item/enchantment/UEnchantments.java @@ -40,6 +40,15 @@ public interface UEnchantments { */ Enchantment PADDED = register("padded", new SimpleEnchantment(Options.armor().rarity(Rarity.UNCOMMON).maxLevel(3).traded().table())); + /** + * Allows non-flying races to mine and interact with cloud blocks + * + * Appears in: + * - Trades + * - Enchanting Table + */ + Enchantment FEATHER_TOUCH = register("feather_touch", new SimpleEnchantment(Options.create(EnchantmentTarget.BREAKABLE, UEnchantmentValidSlots.HANDS).rarity(Rarity.UNCOMMON).traded().table())); + /** * Heavy players move more slowly but are less likely to be flung around wildly. * diff --git a/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java b/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java index 3998f13b..c276d2c6 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java +++ b/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java @@ -4,7 +4,6 @@ import java.util.*; import java.util.function.Supplier; import java.util.stream.Stream; -import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.Unicopia; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; @@ -57,10 +56,9 @@ public interface ItemGroupRegistry { return key; } - static RegistryKey createGroupFromTag(String name, Supplier icon) { - TagKey key = UTags.item("groups/" + name); + static RegistryKey createGroupFromTag(String name, TagKey tag, Supplier icon) { return createDynamic(name, icon, () -> { - return Registries.ITEM.getEntryList(key) + return Registries.ITEM.getEntryList(tag) .stream() .flatMap(named -> named.stream()) .map(entry -> entry.value()); diff --git a/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java b/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java index a1f0efae..a479fa90 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java +++ b/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java @@ -2,6 +2,7 @@ package com.minelittlepony.unicopia.item.group; import java.util.stream.Stream; +import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.item.ChameleonItem; import com.minelittlepony.unicopia.item.UItems; import net.minecraft.item.*; @@ -12,13 +13,13 @@ public interface UItemGroups { return Stream.concat(Stream.of(Items.APPLE), ItemGroupRegistry.ITEMS.stream() .filter(item -> !(item instanceof ChameleonItem) || ((ChameleonItem)item).isFullyDisguised())); }); - RegistryKey FORAGING_ITEMS = ItemGroupRegistry.createGroupFromTag("foraging", Items.HAY_BLOCK::getDefaultStack); - RegistryKey EARTH_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("earth_pony", UItems.EARTH_BADGE::getDefaultStack); - RegistryKey UNICORN_ITEMS = ItemGroupRegistry.createGroupFromTag("unicorn", UItems.UNICORN_BADGE::getDefaultStack); - RegistryKey PEGASUS_ITEMS = ItemGroupRegistry.createGroupFromTag("pegasus", UItems.PEGASUS_BADGE::getDefaultStack); - RegistryKey BAT_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("bat_pony", UItems.BAT_BADGE::getDefaultStack); - RegistryKey SEA_PON_ITEMS = ItemGroupRegistry.createGroupFromTag("sea_pony", UItems.PEARL_NECKLACE::getDefaultStack); - RegistryKey CHANGELING_ITEMS = ItemGroupRegistry.createGroupFromTag("changeling", UItems.CHANGELING_BADGE::getDefaultStack); + RegistryKey FORAGING_ITEMS = ItemGroupRegistry.createGroupFromTag("foraging", UTags.Items.GROUP_FORAGING, Items.HAY_BLOCK::getDefaultStack); + RegistryKey EARTH_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("earth_pony", UTags.Items.GROUP_EARTH_PONY, UItems.EARTH_BADGE::getDefaultStack); + RegistryKey UNICORN_ITEMS = ItemGroupRegistry.createGroupFromTag("unicorn", UTags.Items.GROUP_UNICORN, UItems.UNICORN_BADGE::getDefaultStack); + RegistryKey PEGASUS_ITEMS = ItemGroupRegistry.createGroupFromTag("pegasus", UTags.Items.GROUP_PEGASUS, UItems.PEGASUS_BADGE::getDefaultStack); + RegistryKey BAT_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("bat_pony", UTags.Items.GROUP_BAT_PONY, UItems.BAT_BADGE::getDefaultStack); + RegistryKey SEA_PON_ITEMS = ItemGroupRegistry.createGroupFromTag("sea_pony", UTags.Items.GROUP_SEA_PONY, UItems.PEARL_NECKLACE::getDefaultStack); + RegistryKey CHANGELING_ITEMS = ItemGroupRegistry.createGroupFromTag("changeling", UTags.Items.GROUP_CHANGELING, UItems.CHANGELING_BADGE::getDefaultStack); static void bootstrap() { ItemGroupRegistry.bootstrap(); diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java index 6a9c29d3..13644fbb 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java @@ -21,11 +21,13 @@ import com.minelittlepony.unicopia.entity.duck.EntityDuck; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.ItemEntity; +import net.minecraft.entity.MovementType; import net.minecraft.entity.Entity.PositionUpdater; import net.minecraft.entity.Entity.RemovalReason; import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; @Mixin(Entity.class) @@ -118,4 +120,20 @@ abstract class MixinEntity implements EntityDuck { info.setReturnValue(null); } } + + @Inject(method = "move", at = @At("HEAD")) + private void beforeMove(MovementType movementType, Vec3d movement, CallbackInfo info) { + Living living = Living.living((Entity)(Object)this); + if (living != null) { + living.getTransportation().updatePreviousPosition(); + } + } + + @Inject(method = "move", at = @At("RETURN")) + private void afterMove(MovementType movementType, Vec3d movement, CallbackInfo info) { + Living living = Living.living((Entity)(Object)this); + if (living != null) { + living.getTransportation().onMove(movementType); + } + } } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityBucketItem.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityBucketItem.java new file mode 100644 index 00000000..978c2636 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityBucketItem.java @@ -0,0 +1,16 @@ +package com.minelittlepony.unicopia.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import net.minecraft.entity.EntityType; +import net.minecraft.item.EntityBucketItem; +import net.minecraft.sound.SoundEvent; + +@Mixin(EntityBucketItem.class) +public interface MixinEntityBucketItem { + @Accessor + EntityType getEntityType(); + @Accessor + SoundEvent getEmptyingSound(); +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityShapeContext.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityShapeContext.java index 9e375403..b0930e75 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityShapeContext.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityShapeContext.java @@ -9,15 +9,13 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.minelittlepony.unicopia.EquineContext; -import com.minelittlepony.unicopia.Race; - import net.minecraft.block.EntityShapeContext; import net.minecraft.entity.Entity; import net.minecraft.fluid.FluidState; import net.minecraft.item.ItemStack; @Mixin(EntityShapeContext.class) -abstract class MixinEntityShapeContext implements EquineContext { +abstract class MixinEntityShapeContext implements EquineContext.Container { private EquineContext equineContext; @Inject(method = "", at = @At("TAIL")) @@ -26,22 +24,7 @@ abstract class MixinEntityShapeContext implements EquineContext { } @Override - public Race getSpecies() { - return equineContext.getSpecies(); - } - - @Override - public Race.Composite getCompositeRace() { - return equineContext.getCompositeRace(); - } - - @Override - public float getCloudWalkingStrength() { - return equineContext.getCloudWalkingStrength(); - } - - @Override - public boolean collidesWithClouds() { - return equineContext.collidesWithClouds(); + public EquineContext get() { + return equineContext; } } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinLivingEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinLivingEntity.java index f71ef863..7d41f099 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinLivingEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinLivingEntity.java @@ -5,9 +5,7 @@ import java.util.Optional; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Constant; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyConstant; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -130,11 +128,6 @@ abstract class MixinLivingEntity extends Entity implements LivingEntityDuck, Equ get().adjustMovementSpeedInWater(info.getReturnValue()).ifPresent(info::setReturnValue); } - @Inject(method = "jump()V", at = @At("RETURN")) - private void onJump(CallbackInfo info) { - get().onJump(); - } - @Inject(method = "tick()V", at = @At("HEAD"), cancellable = true) private void beforeTick(CallbackInfo info) { if (get().beforeUpdate()) { @@ -178,14 +171,6 @@ abstract class MixinLivingEntity extends Entity implements LivingEntityDuck, Equ } } - @ModifyConstant(method = "travel(Lnet/minecraft/util/math/Vec3d;)V", constant = { - @Constant(doubleValue = 0.08D), - @Constant(doubleValue = 0.01D) - }) - private double modifyGravity(double initial) { - return get().getPhysics().calcGravity(initial); - } - @Override public void updateItemUsage(Hand hand, ItemStack stack, int time) { activeItemStack = stack; @@ -196,21 +181,4 @@ abstract class MixinLivingEntity extends Entity implements LivingEntityDuck, Equ setLivingFlag(2, hand == Hand.OFF_HAND); } } - - @Override - public BlockPos getBlockPos() { - if (get().getPhysics().isGravityNegative()) { - return get().getPhysics().getHeadPosition(); - } - return super.getBlockPos(); - } - - @Override - protected void spawnSprintingParticles() { - if (get().getPhysics().isGravityNegative()) { - get().getPhysics().spawnSprintingParticles(); - } else { - super.spawnSprintingParticles(); - } - } } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java index d836f0fc..d9200a75 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java @@ -9,7 +9,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.minelittlepony.unicopia.entity.*; -import com.minelittlepony.unicopia.entity.duck.RotatedView; import com.minelittlepony.unicopia.item.enchantment.WantItNeedItEnchantment; import net.minecraft.entity.EntityType; @@ -33,18 +32,6 @@ abstract class MixinMobEntity extends LivingEntity implements Equine.Container info) { diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java index d61ad769..b67432fc 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java @@ -97,14 +97,6 @@ abstract class MixinPlayerEntity extends LivingEntity implements Equine.Containe get().getMotion().getDimensions().calculateActiveEyeHeight(dimensions).ifPresent(info::setReturnValue); } - /* - @Inject(method = "getDimensions(Lnet/minecraft/entity/EntityPose;)Lnet/minecraft/entity/EntityDimensions;", - at = @At("RETURN"), - cancellable = true) - private void onGetDimensions(EntityPose pose, CallbackInfoReturnable info) { - get().getMotion().getDimensions().calculateDimensions().ifPresent(info::setReturnValue); - }*/ - @Redirect(method = "getDimensions(Lnet/minecraft/entity/EntityPose;)Lnet/minecraft/entity/EntityDimensions;", at = @At( value = "INVOKE", diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinWorld.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinWorld.java index 04db071b..99ca9150 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinWorld.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinWorld.java @@ -1,19 +1,13 @@ package com.minelittlepony.unicopia.mixin; -import java.util.Stack; import java.util.function.Supplier; 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.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - import com.minelittlepony.unicopia.entity.duck.RotatedView; import com.minelittlepony.unicopia.server.world.BlockDestructionManager; -import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; -import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.WorldAccess; @@ -22,20 +16,8 @@ abstract class MixinWorld implements WorldAccess, BlockDestructionManager.Source private final Supplier destructions = BlockDestructionManager.create((World)(Object)this); - private int recurseCount = 0; - private final Stack rotations = new Stack<>(); private boolean mirrorEntityStatuses; - @Override - public Stack getRotations() { - return rotations; - } - - @Override - public boolean hasTransform() { - return recurseCount <= 0; - } - @Override public void setMirrorEntityStatuses(boolean enable) { mirrorEntityStatuses = enable; @@ -52,17 +34,5 @@ abstract class MixinWorld implements WorldAccess, BlockDestructionManager.Source entity.handleStatus(status); } } - - @ModifyVariable(method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z", at = @At("HEAD")) - private BlockPos modifyBlockPos(BlockPos pos) { - pos = applyRotation(pos); - recurseCount = Math.max(0, recurseCount) + 1; - return pos; - } - - @Inject(method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z", at = @At("RETURN")) - public void onSetBlockState(BlockPos pos, BlockState state, int flags, int maxUpdateDepth, CallbackInfoReturnable info) { - recurseCount = Math.max(0, recurseCount - 1); - } } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinGameRenderer.java b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinGameRenderer.java index d71373fb..2fe4abe2 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinGameRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinGameRenderer.java @@ -36,7 +36,7 @@ abstract class MixinGameRenderer implements AutoCloseable, SynchronousResourceRe @Inject(method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V", at = @At("HEAD")) private void beforeRenderWorld(float tickDelta, long limitTime, MatrixStack matrices, CallbackInfo info) { - UnicopiaClient.getCamera().ifPresent(c -> matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(c.calculateRoll()))); + UnicopiaClient.getCamera().ifPresent(c -> matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(c.calculateFirstPersonRoll()))); BatEyesApplicator.INSTANCE.enable(); } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java index 7bc83f17..6b4240d3 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java @@ -27,12 +27,6 @@ abstract class MixinKeyboardInput extends Input { pressingRight = tmp; movementSideways = -movementSideways; - - if (player.asEntity().getAbilities().flying && !player.getPhysics().isFlying()) { - tmp = jumping; - jumping = sneaking; - sneaking = tmp; - } } if (EffectUtils.getAmplifier(MinecraftClient.getInstance().player, UEffects.PARALYSIS) > 1) { diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinBrain.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinBrain.java similarity index 87% rename from src/main/java/com/minelittlepony/unicopia/mixin/MixinBrain.java rename to src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinBrain.java index 7a7a7737..4e794c6a 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinBrain.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinBrain.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.mixin; +package com.minelittlepony.unicopia.mixin.gravity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -21,7 +21,7 @@ abstract class MixinBrain { Equine eq = Equine.of(entity).orElse(null); if (eq instanceof Living && eq.getPhysics().isGravityNegative()) { - ((RotatedView)world).pushRotation((int)entity.getY()); + ((RotatedView)world).pushRotation((int)(entity.getY() + entity.getHeight() * 0.5F)); } } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinClientWorld.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinClientWorld.java new file mode 100644 index 00000000..98701eec --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinClientWorld.java @@ -0,0 +1,30 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +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.minelittlepony.unicopia.entity.Equine; +import com.minelittlepony.unicopia.entity.duck.RotatedView; + +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.Entity; + +@Mixin(ClientWorld.class) +abstract class MixinClientWorld implements RotatedView { + + @Inject(method = "tickEntity", at = @At("HEAD")) + private void beforeTickEntity(Entity entity, CallbackInfo info) { + if (entity instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + // pushRotation((int)(entity.getY() + entity.getHeight() * 0.5F)); + } + } + + @Inject(method = "tickEntity", at = @At("RETURN")) + private void afterTickEntity(Entity entity, CallbackInfo info) { + if (entity instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + // popRotation(); + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinEntity.java new file mode 100644 index 00000000..2e05cb81 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinEntity.java @@ -0,0 +1,107 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.At.Shift; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.minelittlepony.unicopia.entity.Equine; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.MovementType; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Vec3d; + +@Mixin(value = Entity.class, priority = 29000) +abstract class MixinEntity { + + // we invert y when moving + @ModifyVariable(method = "move", at = @At("HEAD"), argsOnly = true) + private Vec3d modifyMovement(Vec3d movement) { + if (unicopiaIsGravityInverted()) { + return movement.multiply(1, -1, 1); + } + return movement; + } + + // fix on ground check + @Inject(method = "move", at = @At(value = "FIELD", target = "net/minecraft/entity/Entity.groundCollision:Z", shift = Shift.AFTER, ordinal = 0)) + private void onUpdateOnGroundFlag(MovementType movementType, Vec3d movement, CallbackInfo info) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + eq.get().asEntity().groundCollision = eq.get().asEntity().verticalCollision && movement.y > 0.0; + } + } + + // invert offsets so it can properly find the block we're walking on + @ModifyVariable(method = "getPosWithYOffset", at = @At("HEAD"), argsOnly = true) + private float onGetPosWithYOffset(float offset) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + return -(eq.get().asEntity().getHeight() + offset); + } + return offset; + } + + // fix sprinting particles + @ModifyArg(method = "spawnSprintingParticles", + at = @At(value = "INVOKE", + target = "net/minecraft/world/World.addParticle(Lnet/minecraft/particle/ParticleEffect;DDDDDD)V"), + index = 2) + private double modifyParticleY(double y) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + Entity self = eq.get().asEntity(); + return self.getHeight() - y + (self.getY() * 2); + } + return y; + } + + // fix fall damage + @ModifyArg( + method = "move", + at = @At(value = "INVOKE", target = "net/minecraft/entity/Entity.fall(DZLnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)V")) + private double modifyFallDistance(double heightDifference) { + if (unicopiaIsGravityInverted()) { + return -heightDifference; + } + return heightDifference; + } + + // invert check for walking up a step + @ModifyVariable( + method = "adjustMovementForCollisions(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Box;Lnet/minecraft/world/World;Ljava/util/List;)Lnet/minecraft/util/math/Vec3d;", + at = @At("HEAD"), + argsOnly = true) + + private static Vec3d modifyMovementForStepheight(Vec3d movement, @Nullable Entity entity) { + if (entity instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative() && movement.getY() == entity.getStepHeight()) { + return movement.multiply(1, -1, 1); + } + return movement; + } + + @Inject(method = {"calculateBoundingBox"}, at = @At("RETURN"), cancellable = true) + private void adjustPoseBoxForGravity(CallbackInfoReturnable info) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + Entity self = eq.get().asEntity(); + Box box = info.getReturnValue(); + Box oldBox = self.getBoundingBox(); + double newHeight = box.getLengthY(); + if (newHeight > oldBox.getLengthY()) { + double targetMaxY = oldBox.maxY; + Vec3d min = new Vec3d(box.minX, targetMaxY - newHeight, box.minZ); + Vec3d max = new Vec3d(box.maxX, targetMaxY, box.maxZ); + box = new Box(min, max); + info.setReturnValue(box); + self.setPos(self.getX(), box.minY, self.getZ()); + } + } + } + + private boolean unicopiaIsGravityInverted() { + return this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative(); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinLivingEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinLivingEntity.java new file mode 100644 index 00000000..368eb0d8 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinLivingEntity.java @@ -0,0 +1,45 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.ModifyConstant; +import com.minelittlepony.unicopia.entity.*; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.util.math.BlockPos; + +@Mixin(LivingEntity.class) +abstract class MixinLivingEntity extends Entity implements Equine.Container> { + + private MixinLivingEntity() { super(null, null); } + + @ModifyConstant(method = "travel(Lnet/minecraft/util/math/Vec3d;)V", constant = { + @Constant(doubleValue = 0.08D), + @Constant(doubleValue = 0.01D) + }) + private double modifyGravity(double initial) { + return Math.abs(get().getPhysics().calcGravity(initial)); + } + + @ModifyArg(method = "fall", + at = @At(value = "INVOKE", + target = "net/minecraft/server/world/ServerWorld.spawnParticles(Lnet/minecraft/particle/ParticleEffect;DDDIDDDD)I"), + index = 2) + private double modifyParticleY(double y) { + if (get().getPhysics().isGravityNegative()) { + return y + getHeight(); + } + return y; + } + + @Override + public BlockPos getBlockPos() { + if (get().getPhysics().isGravityNegative()) { + return get().getPhysics().getHeadPosition(); + } + return super.getBlockPos(); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinMobEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinMobEntity.java new file mode 100644 index 00000000..e72ec42a --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinMobEntity.java @@ -0,0 +1,28 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +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.minelittlepony.unicopia.entity.*; +import com.minelittlepony.unicopia.entity.duck.RotatedView; + +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.mob.MobEntity; + +@Mixin(MobEntity.class) +abstract class MixinMobEntity extends LivingEntity implements Equine.Container { + private MixinMobEntity() { super(null, null); } + + @Inject(method = "tickNewAi", at = @At("HEAD")) + public void beforeTickAi(CallbackInfo into) { + if (get().getPhysics().isGravityNegative()) { + ((RotatedView)getWorld()).pushRotation((int)(getY() + getHeight() * 0.5F)); + } + } + + @Inject(method = "tickNewAi", at = @At("RETURN")) + public void afterTickAi(CallbackInfo into) { + ((RotatedView)getWorld()).popRotation(); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinPistonBlockEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinPistonBlockEntity.java new file mode 100644 index 00000000..279047c7 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinPistonBlockEntity.java @@ -0,0 +1,46 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.block.entity.PistonBlockEntity; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; + +@Mixin(PistonBlockEntity.class) +abstract class MixinPistonBlockEntity { + @Shadow + private static Box offsetHeadBox(BlockPos pos, Box box, PistonBlockEntity blockEntity) { + return box; + } + + @Shadow + private static boolean canMoveEntity(Box box, Entity entity, BlockPos pos) { + return false; + } + + @Shadow + private static void moveEntity(Direction direction, Entity entity, double distance, Direction movementDirection) { + + } + + @Inject(method = "moveEntitiesInHoneyBlock", at = @At("TAIL")) + private static void moveEntitiesInHoneyBlock(World world, BlockPos pos, float ticks, PistonBlockEntity tile, CallbackInfo info) { + Direction direction = tile.getMovementDirection(); + if (!direction.getAxis().isHorizontal()) { + return; + } + double blockY = tile.getPushedBlock().getCollisionShape(world, pos).getMin(Direction.Axis.Y); + Box box = offsetHeadBox(pos, new Box(0, blockY - 1.5000010000000001F, 0, 1, blockY, 1), tile); + double distance = ticks - tile.getProgress(1); + for (Entity entity2 : world.getOtherEntities(null, box, entity -> canMoveEntity(box, entity, pos))) { + moveEntity(direction, entity2, distance, direction); + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinPlayerEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinPlayerEntity.java new file mode 100644 index 00000000..6a8e0110 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinPlayerEntity.java @@ -0,0 +1,63 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.minelittlepony.unicopia.entity.Equine; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.MovementType; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Vec3d; + +@Mixin(PlayerEntity.class) +abstract class MixinPlayerEntity { + @ModifyVariable(method = "adjustMovementForSneaking", at = @At("HEAD"), argsOnly = true) + private Vec3d flipMovementForSneaking(Vec3d movement) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + return movement.multiply(1, -1, 1); + } + return movement; + } + + @Inject(method = "adjustMovementForSneaking", at = @At("RETURN"), cancellable = true) + private void unflipMovementForSneaking(Vec3d movement, MovementType type, CallbackInfoReturnable info) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + info.setReturnValue(info.getReturnValue().multiply(1, -1, 1)); + } + } + + @ModifyArg(method = { "adjustMovementForSneaking", "method_30263" }, at = @At( + value = "INVOKE", + target = "net/minecraft/util/math/Box.offset(DDD)Lnet/minecraft/util/math/Box;"), + index = 1) + private double invertStepHeight(double stepHeight) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + return -stepHeight; + } + return stepHeight; + } + + @ModifyArg(method = "canChangeIntoPose", + at = @At(value = "INVOKE", + target = "net/minecraft/world/World.isSpaceEmpty(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Box;)Z")) + private Box unicopiaReAnchorBoundingBox(Box box) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + Entity self = eq.get().asEntity(); + Box oldBox = self.getBoundingBox(); + double newHeight = box.getLengthY(); + if (newHeight > oldBox.getLengthY()) { + double targetMaxY = oldBox.maxY; + Vec3d min = new Vec3d(box.minX, targetMaxY - newHeight, box.minZ); + Vec3d max = new Vec3d(box.maxX, targetMaxY, box.maxZ); + return new Box(min, max); + } + } + return box; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerPlayNetworkHandler.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerPlayNetworkHandler.java new file mode 100644 index 00000000..a5616aed --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerPlayNetworkHandler.java @@ -0,0 +1,26 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import com.minelittlepony.unicopia.entity.player.Pony; + +import net.minecraft.network.listener.ServerPlayPacketListener; +import net.minecraft.network.listener.TickablePacketListener; +import net.minecraft.server.network.PlayerAssociatedNetworkHandler; +import net.minecraft.server.network.ServerPlayNetworkHandler; +import net.minecraft.server.network.ServerPlayerEntity; + +@Mixin(ServerPlayNetworkHandler.class) +abstract class MixinServerPlayNetworkHandler implements ServerPlayPacketListener, PlayerAssociatedNetworkHandler, TickablePacketListener { + @Shadow public ServerPlayerEntity player; + + @ModifyVariable(method = "onPlayerMove", at = @At("STORE"), ordinal = 0) + private boolean flipLandingFlag(boolean value) { + if (Pony.of(this.player).getPhysics().isGravityNegative()) { + return !value; + } + return value; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerPlayerEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerPlayerEntity.java new file mode 100644 index 00000000..77783d4b --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerPlayerEntity.java @@ -0,0 +1,24 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +import com.minelittlepony.unicopia.entity.Equine; + +import net.minecraft.server.network.ServerPlayerEntity; + +@Mixin(ServerPlayerEntity.class) +abstract class MixinServerPlayerEntity { + @ModifyVariable( + method = "handleFall(DDDZ)V", + at = @At("HEAD"), + ordinal = 1, + argsOnly = true) + private double modifyFallDistance(double value) { + if (this instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + return -value; + } + return value; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerWorld.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerWorld.java new file mode 100644 index 00000000..d43d1570 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinServerWorld.java @@ -0,0 +1,29 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +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.minelittlepony.unicopia.entity.Equine; +import com.minelittlepony.unicopia.entity.duck.RotatedView; +import net.minecraft.entity.Entity; +import net.minecraft.server.world.ServerWorld; + +@Mixin(ServerWorld.class) +abstract class MixinServerWorld implements RotatedView { + + @Inject(method = "tickEntity", at = @At("HEAD")) + private void beforeTickEntity(Entity entity, CallbackInfo info) { + if (entity instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + // pushRotation((int)(entity.getY() + entity.getHeight() * 0.5F)); + } + } + + @Inject(method = "tickEntity", at = @At("RETURN")) + private void afterTickEntity(Entity entity, CallbackInfo info) { + if (entity instanceof Equine.Container eq && eq.get().getPhysics().isGravityNegative()) { + // popRotation(); + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinSoundSource.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinSoundSource.java new file mode 100644 index 00000000..7ffbad9f --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinSoundSource.java @@ -0,0 +1,17 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +import com.minelittlepony.unicopia.client.UnicopiaClient; +import net.minecraft.client.sound.Source; +import net.minecraft.util.math.Vec3d; + +@Mixin(Source.class) +abstract class MixinSoundSource { + @ModifyVariable(method = "setPosition", at = @At("HEAD"), argsOnly = true) + private Vec3d modifyPosition(Vec3d pos) { + return UnicopiaClient.getAdjustedSoundPosition(pos); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinWorld.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinWorld.java new file mode 100644 index 00000000..71428388 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinWorld.java @@ -0,0 +1,43 @@ +package com.minelittlepony.unicopia.mixin.gravity; + +import java.util.Stack; +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.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.minelittlepony.unicopia.entity.duck.RotatedView; +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldAccess; + +@Mixin(World.class) +abstract class MixinWorld implements WorldAccess, RotatedView { + + private int recurseCount = 0; + private final Stack rotations = new Stack<>(); + + @Override + public Stack getRotations() { + return rotations; + } + + @Override + public boolean hasTransform() { + return recurseCount <= 0; + } + + @ModifyVariable(method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z", at = @At("HEAD")) + private BlockPos modifyBlockPos(BlockPos pos) { + pos = applyRotation(pos); + recurseCount = Math.max(0, recurseCount) + 1; + return pos; + } + + @Inject(method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z", at = @At("RETURN")) + public void onSetBlockState(BlockPos pos, BlockState state, int flags, int maxUpdateDepth, CallbackInfoReturnable info) { + recurseCount = Math.max(0, recurseCount - 1); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinWorldChunk.java b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinWorldChunk.java similarity index 96% rename from src/main/java/com/minelittlepony/unicopia/mixin/MixinWorldChunk.java rename to src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinWorldChunk.java index 97f137d8..4a3c2ced 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinWorldChunk.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/gravity/MixinWorldChunk.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.mixin; +package com.minelittlepony.unicopia.mixin.gravity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/main/java/com/minelittlepony/unicopia/particle/FootprintParticleEffect.java b/src/main/java/com/minelittlepony/unicopia/particle/FootprintParticleEffect.java new file mode 100644 index 00000000..69ef2300 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/particle/FootprintParticleEffect.java @@ -0,0 +1,42 @@ +package com.minelittlepony.unicopia.particle; + +import java.util.Locale; + +import com.mojang.brigadier.StringReader; +import com.mojang.brigadier.exceptions.CommandSyntaxException; + +import net.minecraft.particle.ParticleEffect; +import net.minecraft.particle.ParticleType; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.registry.Registries; + +public record FootprintParticleEffect ( + float yaw + ) implements ParticleEffect { + @SuppressWarnings("deprecation") + public static final ParticleEffect.Factory FACTORY = ParticleFactoryHelper.of(FootprintParticleEffect::new, FootprintParticleEffect::new); + + protected FootprintParticleEffect(ParticleType type, StringReader reader) throws CommandSyntaxException { + this(ParticleFactoryHelper.readFloat(reader)); + } + + protected FootprintParticleEffect(ParticleType particleType, PacketByteBuf buf) { + this(buf.readFloat()); + } + + @Override + public ParticleType getType() { + return UParticles.FOOTPRINT; + } + + @Override + public void write(PacketByteBuf buf) { + buf.writeFloat(yaw); + } + + @Override + public String asString() { + return String.format(Locale.ROOT, "%s %.2f", Registries.PARTICLE_TYPE.getId(getType()), yaw); + } + +} diff --git a/src/main/java/com/minelittlepony/unicopia/particle/UParticles.java b/src/main/java/com/minelittlepony/unicopia/particle/UParticles.java index 9bec2e5c..da302010 100644 --- a/src/main/java/com/minelittlepony/unicopia/particle/UParticles.java +++ b/src/main/java/com/minelittlepony/unicopia/particle/UParticles.java @@ -14,14 +14,12 @@ public interface UParticles { ParticleType UNICORN_MAGIC = register("unicorn_magic", FabricParticleTypes.complex(MagicParticleEffect.FACTORY)); DefaultParticleType CHANGELING_MAGIC = register("changeling_magic", FabricParticleTypes.simple()); DefaultParticleType BUBBLE = register("bubble", FabricParticleTypes.simple()); + ParticleType FOOTPRINT = register("footprint", FabricParticleTypes.complex(FootprintParticleEffect.FACTORY)); ParticleType DUST_CLOUD = register("dust_cloud", FabricParticleTypes.complex(BlockStateParticleEffect.PARAMETERS_FACTORY)); ParticleType RAINBOOM_RING = register("rainboom_ring", FabricParticleTypes.complex(OrientedBillboardParticleEffect.FACTORY)); ParticleType RAINBOOM_TRAIL = register("rainboom_trail", FabricParticleTypes.complex(TargetBoundParticleEffect.FACTORY)); - @Deprecated - ParticleType MAGIC_RUNES = register("magic_runes", FabricParticleTypes.complex(OrientedBillboardParticleEffect.FACTORY)); - DefaultParticleType RAIN_DROPS = register("rain_drops", FabricParticleTypes.simple()); ParticleType SPHERE = register("sphere", FabricParticleTypes.complex(true, SphereParticleEffect.FACTORY)); diff --git a/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java index 61e33202..041d4d1d 100644 --- a/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java @@ -145,7 +145,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl return; } else { ItemStack stack = asItemStack(); - if (stack.isIn(UTags.HORSE_SHOES)) { + if (stack.isIn(UTags.Items.HORSE_SHOES)) { if (stack.damage(1 + random.nextInt(10), random, null)) { playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1); } else { @@ -205,7 +205,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl boolean ownerCanModify = !getWorld().isClient && Caster.of(getOwner()).filter(pony -> pony.canModifyAt(hit.getBlockPos())).isPresent(); if (ownerCanModify && getWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) { - if ((!isBouncy() || getWorld().random.nextInt(200) == 0) && state.isIn(UTags.FRAGILE)) { + if ((!isBouncy() || getWorld().random.nextInt(200) == 0) && state.isIn(UTags.Blocks.FRAGILE)) { getWorld().breakBlock(hit.getBlockPos(), true); } } @@ -246,7 +246,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl emitGameEvent(GameEvent.STEP); if (!isBouncy()) { - if (stack.isIn(UTags.HORSE_SHOES)) { + if (stack.isIn(UTags.Items.HORSE_SHOES)) { if (stack.damage(1 + random.nextInt(10), random, null)) { playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1); discard(); @@ -262,7 +262,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl @Override protected SoundEvent getHitSound() { - if (getStack().isIn(UTags.HORSE_SHOES)) { + if (getStack().isIn(UTags.Items.HORSE_SHOES)) { return USounds.Vanilla.ITEM_TRIDENT_HIT_GROUND; } return isBouncy() ? USounds.ITEM_MUFFIN_BOUNCE.value() : USounds.ITEM_ROCK_LAND; diff --git a/src/main/java/com/minelittlepony/unicopia/projectile/Projectile.java b/src/main/java/com/minelittlepony/unicopia/projectile/Projectile.java new file mode 100644 index 00000000..c8b0c2a2 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/projectile/Projectile.java @@ -0,0 +1,73 @@ +package com.minelittlepony.unicopia.projectile; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.util.SoundEmitter; + +import net.minecraft.block.DispenserBlock; +import net.minecraft.block.dispenser.ProjectileDispenserBehavior; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.projectile.ProjectileEntity; +import net.minecraft.item.ItemConvertible; +import net.minecraft.item.ItemStack; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvent; +import net.minecraft.stat.Stats; +import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; +import net.minecraft.util.math.Position; +import net.minecraft.world.World; + +public interface Projectile extends ItemConvertible { + static void makeDispensable(Projectile projectile) { + DispenserBlock.registerBehavior(projectile.asItem(), new ProjectileDispenserBehavior(){ + @Override + protected ProjectileEntity createProjectile(World world, Position position, ItemStack stack) { + ProjectileEntity p = projectile.createProjectile(stack, world, null); + p.setPosition(position.getX(), position.getY(), position.getZ()); + return p; + } + + @Override + protected float getVariation() { + return 0; + } + }); + } + + default TypedActionResult triggerThrow(World world, PlayerEntity player, Hand hand) { + ItemStack stack = player.getStackInHand(hand); + + SoundEmitter.playSoundAt(player, + getThrowSound(stack), SoundCategory.NEUTRAL, + 0.5F, + 0.4F / (world.random.nextFloat() * 0.4F + 0.8F)); + + if (!world.isClient) { + world.spawnEntity(createProjectile(stack.copyWithCount(1), world, player)); + } + + player.incrementStat(Stats.USED.getOrCreateStat(asItem())); + + if (!player.isCreative()) { + stack.decrement(1); + } + + return TypedActionResult.success(stack, world.isClient()); + } + + default ProjectileEntity createProjectile(ItemStack stack, World world, @Nullable PlayerEntity player) { + MagicProjectileEntity projectile = player == null ? new MagicProjectileEntity(world) : new MagicProjectileEntity(world, player); + projectile.setItem(stack); + projectile.setThrowDamage(getProjectileDamage(stack)); + projectile.setMaxAge(-1); + if (player != null) { + projectile.setVelocity(player, player.getPitch(), player.getYaw(), 0, 1.5F, 1); + } + return projectile; + } + + SoundEvent getThrowSound(ItemStack stack); + + float getProjectileDamage(ItemStack stack); +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/cloud/CloudShapingRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/CloudShapingRecipe.java similarity index 89% rename from src/main/java/com/minelittlepony/unicopia/item/cloud/CloudShapingRecipe.java rename to src/main/java/com/minelittlepony/unicopia/recipe/CloudShapingRecipe.java index 962b303b..3272fdc9 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/cloud/CloudShapingRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/CloudShapingRecipe.java @@ -1,7 +1,6 @@ -package com.minelittlepony.unicopia.item.cloud; +package com.minelittlepony.unicopia.recipe; import com.minelittlepony.unicopia.block.UBlocks; -import com.minelittlepony.unicopia.item.URecipes; import net.minecraft.item.ItemStack; import net.minecraft.recipe.Ingredient; diff --git a/src/main/java/com/minelittlepony/unicopia/item/GlowingRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/GlowingRecipe.java similarity index 93% rename from src/main/java/com/minelittlepony/unicopia/item/GlowingRecipe.java rename to src/main/java/com/minelittlepony/unicopia/recipe/GlowingRecipe.java index 4ee5b113..5cb6f9e8 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/GlowingRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/GlowingRecipe.java @@ -1,4 +1,6 @@ -package com.minelittlepony.unicopia.item; +package com.minelittlepony.unicopia.recipe; + +import com.minelittlepony.unicopia.item.GlowableItem; import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/minelittlepony/unicopia/item/ItemCombinationRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/ItemCombinationRecipe.java similarity index 97% rename from src/main/java/com/minelittlepony/unicopia/item/ItemCombinationRecipe.java rename to src/main/java/com/minelittlepony/unicopia/recipe/ItemCombinationRecipe.java index 9cfc35b8..bdd8b17b 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/ItemCombinationRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/ItemCombinationRecipe.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.item; +package com.minelittlepony.unicopia.recipe; import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/minelittlepony/unicopia/item/JarExtractRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/JarExtractRecipe.java similarity index 94% rename from src/main/java/com/minelittlepony/unicopia/item/JarExtractRecipe.java rename to src/main/java/com/minelittlepony/unicopia/recipe/JarExtractRecipe.java index ea10665f..1b4bb1c8 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/JarExtractRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/JarExtractRecipe.java @@ -1,7 +1,9 @@ -package com.minelittlepony.unicopia.item; +package com.minelittlepony.unicopia.recipe; import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.item.UItems; + import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; import net.minecraft.recipe.RecipeSerializer; diff --git a/src/main/java/com/minelittlepony/unicopia/item/JarInsertRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/JarInsertRecipe.java similarity index 87% rename from src/main/java/com/minelittlepony/unicopia/item/JarInsertRecipe.java rename to src/main/java/com/minelittlepony/unicopia/recipe/JarInsertRecipe.java index 9c7febd3..4867b2a9 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/JarInsertRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/JarInsertRecipe.java @@ -1,4 +1,7 @@ -package com.minelittlepony.unicopia.item; +package com.minelittlepony.unicopia.recipe; + +import com.minelittlepony.unicopia.item.EmptyJarItem; +import com.minelittlepony.unicopia.item.UItems; import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; @@ -28,7 +31,7 @@ public class JarInsertRecipe extends ItemCombinationRecipe { @Override protected boolean isInsertItem(ItemStack stack) { - return !(stack.getItem() instanceof JarItem); + return !(stack.getItem() instanceof EmptyJarItem); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/item/TransformCropsRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/TransformCropsRecipe.java similarity index 99% rename from src/main/java/com/minelittlepony/unicopia/item/TransformCropsRecipe.java rename to src/main/java/com/minelittlepony/unicopia/recipe/TransformCropsRecipe.java index 8b48b0f7..cab170d3 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/TransformCropsRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/TransformCropsRecipe.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.item; +package com.minelittlepony.unicopia.recipe; import java.util.HashSet; import java.util.Set; diff --git a/src/main/java/com/minelittlepony/unicopia/item/URecipes.java b/src/main/java/com/minelittlepony/unicopia/recipe/URecipes.java similarity index 97% rename from src/main/java/com/minelittlepony/unicopia/item/URecipes.java rename to src/main/java/com/minelittlepony/unicopia/recipe/URecipes.java index aaa01b2c..0d127624 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/URecipes.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/URecipes.java @@ -1,9 +1,9 @@ -package com.minelittlepony.unicopia.item; +package com.minelittlepony.unicopia.recipe; import com.minelittlepony.unicopia.ability.magic.spell.crafting.*; + import com.mojang.serialization.Codec; import com.mojang.serialization.DataResult; -import com.minelittlepony.unicopia.item.cloud.CloudShapingRecipe; import net.fabricmc.fabric.api.loot.v2.LootTableEvents; import net.minecraft.loot.LootTable; diff --git a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java similarity index 96% rename from src/main/java/com/minelittlepony/unicopia/item/ZapAppleRecipe.java rename to src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java index c4eb921a..127e1c42 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java @@ -1,7 +1,8 @@ -package com.minelittlepony.unicopia.item; +package com.minelittlepony.unicopia.recipe; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import com.minelittlepony.unicopia.item.UItems; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; diff --git a/src/main/java/com/minelittlepony/unicopia/server/world/OfflinePlayerCache.java b/src/main/java/com/minelittlepony/unicopia/server/world/OfflinePlayerCache.java new file mode 100644 index 00000000..03abf213 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/server/world/OfflinePlayerCache.java @@ -0,0 +1,44 @@ +package com.minelittlepony.unicopia.server.world; + +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +import org.jetbrains.annotations.Nullable; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.mojang.authlib.GameProfile; + +import net.fabricmc.fabric.api.entity.FakePlayer; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; + +public class OfflinePlayerCache { + private static final LoadingCache> CACHE = CacheBuilder.newBuilder() + .expireAfterAccess(1, TimeUnit.MINUTES) + .build(CacheLoader.from(key -> { + ServerPlayerEntity offlinePlayer = FakePlayer.get(key.world(), new GameProfile(key.playerId(), "[Offline Player]")); + + if (key.world().getServer().getPlayerManager().loadPlayerData(offlinePlayer) != null) { + return Optional.of(offlinePlayer); + } + + return Optional.empty(); + })); + + @Nullable + public static ServerPlayerEntity getOfflinePlayer(ServerWorld world, UUID playerId) { + ServerPlayerEntity player = (ServerPlayerEntity)world.getPlayerByUuid(playerId); + if (player == null) { + player = world.getServer().getPlayerManager().getPlayer(playerId); + } + if (player == null) { + return CACHE.getUnchecked(new Key(world, playerId)).orElse(null); + } + return player; + } + + record Key (ServerWorld world, UUID playerId) {} +} diff --git a/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java b/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java index 143db033..77f43a34 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java @@ -69,7 +69,7 @@ public interface UTreeGen { .sapling(Unicopia.id("palm_sapling")).sapling((generator, settings) -> { return new SaplingBlock(generator, settings) { @Override - protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { + public boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { return floor.isIn(BlockTags.SAND); } }; diff --git a/src/main/java/com/minelittlepony/unicopia/util/FluidHelper.java b/src/main/java/com/minelittlepony/unicopia/util/FluidHelper.java new file mode 100644 index 00000000..48508815 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/util/FluidHelper.java @@ -0,0 +1,69 @@ +package com.minelittlepony.unicopia.util; + +import java.util.Iterator; +import java.util.Optional; +import java.util.function.Function; + +import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.FluidState; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Hand; +import net.minecraft.util.Pair; + +/** + * Here be dragons + */ +public interface FluidHelper { + static FluidState getFullFluidState(FluidVariant variant) { + return PsyFluidHelper.getFullFluidState(variant); + } + + static Optional> extract(ItemStack stack, PlayerEntity player, Hand hand) { + return getAsContainer(stack, ContainerItemContext.forPlayerInteraction(player, hand)) + .filter(c -> !c.isResourceBlank()) + .map(container -> applyTransaction(t -> { + FluidVariant type = container.getResource(); + long amountExtracted = container.extract(type, FluidConstants.BUCKET, t); + if (amountExtracted > 0) { + return new Pair<>(amountExtracted, type); + } + return null; + })); + } + + static long deposit(ItemStack stack, PlayerEntity player, Hand hand, FluidVariant variant, long amount) { + return amount - getAsStorage(stack, ContainerItemContext.forPlayerInteraction(player, hand)) + .map(storage -> applyTransaction(t -> storage.insert(variant, amount, t))) + .orElse(0L); + } + + private static Optional> getAsStorage(ItemStack stack, ContainerItemContext context) { + return Optional.ofNullable(FluidStorage.ITEM.find(stack, context)); + } + + private static Optional> getAsContainer(ItemStack stack, ContainerItemContext context) { + return getAsStorage(stack, context).map(storage -> { + Iterator> iter = storage.iterator(); + return iter.hasNext() ? iter.next() : null; + }); + } + + private static T applyTransaction(Function action) { + try (@SuppressWarnings("deprecation") var transaction = Transaction.isOpen() + ? Transaction.getCurrentUnsafe().openNested() + : Transaction.openOuter()) { + try { + return action.apply(transaction); + } finally { + transaction.commit(); + } + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/util/MutableVector.java b/src/main/java/com/minelittlepony/unicopia/util/MutableVector.java index c76e0209..8ea4aac6 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/MutableVector.java +++ b/src/main/java/com/minelittlepony/unicopia/util/MutableVector.java @@ -20,6 +20,12 @@ public class MutableVector { z = vec.z; } + public void multiply(double x, double y, double z) { + this.x *= x; + this.y *= y; + this.z *= z; + } + public void add(Vec3d vector) { add(vector.x, vector.y, vector.z); } @@ -38,6 +44,18 @@ public class MutableVector { this.z += z; } + public double horizontalLengthSquared() { + return x * x + z * z; + } + + public double verticalLengthSquared() { + return y * y; + } + + public double lengthSquared() { + return verticalLengthSquared() + horizontalLengthSquared(); + } + public Vec3d toImmutable() { return new Vec3d(x, y, z); } diff --git a/src/main/java/com/minelittlepony/unicopia/util/NbtSerialisable.java b/src/main/java/com/minelittlepony/unicopia/util/NbtSerialisable.java index a346c460..54093f51 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/NbtSerialisable.java +++ b/src/main/java/com/minelittlepony/unicopia/util/NbtSerialisable.java @@ -8,12 +8,14 @@ import java.util.stream.Stream; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Codec; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.*; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; public interface NbtSerialisable { Serializer BLOCK_POS = Serializer.of(NbtHelper::toBlockPos, NbtHelper::fromBlockPos); + Serializer ITEM_STACK = Serializer.of(ItemStack::fromNbt, stack -> stack.writeNbt(new NbtCompound())); /** * Called to save this to nbt to persist state on file or to transmit over the network @@ -44,6 +46,7 @@ public interface NbtSerialisable { } static Vec3d readVector(NbtList list) { + return new Vec3d(list.getDouble(0), list.getDouble(1), list.getDouble(2)); } @@ -97,7 +100,7 @@ public interface NbtSerialisable { return read((NbtCompound)element); } - default NbtList writeAll(Collection ts) { + default NbtList writeAll(Collection ts) { NbtList list = new NbtList(); ts.stream().map(this::write).forEach(list::add); return list; diff --git a/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java b/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java index 7e203abd..2cb644e4 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java +++ b/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java @@ -21,7 +21,7 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; public interface PosHelper { - + Direction[] ALL = Direction.values(); Direction[] HORIZONTAL = Arrays.stream(Direction.values()).filter(d -> d.getAxis().isHorizontal()).toArray(Direction[]::new); static Vec3d offset(Vec3d a, Vec3i b) { diff --git a/src/main/java/com/minelittlepony/unicopia/util/PsyFluidHelper.java b/src/main/java/com/minelittlepony/unicopia/util/PsyFluidHelper.java new file mode 100644 index 00000000..f83e44df --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/util/PsyFluidHelper.java @@ -0,0 +1,51 @@ +package com.minelittlepony.unicopia.util; + +import java.lang.reflect.Method; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Supplier; + +import com.google.common.base.Suppliers; + +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.minecraft.fluid.FluidState; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.Registries; + +final class PsyFluidHelper { + private static final Supplier>> SIMPLE_FLUID_CLASS = Suppliers.memoize(() -> { + try { + return Optional.ofNullable(Class.forName("ivorius.psychedelicraft.fluid.SimpleFluid")); + } catch (Throwable t) { + return Optional.empty(); + } + }); + private static final Function FALLBACK_METHOD = fluid -> fluid.getFluid().getDefaultState(); + private static final Supplier> GET_FULL_FLUID_STATE = Suppliers.memoize(() -> SIMPLE_FLUID_CLASS.get().>map(type -> { + try { + final Method method = type.getDeclaredMethod("getFluidState", ItemStack.class); + if (method != null) { + return fluid -> { + try { + ItemStack stack = Items.STONE.getDefaultStack(); + NbtCompound fluidTag = stack.getOrCreateSubNbt("fluid"); + fluidTag.putString("id", Registries.FLUID.getId(fluid.getFluid()).toString()); + fluidTag.put("attributes", fluid.getNbt()); + return FluidState.class.cast(method.invoke(type.cast(fluid), stack)); + } catch (Throwable tt) {} + return FALLBACK_METHOD.apply(fluid); + }; + } + } catch (Throwable t) {} + return FALLBACK_METHOD; + }).orElse(FALLBACK_METHOD)); + + static FluidState getFullFluidState(FluidVariant variant) { + return SIMPLE_FLUID_CLASS.get() + .filter(type -> type.isAssignableFrom(variant.getFluid().getClass())) + .map(type -> GET_FULL_FLUID_STATE.get().apply(variant)) + .orElseGet(() -> variant.getFluid().getDefaultState()); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/util/VoxelShapeUtil.java b/src/main/java/com/minelittlepony/unicopia/util/VoxelShapeUtil.java index adff046a..0a14890d 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/VoxelShapeUtil.java +++ b/src/main/java/com/minelittlepony/unicopia/util/VoxelShapeUtil.java @@ -1,5 +1,6 @@ package com.minelittlepony.unicopia.util; +import net.minecraft.util.Util; import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.util.math.MathHelper; @@ -14,7 +15,7 @@ public interface VoxelShapeUtil { Vec3d CENTER = new Vec3d(0.5, 0, 0.5); static Function rotator(VoxelShape base) { - return d -> rotate(base, d); + return Util.memoize(d -> rotate(base, d)); } static VoxelShape rotate(VoxelShape shape, Direction direction) { @@ -27,7 +28,7 @@ public interface VoxelShapeUtil { float angle = direction.asRotation() * MathHelper.RADIANS_PER_DEGREE; return VoxelShapes.union(VoxelShapes.empty(), shape.getBoundingBoxes().stream() .map(box -> { - //These first two are enough for orthogonal rotations + //These first two are enough for orthogonal rotations Vec3d a = rotate(box.minX, box.minZ, angle); Vec3d b = rotate(box.maxX, box.maxZ, angle); //These cover odd angles diff --git a/src/main/java/com/minelittlepony/unicopia/util/registry/DynamicRegistry.java b/src/main/java/com/minelittlepony/unicopia/util/registry/DynamicRegistry.java new file mode 100644 index 00000000..0dd2949a --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/util/registry/DynamicRegistry.java @@ -0,0 +1,45 @@ +package com.minelittlepony.unicopia.util.registry; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +import net.fabricmc.fabric.api.event.registry.DynamicRegistrySetupCallback; +import net.minecraft.registry.Registerable; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryBuilder; +import net.minecraft.registry.RegistryKey; +import net.minecraft.util.Identifier; + +public class DynamicRegistry implements RegistryBuilder.BootstrapFunction { + private final RegistryKey> registry; + private final Map, Entry> keys = new HashMap<>(); + private final Function, T> valueFactory; + + public DynamicRegistry(RegistryKey> registry, Function, T> valueFactory) { + this.registry = registry; + this.valueFactory = valueFactory; + + DynamicRegistrySetupCallback.EVENT.register(registries -> { + registries.getOptional(registry).ifPresent(r -> { + keys.forEach((key, entry)-> Registry.register(r, key.getValue(), entry.factory().apply(key))); + }); + }); + } + + @Override + public void run(Registerable registerable) { + keys.forEach((key, entry) -> registerable.register(key, entry.factory().apply(key))); + } + + public RegistryKey register(Identifier id) { + return register(id, valueFactory); + } + + public RegistryKey register(Identifier id, Function, T> valueFactory) { + return keys.computeIfAbsent(RegistryKey.of(registry, id), k -> new Entry<>(k, valueFactory)).key(); + } + + record Entry(RegistryKey key, Function, T> factory) {} + +} diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index 9213335e..df8a8f2e 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -74,6 +74,14 @@ "item.unicopia.cooked_zap_apple": "Cooked Zap Apple", "item.unicopia.zap_apple": "Zap Apple", "item.unicopia.zap_bulb": "Unripened Zap Apple", + "item.unicopia.rotten_cod": "Rotten Cod", + "item.unicopia.rotten_salmon": "Rotten Salmon", + "item.unicopia.rotten_tropical_fish": "Rotten Tropical Fish", + "item.unicopia.rotten_pufferfish": "Rotten Pufferfish", + "item.unicopia.cooked_tropical_fish": "Cooked Tropical Fish", + "item.unicopia.cooked_pufferfish": "Cooked Pufferfish", + "item.unicopia.fried_axolotl": "Fried Axolotl", + "item.unicopia.green_fried_egg": "Green Fried Egg", "item.unicopia.love_bottle": "Bottle o' Love", "item.unicopia.love_bucket": "Love Bucket", @@ -81,12 +89,17 @@ "item.unicopia.plunder_vine": "Plunder Vine", "item.unicopia.empty_jar": "Glass Jar", + "block.unicopia.jar": "Glass Jar", "item.unicopia.filled_jar": "%s in a Jar", "item.unicopia.rain_cloud_jar": "Rain in a Jar", + "item.unicopia.cloud_jar": "Rain in a Jar", "item.unicopia.storm_cloud_jar": "Storm in a Jar", + "block.unicopia.storm_jar": "Storm in a Jar", "item.unicopia.lightning_jar": "Lightning in a Jar", + "block.unicopia.lightning_jar": "Lightning in a Jar", "item.unicopia.zap_apple_jam_jar": "Zap Apple Jam", - + "block.unicopia.zap_jar": "Jar of Zap Apple Jam", + "item.unicopia.toast": "Toast", "item.unicopia.burned_toast": "Burned Toast", "item.unicopia.jam_toast": "Toast with Zap Apple Jam", @@ -145,7 +158,13 @@ "item.unicopia.crispy_hay_fries": "Crispy Hay Fries", "item.unicopia.horse_shoe_fries": "Horse Shoe Fries", "item.unicopia.wheat_worms": "Wheat Worms", + "item.unicopia.baited_fishing_rod": "Baited Fishing Rod", "item.unicopia.muffin": "Muffin", + "item.unicopia.scone": "Scone", + "item.unicopia.oatmeal_cookie": "Oatmeal Cookie", + "item.unicopia.chocolate_oatmeal_cookie": "Chocolate Oatmeal Cookie", + "item.unicopia.pinecone_cookie": "Pinecone Cookie", + "item.unicopia.bowl_of_nuts": "Bowl of Nuts", "item.unicopia.pegasus_amulet": "Wings of Icarus", "item.unicopia.pegasus_amulet.lore": "Grants temporary flight to whoever wears it", @@ -197,6 +216,7 @@ "item.unicopia.music_disc_funk.desc": "funk, just funk", "item.unicopia.cloud_lump": "Cloud Lump", + "item.unicopia.white_bed_sheets": "White Bed Sheets", "item.unicopia.light_gray_bed_sheets": "Light Gray Bed Sheets", "item.unicopia.gray_bed_sheets": "Gray Bed Sheets", "item.unicopia.black_bed_sheets": "Black Bed Sheets", @@ -279,6 +299,7 @@ "block.unicopia.golden_oak_leaves": "Golden Oak Leaves", "block.unicopia.golden_oak_log": "Golden Oak Log", "block.unicopia.mango": "Mango", + "block.unicopia.worm_block": "Block of Worms", "block.unicopia.mango_leaves": "Mango Leaves", "block.unicopia.mango_sapling": "Mango Sapling", "block.unicopia.potted_mango_sapling": "Potted Mango Sapling", @@ -354,6 +375,7 @@ "entity.unicopia.butterfly": "Butterfly", "entity.unicopia.twittermite": "Twittermite", + "entity.unicopia.specter": "Specter", "entity.unicopia.cast_spell": "Cast Spell", "entity.unicopia.cast_spell.by": "a spell cast by %s", "entity.unicopia.spellbook": "Spellbook", @@ -605,42 +627,43 @@ "unicopia.diet.hunger": "Hunger Ratio: %s%%", "unicopia.diet.saturation": "Saturation Ratio: %s%%", - "tag.unicopia.food_types.rotten_meat": "Rotting Meat", - "tag.unicopia.food_types.raw_meat": "Fresh Meat", - "tag.unicopia.food_types.cooked_meat": "Prepared Meat", - "tag.unicopia.food_types.raw_fish": "Fresh Fish", - "tag.unicopia.food_types.cooked_fish": "Prepared Fish", - "tag.unicopia.food_types.raw_insect": "Bugs & Insects", - "tag.unicopia.food_types.cooked_insect": "Cooked Bugs & Insects", - "tag.unicopia.food_types.nuts_and_seeds": "Nuts & Seeds", - "tag.unicopia.food_types.love": "Love", - "tag.unicopia.food_types.rocks": "Rocks", - "tag.unicopia.food_types.pinecone": "Nuts & Seeds", - "tag.unicopia.food_types.bat_ponys_delight": "Bat Pony Treats", - "tag.unicopia.food_types.cooked_sea_vegitables": "Prepared Fish Food", - "tag.unicopia.food_types.raw_sea_vegitables": "Fresh Fish Food", - "tag.unicopia.food_types.shells": "Sea Shells", - "tag.unicopia.food_types.shelly": "Sea Shells", - "tag.unicopia.food_types.candy": "Candy", - "tag.unicopia.food_types.desserts": "Desserts", - "tag.unicopia.food_types.fruit": "Fruit", - "tag.unicopia.food_types.baked_goods": "Baked Goods", - "tag.unicopia.food_types.misc": "Misc", - "tag.unicopia.food_types.fruits_and_vegetables": "Fruits & Vegetables", - "tag.unicopia.food_types.drinks": "Drinks", - "tag.minecraft.leaves": "Leaves", - - "tag.unicopia.food_types.forage_edible_filling": "Bulky Plant Matter", - "tag.unicopia.food_types.forage_edible": "Plant Matter", - "tag.unicopia.food_types.forage_nauseating": "Nauseating", - "tag.unicopia.food_types.forage_prickly": "Prickly", - "tag.unicopia.food_types.forage_risky": "Unsafe", - "tag.unicopia.food_types.forage_strengthening": "Strength Enhancing", - "tag.unicopia.food_types.forage_severely_prickly": "Very Prickly", - "tag.unicopia.food_types.forage_severely_nauseating": "Sickening", - "tag.unicopia.food_types.forage_radioactive": "Glowy", - "tag.unicopia.food_types.forage_dangerous": "Dangerous", - "tag.unicopia.food_types.forage_blinding": "Toxic", + "food_group.unicopia.meat.rotten": "Rotting Meat", + "food_group.unicopia.meat.raw": "Fresh Meat", + "food_group.unicopia.meat.cooked": "Prepared Meat", + "food_group.unicopia.fish.rotten": "Rotten Fish", + "food_group.unicopia.fish.raw": "Fresh Fish", + "food_group.unicopia.fish.cooked": "Prepared Fish", + "food_group.unicopia.insect.rotten": "Rotted Bugs & Insects", + "food_group.unicopia.insect.raw": "Bugs & Insects", + "food_group.unicopia.insect.cooked": "Cooked Bugs & Insects", + "food_group.unicopia.nuts_and_seeds": "Nuts & Seeds", + "food_group.unicopia.love": "Love", + "food_group.unicopia.rocks": "Rocks", + "food_group.unicopia.pinecone": "Nuts & Seeds", + "food_group.unicopia.bat_ponys_delight": "Bat Pony Treats", + "food_group.unicopia.sea_vegetable.cooked": "Prepared Shells & Coral", + "food_group.unicopia.sea_vegetable.raw": "Shells & Coral", + "food_group.unicopia.shells": "Sea Shells", + "food_group.unicopia.special_shells": "Companions", + "food_group.unicopia.candy": "Candy", + "food_group.unicopia.desserts": "Desserts", + "food_group.unicopia.fruit": "Fruit", + "food_group.unicopia.baked_goods": "Baked Goods", + "food_group.unicopia.misc": "Misc", + "food_group.unicopia.fruits_and_vegetables": "Fruits & Vegetables", + "food_group.unicopia.drinks": "Drinks", + "food_group.unicopia.foraging.edible_filling": "Bulky Plant Matter", + "food_group.unicopia.foraging.edible": "Plant Matter", + "food_group.unicopia.foraging.nauseating": "Nauseating", + "food_group.unicopia.foraging.prickly": "Prickly", + "food_group.unicopia.foraging.risky": "Unsafe", + "food_group.unicopia.foraging.strengthening": "Strength Enhancing", + "food_group.unicopia.foraging.severely_prickly": "Very Prickly", + "food_group.unicopia.foraging.severely_nauseating": "Sickening", + "food_group.unicopia.foraging.radioactive": "Glowy", + "food_group.unicopia.foraging.dangerous": "Dangerous", + "food_group.unicopia.foraging.blinding": "Toxic", + "food_group.unicopia.foraging.leafy_greens": "Leafy Greens", "toxicity.safe.name": "Safe", "toxicity.mild.name": "Mildly Toxic", @@ -1332,6 +1355,8 @@ "enchantment.unicopia.heart_bound.desc": "Causes an item to stay with you after you die", "enchantment.unicopia.consumption": "Consumption", "enchantment.unicopia.consumption.desc": "Converts drops mined using a tool into raw experience", + "enchantment.unicopia.feather_touch": "Feather Touch", + "enchantment.unicopia.feather_touch.desc": "Allows breaking and placing cloud blocks when held", "commands.race.success.self": "Set own race to %1$s", "commands.race.success": "%1$s changed race to %2$s", @@ -1380,6 +1405,7 @@ "commands.gravity.set": "Your gravity has been updated to %f", "commands.gravity.set.self": "Set own gravity to %f", "commands.gravity.set.other": "Set %s's gravity to %f", + "commands.gravity.set.multiple": "Updated %s entities", "unicopia.options.title": "Unicopia Options", "unicopia.options.ignore_mine_lp": "Ignore Mine Little Pony", @@ -1593,12 +1619,22 @@ "advancements.unicopia.praise_the_sun.description": "Experience Celestia's unbridled glory", "advancements.unicopia.cool_potato.title": "Cool Potato", "advancements.unicopia.cool_potato.description": "Protect your eyes from the sun", + "advancements.unicopia.take_a_note.title": "Take a Note, Spike", + "advancements.unicopia.take_a_note.description": "Obtain a dragon breath scroll", + "advancements.unicopia.dear_princess.title": "Dear princess...", + "advancements.unicopia.dear_princess.description": "Send a letter with a dragon's breath scroll", + "advancements.unicopia.i_await_your_reply.title": "I Await Your Reply", + "advancements.unicopia.i_await_your_reply.description": "Use the dragon's breath scroll to send someone a dragon's breath scroll", "advancements.unicopia.baked_bads.title": "Baked Bads", "advancements.unicopia.baked_bads.description": "Bake a delicious muffin", "advancements.unicopia.mid_flight_interruption.title": "Mid-Flight Interruption", "advancements.unicopia.mid_flight_interruption.description": "Get struck by lightning whilst flying in a storm", "advancements.unicopia.lightning_bug.title": "Lightning Bug", - "advancements.unicopia.lightning_bug.description": "Attract 10 lightning strikes", + "advancements.unicopia.lightning_bug.description": "Attract 10 lightning strikes as a changeling", + "advancements.unicopia.wonder_bolt.title": "Wonder Bolt", + "advancements.unicopia.wonder_bolt.description": "Attract 10 lightning strikes", + "advancements.unicopia.bait.title": "Is This Bait?", + "advancements.unicopia.bait.description": "Put some worms on a hook", "advancements.unicopia.jar.title": "Oh wow. What's this?", "advancements.unicopia.jar.description": "Find an empty jar", "advancements.unicopia.gotcha.title": "Got'cha!", @@ -1611,6 +1647,12 @@ "advancements.unicopia.eat_trick_apple.description": "Bite into a zap apple", "advancements.unicopia.eat_pinecone.title": "Desperation", "advancements.unicopia.eat_pinecone.description": "Eat a pinecone", + "advancements.unicopia.tastes_like_chicken.title": "Tastes Like Chicken", + "advancements.unicopia.tastes_like_chicken.description": "Fry and eat an axolotl", + "advancements.unicopia.what_the_hay.title": "What The Hay", + "advancements.unicopia.what_the_hay.description": "Eat an entire block of hay", + "advancements.unicopia.oats_so_easy.title": "Oats So Easy", + "advancements.unicopia.oats_so_easy.description": "Farm some oats", "advancements.unicopia.imported_oats.title": "Delicious As They Are Expensive", "advancements.unicopia.imported_oats.description": "Send or receive fancy imported oats", @@ -1640,11 +1682,15 @@ "advancements.unicopia.sweet_apple_acres.description": "Obtain one of every apple", "advancements.unicopia.brew_cider.title": "Applejack's Finest", "advancements.unicopia.brew_cider.description": "Brew some cider", + "advancements.unicopia.basket_case.title": "Basket Case", + "advancements.unicopia.basket_case.description": "Weave a basket", + "advancements.unicopia.aeronaut.title": "Aeronaut", + "advancements.unicopia.aeronaut.description": "Equip your basket with a lantern and hot air balloon", "advancements.unicopia.travelling_in_style.title": "Travelling in Style", "advancements.unicopia.travelling_in_style.description": "Ride a hot air balloon", - "advancements.unicopia.night_route.title": "Children of The Night", - "advancements.unicopia.night_route.description": "Walk the path of the night", + "advancements.unicopia.bat_route.title": "Children of The Night", + "advancements.unicopia.bat_route.description": "Walk the path of the night", "advancements.unicopia.screech_twenty_mobs.title": "Terror From The Skies", "advancements.unicopia.screech_twenty_mobs.description": "Rain down terror on at least 20 mobs at once", "advancements.unicopia.screech_self.title": "Jeepers!", @@ -1657,10 +1703,18 @@ "advancements.unicopia.blasphemy.title": "Blasphemy!", "advancements.unicopia.blasphemy.description": "Ding Celestia on the noggin. Oops!", - "advancements.unicopia.earth_route.title": "Path of the Pony", + "advancements.unicopia.earth_route.title": "Hearth of the Earth", "advancements.unicopia.earth_route.description": "Join the Apple Clan", "advancements.unicopia.sticks_and_stones.title": "Sticks and Stones", "advancements.unicopia.sticks_and_stones.description": "Kill a mob by throwing rocks at it", + "advancements.unicopia.blacksmith.title": "Blacksmith", + "advancements.unicopia.blacksmith.description": "Craft a horseshoe", + "advancements.unicopia.change_of_shoes.title": "A Change of Shoes", + "advancements.unicopia.change_of_shoes.description": "Craft an iron horse shoe", + "advancements.unicopia.fashionably_expensive.title": "Fashionably Expensive", + "advancements.unicopia.fashionably_expensive.description": "Upgrade to a set of golden horse shoes", + "advancements.unicopia.overkill.title": "Overkill", + "advancements.unicopia.overkill.description": "Craft a netherite horse shoe", "advancements.unicopia.dead_ringer.title": "Dead Ringer", "advancements.unicopia.dead_ringer.description": "Kill a mob with a horseshoe", "advancements.unicopia.born_on_a_rock_farm.title": "Born on a Rock Farm", @@ -1668,14 +1722,32 @@ "advancements.unicopia.thats_unusual.title": "That's Unusual", "advancements.unicopia.thats_unusual.description": "But what does it do?", - "advancements.unicopia.sky_route.title": "Path of the Pegasus", - "advancements.unicopia.sky_route.description": "Join the Clousdale Pegasi", + "advancements.unicopia.pegasus_route.title": "Path of the Pegasus", + "advancements.unicopia.pegasus_route.description": "Join the Clousdale Pegasi", "advancements.unicopia.molting_season_1.title": "Molting Season", - "advancements.unicopia.molting_season_1.description": "Drop a feather whilst flying", + "advancements.unicopia.molting_season_1.description": "Drop your first feather whilst flying", "advancements.unicopia.molting_season_2.title": "Molting Season 2", - "advancements.unicopia.molting_season_2.description": "Drop 5 feathers whilst flying", + "advancements.unicopia.molting_season_2.description": "Drop your second feather whilst flying", "advancements.unicopia.molting_season_3.title": "Molting Season 3", - "advancements.unicopia.molting_season_3.description": "Drop 15 feathers whilst flying", + "advancements.unicopia.molting_season_3.description": "Drop your fourth feather whilst flying", + "advancements.unicopia.molting_season_4.title": "Molting Season 4", + "advancements.unicopia.molting_season_4.description": "Drop your eighth feather whilst flying", + "advancements.unicopia.molting_season_5.title": "Molting Season 5", + "advancements.unicopia.molting_season_5.description": "Drop your sixteenth feather whilst flying", + "advancements.unicopia.molting_season_6.title": "Molting Season 6", + "advancements.unicopia.molting_season_6.description": "Drop your thirty-second feather whilst flying", + "advancements.unicopia.molting_season_7.title": "Molting Season 7", + "advancements.unicopia.molting_season_7.description": "Drop your sixty-fourth feather whilst flying", + "advancements.unicopia.molting_season_8.title": "Molting Season 8", + "advancements.unicopia.molting_season_8.description": "Drop your hundred-and-twenty-eighth feather whilst flying", + "advancements.unicopia.molting_season_9.title": "Molting Season 9", + "advancements.unicopia.molting_season_9.description": "Drop your two-hundred-and-fifty-sixth feather whilst flying", + "advancements.unicopia.molting_season_10.title": "Molting Season 10", + "advancements.unicopia.molting_season_10.description": "Drop your five-hundred-and-twelth feather whilst flying", + "advancements.unicopia.molting_season_11.title": "Molting Season 11", + "advancements.unicopia.molting_season_11.description": "Drop your one-thousand-and-twenty-fourth feather whilst flying", + "advancements.unicopia.dedicated_flier.title": "It's okay, you can stop now", + "advancements.unicopia.dedicated_flier.description": "Drop your two-thousand-and-fourty-eighth feather whilst flying", "advancements.unicopia.rainbow_crash.title": "Dammit, Rainbow", "advancements.unicopia.rainbow_crash.description": "Wage war on the evil glass window nation", "advancements.unicopia.second_wind.title": "Second Wind", @@ -1683,11 +1755,13 @@ "advancements.unicopia.deter_phantom.title": "What Flies Around", "advancements.unicopia.deter_phantom.description": "Get up there and give those phantoms a taste of their own medicine", - "advancements.unicopia.magical_route.title": "Horn of the Unicorn", - "advancements.unicopia.magical_route.description": "Delve into the world of glitter and rainbows", + "advancements.unicopia.unicorn_route.title": "Horn of the Unicorn", + "advancements.unicopia.unicorn_route.description": "Delve into the world of glitter and rainbows", "advancements.unicopia.books.title": "Books!", "advancements.unicopia.books.description": "This is MY spellbook and I'm going to READ it!", + "advancements.unicopia.books_books_books.title": "Books! Books! Books!", + "advancements.unicopia.books_books_books.description": "Have an inventory full of books", "advancements.unicopia.tempted.title": "Tempting...", "advancements.unicopia.tempted.description": "Put on the alicorn amulet", "advancements.unicopia.hello_darkness_my_old_friend.title": "Hello Darkness...", @@ -1710,6 +1784,13 @@ "advancements.unicopia.love_is_power.title": "Love is Power", "advancements.unicopia.love_is_power.description": "Banish King Sombra with a crystal heart", + "advancements.unicopia.hippogriff_route.title": "Splash of Seaquestria", + "advancements.unicopia.hippogriff_route.description": "Join the Hippogriff's nest", + "advancements.unicopia.shoo_be_doo.title": "Shoo Be Doo!", + "advancements.unicopia.shoo_be_doo.description": "Use a pearl necklace to turn into a sea creature", + "advancements.unicopia.shoo_be_done.title": "Shoo Be Done!", + "advancements.unicopia.shoo_be_done.description": "Use a pearl necklace to turn back to normal", + "unicopia.toast.discoveries.title": "New Discoveries!", "unicopia.toast.discoveries.description": "Check your spellbook" } diff --git a/src/main/resources/assets/unicopia/models/block/cloud_jar_filling.json b/src/main/resources/assets/unicopia/models/block/cloud_jar_filling.json new file mode 100644 index 00000000..2470653c --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/cloud_jar_filling.json @@ -0,0 +1,56 @@ +{ + "textures": { + "cloud": "unicopia:block/cloud", + "particle": "#cloud" + }, + "elements": [ + { + "from": [5.1, 6.1, 5.1], + "to": [9.9, 8.9, 8.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [6.1, 4.1, 7.1], + "to": [11.9, 6.9, 10.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [6.1, 8.1, 7.1], + "to": [9.9, 9.9, 9.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [6.1, 7.1, 8.1], + "to": [10.9, 8.9, 10.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/lightning_jar_filling.json b/src/main/resources/assets/unicopia/models/block/lightning_jar_filling.json new file mode 100644 index 00000000..d8fdd3ec --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/lightning_jar_filling.json @@ -0,0 +1,34 @@ +{ + "textures": { + "filling": "unicopia:block/lightning_jar_filling", + "particle": "#filling" + }, + "elements": [ + { + "from": [6, 1, 7.5], + "to": [11, 11, 7.5], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 5, 7], "rescale": true}, + "faces": { + "north": {"uv": [3, 0, 13, 16], "texture": "#filling"}, + "east": {"uv": [0, 0, 0, 8], "texture": "#filling"}, + "south": {"uv": [3, 0, 13, 16], "texture": "#filling"}, + "west": {"uv": [0, 0, 0, 8], "texture": "#filling"}, + "up": {"uv": [0, 0, 6, 0], "texture": "#filling"}, + "down": {"uv": [0, 0, 6, 0], "texture": "#filling"} + } + }, + { + "from": [5, 1, 7.5], + "to": [10, 11, 7.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 5, 7], "rescale": true}, + "faces": { + "north": {"uv": [3, 0, 13, 16], "texture": "#filling"}, + "east": {"uv": [0, 0, 0, 8], "texture": "#filling"}, + "south": {"uv": [3, 0, 13, 16], "texture": "#filling"}, + "west": {"uv": [0, 0, 0, 8], "texture": "#filling"}, + "up": {"uv": [0, 0, 6, 0], "rotation": 180, "texture": "#filling"}, + "down": {"uv": [0, 0, 6, 0], "rotation": 180, "texture": "#filling"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/storm_jar_filling.json b/src/main/resources/assets/unicopia/models/block/storm_jar_filling.json new file mode 100644 index 00000000..b5eeffd6 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/storm_jar_filling.json @@ -0,0 +1,140 @@ +{ + "textures": { + "cloud": "unicopia:block/cloud", + "particle": "#cloud" + }, + "elements": [ + { + "from": [4.1, 3.1, 4.1], + "to": [11.9, 11.9, 11.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [6.1, 2.1, 5.1], + "to": [10.9, 2.9, 10.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [7.1, 11.1, 6.1], + "to": [12.9, 13.9, 9.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [3, 9, 10], + "to": [5, 11, 12], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [3.1, 10.1, 7.1], + "to": [8.9, 12.9, 10.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [11, 10, 9], + "to": [13, 12, 11], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [9, 13, 7], + "to": [11, 15, 9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [5, 13, 7], + "to": [7, 15, 9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [3, 8, 5], + "to": [5, 10, 7], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [6.1, 10.1, 7.1], + "to": [9.9, 11.9, 9.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + }, + { + "from": [6.1, 11.1, 9.1], + "to": [10.9, 12.9, 11.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#cloud"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#cloud"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#cloud"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#cloud"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#cloud"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#cloud"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/template_jar.json b/src/main/resources/assets/unicopia/models/block/template_jar.json new file mode 100644 index 00000000..0133ab21 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/template_jar.json @@ -0,0 +1,57 @@ +{ + "textures": { + "body": "unicopia:block/jar_body", + "cork": "unicopia:block/jar_cork", + "particle": "#body" + }, + "elements": [ + { + "from": [4, 0, 4], + "to": [12, 12, 12], + "faces": { + "north": {"uv": [0, 0, 8, 12], "texture": "#body"}, + "east": {"uv": [0, 0, 8, 12], "texture": "#body"}, + "south": {"uv": [0, 0, 8, 12], "texture": "#body"}, + "west": {"uv": [0, 0, 8, 12], "texture": "#body"}, + "up": {"uv": [8, 0, 16, 8], "texture": "#body"}, + "down": {"uv": [8, 0, 16, 8], "texture": "#body"} + } + }, + { + "from": [5, 13, 5], + "to": [11, 14, 11], + "faces": { + "north": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "east": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "south": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "west": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "up": {"uv": [8, 0, 16, 8], "texture": "#body"}, + "down": {"uv": [8, 0, 16, 8], "texture": "#body"} + } + }, + { + "from": [6, 12, 6], + "to": [10, 13, 10], + "faces": { + "north": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "east": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "south": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "west": {"uv": [0, 0, 8, 1], "texture": "#body"}, + "up": {"uv": [8, 0, 16, 8], "texture": "#body"}, + "down": {"uv": [8, 0, 16, 8], "texture": "#body"} + } + }, + { + "from": [6, 13, 6], + "to": [10, 16, 10], + "faces": { + "north": {"uv": [0, 4, 4, 7], "texture": "#cork"}, + "east": {"uv": [0, 4, 4, 7], "texture": "#cork"}, + "south": {"uv": [0, 4, 4, 7], "texture": "#cork"}, + "west": {"uv": [0, 4, 4, 7], "texture": "#cork"}, + "up": {"uv": [0, 0, 4, 4], "texture": "#cork"}, + "down": {"uv": [4, 0, 8, 4], "texture": "#cork"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/zap_jar_filling.json b/src/main/resources/assets/unicopia/models/block/zap_jar_filling.json new file mode 100644 index 00000000..8516e5c6 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/zap_jar_filling.json @@ -0,0 +1,20 @@ +{ + "textures": { + "filling": "unicopia:block/zap_jar_filling", + "particle": "#filling" + }, + "elements": [ + { + "from": [4.1, 0.1, 4.1], + "to": [11.9, 9.9, 11.9], + "faces": { + "north": {"uv": [0, 2, 8, 12], "texture": "#filling"}, + "east": {"uv": [0, 6, 8, 16], "texture": "#filling"}, + "south": {"uv": [8, 6, 16, 16], "texture": "#filling"}, + "west": {"uv": [8, 0, 16, 10], "texture": "#filling"}, + "up": {"uv": [4, 3, 12, 11], "texture": "#filling"}, + "down": {"uv": [8, 4, 16, 12], "texture": "#filling"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/mysterious_egg.json b/src/main/resources/assets/unicopia/models/item/mysterious_egg.json deleted file mode 100644 index 7c9548c9..00000000 --- a/src/main/resources/assets/unicopia/models/item/mysterious_egg.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "parent": "unicopia:block/mysterious_egg_stage1", - "gui_light": "side", - "display": { - "gui": { - "rotation": [ 30, 225, 0 ], - "translation": [ 0, 0, 0], - "scale":[ 0.625, 0.625, 0.625 ] - }, - "fixed": { - "rotation": [ 0, 0, 0 ], - "translation": [ 0, 0, 0], - "scale":[ 0.5, 0.5, 0.5 ] - } - } -} diff --git a/src/main/resources/assets/unicopia/particles/footprint.json b/src/main/resources/assets/unicopia/particles/footprint.json new file mode 100644 index 00000000..50c757f1 --- /dev/null +++ b/src/main/resources/assets/unicopia/particles/footprint.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "unicopia:footprint" + ] +} diff --git a/src/main/resources/assets/unicopia/textures/block/jar_body.png b/src/main/resources/assets/unicopia/textures/block/jar_body.png new file mode 100644 index 00000000..99e38ba2 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/jar_body.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/jar_cork.png b/src/main/resources/assets/unicopia/textures/block/jar_cork.png new file mode 100644 index 00000000..c87771fa Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/jar_cork.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/lightning_jar_filling.png b/src/main/resources/assets/unicopia/textures/block/lightning_jar_filling.png new file mode 100644 index 00000000..588a0b0e Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/lightning_jar_filling.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/worm_block.png b/src/main/resources/assets/unicopia/textures/block/worm_block.png new file mode 100644 index 00000000..f27791b8 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/worm_block.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/zap_jar_filling.png b/src/main/resources/assets/unicopia/textures/block/zap_jar_filling.png new file mode 100644 index 00000000..78d8a21f Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/zap_jar_filling.png differ diff --git a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/dawn.png b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/dawn.png index 0a17fef9..64d8bf42 100644 Binary files a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/dawn.png and b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/dawn.png differ diff --git a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/equality.png b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/equality.png index c87606b9..6f7e62be 100644 Binary files a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/equality.png and b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/equality.png differ diff --git a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/luna.png b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/luna.png index 526d6d66..d94ae769 100644 Binary files a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/luna.png and b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/luna.png differ diff --git a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/storm.png b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/storm.png index 65f049a5..49d2cee3 100644 Binary files a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/storm.png and b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/storm.png differ diff --git a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/tale.png b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/tale.png index 6f074e82..39e2f703 100644 Binary files a/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/tale.png and b/src/main/resources/assets/unicopia/textures/entity/air_balloon/canopy/tale.png differ diff --git a/src/main/resources/assets/unicopia/textures/entity/air_balloon/sandbags.png b/src/main/resources/assets/unicopia/textures/entity/air_balloon/sandbags.png new file mode 100644 index 00000000..fdee304f Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/entity/air_balloon/sandbags.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/baited_fishing_rod.png b/src/main/resources/assets/unicopia/textures/item/baited_fishing_rod.png new file mode 100644 index 00000000..90e3a7f6 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/baited_fishing_rod.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/bowl_of_nuts.png b/src/main/resources/assets/unicopia/textures/item/bowl_of_nuts.png new file mode 100644 index 00000000..8e684446 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/bowl_of_nuts.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/chocolate_oatmeal_cookie.png b/src/main/resources/assets/unicopia/textures/item/chocolate_oatmeal_cookie.png new file mode 100644 index 00000000..d3396a3a Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/chocolate_oatmeal_cookie.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/cooked_pufferfish.png b/src/main/resources/assets/unicopia/textures/item/cooked_pufferfish.png new file mode 100644 index 00000000..eef6293b Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/cooked_pufferfish.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/cooked_tropical_fish.png b/src/main/resources/assets/unicopia/textures/item/cooked_tropical_fish.png new file mode 100644 index 00000000..93747e0f Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/cooked_tropical_fish.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/fried_axolotl.png b/src/main/resources/assets/unicopia/textures/item/fried_axolotl.png new file mode 100644 index 00000000..c1f00289 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/fried_axolotl.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/fried_egg.png b/src/main/resources/assets/unicopia/textures/item/fried_egg.png new file mode 100644 index 00000000..55d4a4ac Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/fried_egg.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/green_fried_egg.png b/src/main/resources/assets/unicopia/textures/item/green_fried_egg.png new file mode 100644 index 00000000..46e85b59 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/green_fried_egg.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/mysterious_egg.png b/src/main/resources/assets/unicopia/textures/item/mysterious_egg.png new file mode 100644 index 00000000..bc1d9a42 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/mysterious_egg.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/oatmeal_cookie.png b/src/main/resources/assets/unicopia/textures/item/oatmeal_cookie.png new file mode 100644 index 00000000..daa46c80 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/oatmeal_cookie.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/pinecone_cookie.png b/src/main/resources/assets/unicopia/textures/item/pinecone_cookie.png new file mode 100644 index 00000000..79fb1ed7 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/pinecone_cookie.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/rotten_cod.png b/src/main/resources/assets/unicopia/textures/item/rotten_cod.png new file mode 100644 index 00000000..9cd70e51 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/rotten_cod.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/rotten_pufferfish.png b/src/main/resources/assets/unicopia/textures/item/rotten_pufferfish.png new file mode 100644 index 00000000..24ade9a5 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/rotten_pufferfish.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/rotten_salmon.png b/src/main/resources/assets/unicopia/textures/item/rotten_salmon.png new file mode 100644 index 00000000..fc4d53c0 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/rotten_salmon.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/rotten_tropical_fish.png b/src/main/resources/assets/unicopia/textures/item/rotten_tropical_fish.png new file mode 100644 index 00000000..7c035402 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/rotten_tropical_fish.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/scone.png b/src/main/resources/assets/unicopia/textures/item/scone.png new file mode 100644 index 00000000..20ab1ce0 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/scone.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/slime_pustule.png b/src/main/resources/assets/unicopia/textures/item/slime_pustule.png new file mode 100644 index 00000000..e3111b43 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/slime_pustule.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/white_bed_sheets.png b/src/main/resources/assets/unicopia/textures/item/white_bed_sheets.png new file mode 100644 index 00000000..daec608f Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/white_bed_sheets.png differ diff --git a/src/main/resources/assets/unicopia/textures/particle/footprint.png b/src/main/resources/assets/unicopia/textures/particle/footprint.png new file mode 100644 index 00000000..a0ea4822 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/particle/footprint.png differ diff --git a/src/main/resources/data/c/tags/blocks/concrete_powders.json b/src/main/resources/data/c/tags/blocks/concrete_powders.json deleted file mode 100644 index e3142856..00000000 --- a/src/main/resources/data/c/tags/blocks/concrete_powders.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:white_concrete_powder", - "minecraft:orange_concrete_powder", - "minecraft:magenta_concrete_powder", - "minecraft:light_blue_concrete_powder", - "minecraft:yellow_concrete_powder", - "minecraft:lime_concrete_powder", - "minecraft:pink_concrete_powder", - "minecraft:gray_concrete_powder", - "minecraft:light_gray_concrete_powder", - "minecraft:cyan_concrete_powder", - "minecraft:purple_concrete_powder", - "minecraft:blue_concrete_powder", - "minecraft:brown_concrete_powder", - "minecraft:green_concrete_powder", - "minecraft:red_concrete_powder", - "minecraft:black_concrete_powder" - ] -} diff --git a/src/main/resources/data/c/tags/blocks/glass_blocks.json b/src/main/resources/data/c/tags/blocks/glass_blocks.json deleted file mode 100644 index f55e9719..00000000 --- a/src/main/resources/data/c/tags/blocks/glass_blocks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:glass", - "minecraft:white_stained_glass", - "minecraft:orange_stained_glass", - "minecraft:magenta_stained_glass", - "minecraft:light_blue_stained_glass", - "minecraft:yellow_stained_glass", - "minecraft:lime_stained_glass", - "minecraft:pink_stained_glass", - "minecraft:gray_stained_glass", - "minecraft:light_gray_stained_glass", - "minecraft:cyan_stained_glass", - "minecraft:purple_stained_glass", - "minecraft:blue_stained_glass", - "minecraft:brown_stained_glass", - "minecraft:green_stained_glass", - "minecraft:red_stained_glass", - "minecraft:black_stained_glass", - { "id": "#c:glass", "required": false }, - { "id": "#c:glass_blocks", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/blocks/glass_panes.json b/src/main/resources/data/c/tags/blocks/glass_panes.json deleted file mode 100644 index ff9176f7..00000000 --- a/src/main/resources/data/c/tags/blocks/glass_panes.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:glass_pane", - "minecraft:white_stained_glass_pane", - "minecraft:orange_stained_glass_pane", - "minecraft:magenta_stained_glass_pane", - "minecraft:light_blue_stained_glass_pane", - "minecraft:yellow_stained_glass_pane", - "minecraft:lime_stained_glass_pane", - "minecraft:pink_stained_glass_pane", - "minecraft:gray_stained_glass_pane", - "minecraft:light_gray_stained_glass_pane", - "minecraft:cyan_stained_glass_pane", - "minecraft:purple_stained_glass_pane", - "minecraft:blue_stained_glass_pane", - "minecraft:brown_stained_glass_pane", - "minecraft:green_stained_glass_pane", - "minecraft:red_stained_glass_pane", - "minecraft:black_stained_glass_pane" - ] -} diff --git a/src/main/resources/data/c/tags/blocks/ores.json b/src/main/resources/data/c/tags/blocks/ores.json deleted file mode 100644 index 1a53e7a3..00000000 --- a/src/main/resources/data/c/tags/blocks/ores.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:coal_ore", - "minecraft:iron_ore", - "minecraft:gold_ore", - "minecraft:emerald_ore", - "minecraft:lapis_ore", - "minecraft:copper_ore", - "minecraft:diamond_ore", - "minecraft:nether_gold_ore", - "minecraft:nether_quartz_ore", - { "id": "#c:iron_ores", "required": false }, - { "id": "#c:gold_ores", "required": false }, - { "id": "#c:diamond_ores", "required": false }, - { "id": "#c:emerald_ores", "required": false }, - { "id": "#c:copper_ores", "required": false }, - { "id": "#c:quartz_ores", "required": false }, - { "id": "#c:lapis_ores", "required": false }, - { "id": "#c:aluminium_ores", "required": false }, - { "id": "#c:methyst_ores", "required": false }, - { "id": "#c:antimony_ores", "required": false }, - { "id": "#c:aquarium_ores", "required": false }, - { "id": "#c:asterite_ores", "required": false }, - { "id": "#c:banglum_ores", "required": false }, - { "id": "#c:bauxite_ores", "required": false }, - { "id": "#c:carmot_ores", "required": false }, - { "id": "#c:certus_quartz_ores", "required": false }, - { "id": "#c:cinnabar_ores", "required": false }, - { "id": "#c:cobalt_ores", "required": false }, - { "id": "#c:galaxium_ores", "required": false }, - { "id": "#c:galena_ores", "required": false }, - { "id": "#c:iridium_ores", "required": false }, - { "id": "#c:kyber_ores", "required": false }, - { "id": "#c:lunum_ores", "required": false }, - { "id": "#c:lutetium_ores", "required": false }, - { "id": "#c:menganese_ores", "required": false }, - { "id": "#c:metite_ores", "required": false }, - { "id": "#c:midas_gold_ores", "required": false }, - { "id": "#c:moon_lunum_ores", "required": false }, - { "id": "#c:mozanite_ores", "required": false }, - { "id": "#c:mythril_ores", "required": false }, - { "id": "#c:nickle_ores", "required": false }, - { "id": "#c:nikolite_ores", "required": false }, - { "id": "#c:orichalcum_ores", "required": false }, - { "id": "#c:osmium_ores", "required": false }, - { "id": "#c:palladium_ores", "required": false }, - { "id": "#c:peridot_ores", "required": false }, - { "id": "#c:platinum_ores", "required": false }, - { "id": "#c:plutonium_blocks", "required": false }, - { "id": "#c:prometheum_ores", "required": false }, - { "id": "#c:pyrite_ores", "required": false }, - { "id": "#c:quadrillium_ores", "required": false }, - { "id": "#c:ruby_ores", "required": false }, - { "id": "#c:runite_ores", "required": false }, - { "id": "#c:sapphire_ores", "required": false }, - { "id": "#c:sheldonite_ores", "required": false }, - { "id": "#c:silver_ores", "required": false }, - { "id": "#c:sodalite_ores", "required": false }, - { "id": "#c:sphalerite_ores", "required": false }, - { "id": "#c:starrite_ores", "required": false }, - { "id": "#c:stellum_ores", "required": false }, - { "id": "#c:stormyx_ores", "required": false }, - { "id": "#c:sulfur_ores", "required": false }, - { "id": "#c:tantalite_ores", "required": false }, - { "id": "#c:tin_ore", "required": false }, - { "id": "#c:tin_ores", "required": false }, - { "id": "#c:titanium_ores", "required": false }, - { "id": "#c:topaz_ores", "required": false }, - { "id": "#c:truesilver_ores", "required": false }, - { "id": "#c:tungsten_ores", "required": false }, - { "id": "#c:unobtainium_ores", "required": false }, - { "id": "#c:ur_ores", "required": false }, - { "id": "#c:uranium_ores", "required": false }, - { "id": "#c:vermiculite_ores", "required": false }, - { "id": "#c:zinc_ores", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/concrete.json b/src/main/resources/data/c/tags/items/concrete.json deleted file mode 100644 index c09d67ba..00000000 --- a/src/main/resources/data/c/tags/items/concrete.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:white_concrete", - "minecraft:orange_concrete", - "minecraft:magenta_concrete", - "minecraft:light_blue_concrete", - "minecraft:yellow_concrete", - "minecraft:lime_concrete", - "minecraft:pink_concrete", - "minecraft:gray_concrete", - "minecraft:light_gray_concrete", - "minecraft:cyan_concrete", - "minecraft:purple_concrete", - "minecraft:blue_concrete", - "minecraft:brown_concrete", - "minecraft:green_concrete", - "minecraft:red_concrete", - "minecraft:black_concrete" - ] -} diff --git a/src/main/resources/data/c/tags/items/concrete_powders.json b/src/main/resources/data/c/tags/items/concrete_powders.json deleted file mode 100644 index e3142856..00000000 --- a/src/main/resources/data/c/tags/items/concrete_powders.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:white_concrete_powder", - "minecraft:orange_concrete_powder", - "minecraft:magenta_concrete_powder", - "minecraft:light_blue_concrete_powder", - "minecraft:yellow_concrete_powder", - "minecraft:lime_concrete_powder", - "minecraft:pink_concrete_powder", - "minecraft:gray_concrete_powder", - "minecraft:light_gray_concrete_powder", - "minecraft:cyan_concrete_powder", - "minecraft:purple_concrete_powder", - "minecraft:blue_concrete_powder", - "minecraft:brown_concrete_powder", - "minecraft:green_concrete_powder", - "minecraft:red_concrete_powder", - "minecraft:black_concrete_powder" - ] -} diff --git a/src/main/resources/data/c/tags/items/cooked_insects.json b/src/main/resources/data/c/tags/items/cooked_insects.json deleted file mode 100644 index 1a241c36..00000000 --- a/src/main/resources/data/c/tags/items/cooked_insects.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:fermented_spider_eye", - { "id": "#c:cooked_insect", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/cooked_meats.json b/src/main/resources/data/c/tags/items/cooked_meats.json deleted file mode 100644 index 52b592bc..00000000 --- a/src/main/resources/data/c/tags/items/cooked_meats.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:cooked_porkchop", - "minecraft:cooked_beef", - "minecraft:cooked_mutton", - "minecraft:cooked_rabbit", - "minecraft:rabbit_stew", - "minecraft:cooked_chicken", - { "id": "#c:cooked_meat", "required": false }, - { "id": "#c:cooked_bacon", "required": false }, - { "id": "#c:cooked_beef", "required": false }, - { "id": "#c:cooked_chicken", "required": false }, - { "id": "#c:cooked_mutton", "required": false }, - { "id": "#c:cooked_pork", "required": false }, - { "id": "#c:fried_chickens", "required": false }, - { "id": "#c:hamburgers", "required": false }, - { "id": "#c:pork_and_beans", "required": false }, - { "id": "#c:pork_jerkies", "required": false }, - { "id": "#c:protein", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/coral_blocks.json b/src/main/resources/data/c/tags/items/coral_blocks.json deleted file mode 100644 index e907eedc..00000000 --- a/src/main/resources/data/c/tags/items/coral_blocks.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:tube_coral_block", - "minecraft:brain_coral_block", - "minecraft:bubble_coral_block", - "minecraft:fire_coral_block", - "minecraft:horn_coral_block" - ] -} diff --git a/src/main/resources/data/c/tags/items/coral_fans.json b/src/main/resources/data/c/tags/items/coral_fans.json deleted file mode 100644 index 531d24c9..00000000 --- a/src/main/resources/data/c/tags/items/coral_fans.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:tube_coral_fan", - "minecraft:brain_coral_fan", - "minecraft:bubble_coral_fan", - "minecraft:fire_coral_fan", - "minecraft:horn_coral_fan" - ] -} diff --git a/src/main/resources/data/c/tags/items/corals.json b/src/main/resources/data/c/tags/items/corals.json deleted file mode 100644 index cec1b08e..00000000 --- a/src/main/resources/data/c/tags/items/corals.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:tube_coral", - "minecraft:brain_coral", - "minecraft:bubble_coral", - "minecraft:fire_coral", - "minecraft:horn_coral" - ] -} diff --git a/src/main/resources/data/c/tags/items/foraging/edibles.json b/src/main/resources/data/c/tags/items/foraging/edibles.json deleted file mode 100644 index a0432ed7..00000000 --- a/src/main/resources/data/c/tags/items/foraging/edibles.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "replace": false, - "values": [ - { "id": "#c:mushrooms", "required": false }, - { "id": "#c:saplings", "required": false }, - { "id": "farmersdelight:sandy_shrub", "required": false }, - { "id": "farmersdelight:wild_cabbages", "required": false }, - { "id": "farmersdelight:wild_onions", "required": false }, - { "id": "farmersdelight:wild_carrots", "required": false }, - { "id": "farmersdelight:wild_beetroots", "required": false }, - { "id": "farmersdelight:wild_rice", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/foraging/edibles_filling.json b/src/main/resources/data/c/tags/items/foraging/edibles_filling.json deleted file mode 100644 index bc799386..00000000 --- a/src/main/resources/data/c/tags/items/foraging/edibles_filling.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - { "id": "farmersdelight:horse_feed", "required": false }, - { "id": "farmersdelight:rice_bale", "required": false }, - { "id": "farmersdelight:straw_bale", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/foraging/risky.json b/src/main/resources/data/c/tags/items/foraging/risky.json deleted file mode 100644 index aa54573a..00000000 --- a/src/main/resources/data/c/tags/items/foraging/risky.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - { "id": "#c:meads", "required": false }, - { "id": "farmersdelight:wild_tomatoes", "required": false }, - { "id": "farmersdelight:wild_potatoes", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/glazed_terracotta.json b/src/main/resources/data/c/tags/items/glazed_terracotta.json deleted file mode 100644 index 02b98848..00000000 --- a/src/main/resources/data/c/tags/items/glazed_terracotta.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:white_glazed_terracotta", - "minecraft:orange_glazed_terracotta", - "minecraft:magenta_glazed_terracotta", - "minecraft:light_blue_glazed_terracotta", - "minecraft:yellow_glazed_terracotta", - "minecraft:lime_glazed_terracotta", - "minecraft:pink_glazed_terracotta", - "minecraft:gray_glazed_terracotta", - "minecraft:light_gray_glazed_terracotta", - "minecraft:cyan_glazed_terracotta", - "minecraft:purple_glazed_terracotta", - "minecraft:blue_glazed_terracotta", - "minecraft:brown_glazed_terracotta", - "minecraft:green_glazed_terracotta", - "minecraft:red_glazed_terracotta", - "minecraft:black_glazed_terracotta" - ] -} diff --git a/src/main/resources/data/c/tags/items/love.json b/src/main/resources/data/c/tags/items/love.json deleted file mode 100644 index 213d70aa..00000000 --- a/src/main/resources/data/c/tags/items/love.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:love_bottle", - "unicopia:love_bucket", - "unicopia:love_mug" - ] -} diff --git a/src/main/resources/data/c/tags/items/raw_fish.json b/src/main/resources/data/c/tags/items/raw_fish.json deleted file mode 100644 index 902fad0f..00000000 --- a/src/main/resources/data/c/tags/items/raw_fish.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:pufferfish", - "minecraft:cod", - "minecraft:salmon", - "minecraft:tropical_fish", - { "id": "#c:mollusks", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/raw_insects.json b/src/main/resources/data/c/tags/items/raw_insects.json deleted file mode 100644 index 4a791552..00000000 --- a/src/main/resources/data/c/tags/items/raw_insects.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:spider_eye", - "unicopia:wheat_worms", - "unicopia:butterfly" - ] -} diff --git a/src/main/resources/data/c/tags/items/raw_meats.json b/src/main/resources/data/c/tags/items/raw_meats.json deleted file mode 100644 index 5333f1f8..00000000 --- a/src/main/resources/data/c/tags/items/raw_meats.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:porkchop", - "minecraft:beef", - "minecraft:mutton", - "minecraft:rabbit", - "minecraft:chicken", - { "id": "#c:raw_meat", "required": false }, - { "id": "#c:lemon_chickens", "required": false }, - { "id": "#c:raw_bacon", "required": false }, - { "id": "#c:raw_beef", "required": false }, - { "id": "#c:raw_chicken", "required": false }, - { "id": "#c:raw_mutton", "required": false }, - { "id": "#c:raw_pork", "required": false } - ] -} diff --git a/src/main/resources/data/c/tags/items/rocks.json b/src/main/resources/data/c/tags/items/rocks.json deleted file mode 100644 index 9ab866dd..00000000 --- a/src/main/resources/data/c/tags/items/rocks.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:rock" - ] -} diff --git a/src/main/resources/data/c/tags/items/rotten_meats.json b/src/main/resources/data/c/tags/items/rotten_meats.json deleted file mode 100644 index 3f3bc662..00000000 --- a/src/main/resources/data/c/tags/items/rotten_meats.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:rotten_flesh" - ] -} diff --git a/src/main/resources/data/c/tags/items/worms.json b/src/main/resources/data/c/tags/items/worms.json deleted file mode 100644 index 9c8b8692..00000000 --- a/src/main/resources/data/c/tags/items/worms.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:wheat_worms" - ] -} diff --git a/src/main/resources/data/minecraft/traits/blocks/overworld/conglomerate_materials_from_ground.json b/src/main/resources/data/minecraft/traits/blocks/overworld/conglomerate_materials_from_ground.json index a19e4901..200f8b3f 100644 --- a/src/main/resources/data/minecraft/traits/blocks/overworld/conglomerate_materials_from_ground.json +++ b/src/main/resources/data/minecraft/traits/blocks/overworld/conglomerate_materials_from_ground.json @@ -3,7 +3,7 @@ "traits": "earth:1 order:1 knowledge:4", "items": [ "#minecraft:terracotta", - "#c:concrete", - "#c:glazed_terracotta" + "#c:concretes", + "#c:glazed_terracottas" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/traits/items/overworld/edible_cooked_meat.json b/src/main/resources/data/minecraft/traits/items/overworld/edible_cooked_meat.json index e65442d1..8dd2afb5 100644 --- a/src/main/resources/data/minecraft/traits/items/overworld/edible_cooked_meat.json +++ b/src/main/resources/data/minecraft/traits/items/overworld/edible_cooked_meat.json @@ -2,8 +2,6 @@ "replace": false, "traits": "famine:-0.5 life:-1 knowledge:2", "items": [ - "#c:cooked_meats", - "#c:cooked_fish", "minecraft:fermented_spider_eye", "#unicopia:food_types/cooked_fish", "#unicopia:food_types/cooked_meat" diff --git a/src/main/resources/data/minecraft/traits/items/overworld/edible_raw_meat.json b/src/main/resources/data/minecraft/traits/items/overworld/edible_raw_meat.json index 07371361..19d29187 100644 --- a/src/main/resources/data/minecraft/traits/items/overworld/edible_raw_meat.json +++ b/src/main/resources/data/minecraft/traits/items/overworld/edible_raw_meat.json @@ -2,6 +2,6 @@ "replace": false, "traits": "blood:1 famine:-2", "items": [ - "#c:raw_meats" + "#c:raw_meat" ] } \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin.json deleted file mode 100644 index fba2676d..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:chiselled_chitin" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:chitin" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:chiselled_chitin" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_hull.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_hull.json deleted file mode 100644 index ed8d7a6e..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_hull.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:chiselled_chitin_hull" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:chiselled_chitin" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:chiselled_chitin_hull" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_slab.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_slab.json deleted file mode 100644 index f1e2b4e7..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_slab.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:chiselled_chitin_slab" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:chiselled_chitin" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:chiselled_chitin_slab" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_stairs.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_stairs.json deleted file mode 100644 index 9a08e521..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/chiselled_chitin_stairs.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:chiselled_chitin_stairs" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:chiselled_chitin" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:chiselled_chitin_stairs" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/chitin_spikes.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/chitin_spikes.json deleted file mode 100644 index 6379d4a9..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/chitin_spikes.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:chitin_spikes" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:chitin" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:chitin_spikes" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_brick_slab.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_brick_slab.json deleted file mode 100644 index 75101d52..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_brick_slab.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_brick_slab" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud_bricks" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_brick_slab" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_brick_stairs.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_brick_stairs.json deleted file mode 100644 index d7ca8f88..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_brick_stairs.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_brick_stairs" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud_bricks" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_brick_stairs" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_pillar.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_pillar.json deleted file mode 100644 index b5248c89..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_pillar.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_pillar" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_pillar" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_plank_slab.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_plank_slab.json deleted file mode 100644 index 19e93f24..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_plank_slab.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_plank_slab" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud_planks" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_plank_slab" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_plank_stairs.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_plank_stairs.json deleted file mode 100644 index 0d7a9c07..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_plank_stairs.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_plank_stairs" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud_planks" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_plank_stairs" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_planks.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_planks.json deleted file mode 100644 index 20658432..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_planks.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_planks" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_planks" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_slab.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_slab.json deleted file mode 100644 index 762518c1..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_slab.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_slab" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_slab" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_stairs.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_stairs.json deleted file mode 100644 index d484ad65..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/cloud_stairs.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_stairs" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_stairs" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud.json deleted file mode 100644 index 51f03735..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:dense_cloud" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:cloud" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:dense_cloud" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud_slab.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud_slab.json deleted file mode 100644 index 1ca251e5..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud_slab.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:dense_cloud_slab" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:dense_cloud" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:dense_cloud_slab" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud_stairs.json b/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud_stairs.json deleted file mode 100644 index aba8906a..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/blocks/dense_cloud_stairs.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:dense_cloud_stairs" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:dense_cloud" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:dense_cloud_stairs" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/cloud_lump.json b/src/main/resources/data/unicopia/advancements/recipes/cloud_lump.json deleted file mode 100644 index 39ec6b06..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/cloud_lump.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cloud_lump" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:cloud_jars" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cloud_lump" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/crystal_heart.json b/src/main/resources/data/unicopia/advancements/recipes/crystal_heart.json deleted file mode 100644 index 2ed03717..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/crystal_heart.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:crystal_heart" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:crystal_shard" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:crystal_heart" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/empty_jar.json b/src/main/resources/data/unicopia/advancements/recipes/empty_jar.json deleted file mode 100644 index 4911ca96..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/empty_jar.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:empty_jar" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:glass" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:empty_jar" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/apple_pie.json b/src/main/resources/data/unicopia/advancements/recipes/food/apple_pie.json deleted file mode 100644 index 7d6bf9d5..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/apple_pie.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:apple_pie" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:fresh_apples" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:apple_pie" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/apple_pie_from_slices.json b/src/main/resources/data/unicopia/advancements/recipes/food/apple_pie_from_slices.json deleted file mode 100644 index 9d4e91ea..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/apple_pie_from_slices.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:apple_pie_slice_to_apple_pie" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:apple_pie_slice" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:apple_pie_slice_to_apple_pie" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/burned_juice.json b/src/main/resources/data/unicopia/advancements/recipes/food/burned_juice.json deleted file mode 100644 index 49b46b08..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/burned_juice.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:burned_juice" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:juice" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:burned_juice" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/burned_toast.json b/src/main/resources/data/unicopia/advancements/recipes/food/burned_toast.json deleted file mode 100644 index 312159fe..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/burned_toast.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:burned_toast" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:toast" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:burned_toast" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/candied_apple.json b/src/main/resources/data/unicopia/advancements/recipes/food/candied_apple.json deleted file mode 100644 index c135476b..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/candied_apple.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:candied_apple" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:stick" ] }, - { "items": [ "minecraft:sugar" ] }, - { "tag": "unicopia:fresh_apples" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:candied_apple" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/cider.json b/src/main/resources/data/unicopia/advancements/recipes/food/cider.json deleted file mode 100644 index f11ac1be..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/cider.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:cider", - "unicopia:easy_cider" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:burned_juice" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:cider" - } - }, - "has_the_easy_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:easy_cider" - } - } - }, - "requirements": [ - [ "has_ingredients", "has_the_recipe", "has_the_easy_recipe" ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/hay_fries.json b/src/main/resources/data/unicopia/advancements/recipes/food/hay_fries.json deleted file mode 100644 index d22ae87a..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/hay_fries.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:hay_fries" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "unicopia:oats" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:hay_fries" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/horse_shoe_fries.json b/src/main/resources/data/unicopia/advancements/recipes/food/horse_shoe_fries.json deleted file mode 100644 index bdbfd011..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/horse_shoe_fries.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:horse_shoe_fries" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:baked_potato" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:horse_shoe_fries" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/jam_toast.json b/src/main/resources/data/unicopia/advancements/recipes/food/jam_toast.json deleted file mode 100644 index bec51648..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/jam_toast.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:jam_toast" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:toast" ] }, - { "items": [ "unicopia:zap_apple_jam_jar" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:jam_toast" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/juice.json b/src/main/resources/data/unicopia/advancements/recipes/food/juice.json deleted file mode 100644 index 9076bddc..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/juice.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:juice" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:fresh_apples" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:juice" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/muffin.json b/src/main/resources/data/unicopia/advancements/recipes/food/muffin.json deleted file mode 100644 index 12fc8008..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/muffin.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:muffin" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "minecraft:sugar", - "minecraft:egg", - "minecraft:potato", - "unicopia:juice", - "unicopia:wheat_worms" - ] - } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:muffin" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/oatmeal.json b/src/main/resources/data/unicopia/advancements/recipes/food/oatmeal.json deleted file mode 100644 index 1bcf0711..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/oatmeal.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:oatmeal" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:oats" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:oatmeal" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/rock_candy.json b/src/main/resources/data/unicopia/advancements/recipes/food/rock_candy.json deleted file mode 100644 index 6a633e0f..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/rock_candy.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:rock_candy" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:pebbles" ] }, - { "items": [ "minecraft:sugar" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:rock_candy" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/rock_stew.json b/src/main/resources/data/unicopia/advancements/recipes/food/rock_stew.json deleted file mode 100644 index 69621f28..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/rock_stew.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:rock_stew" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:rock" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:rock_stew" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/toast.json b/src/main/resources/data/unicopia/advancements/recipes/food/toast.json deleted file mode 100644 index 7548a5fc..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/toast.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:toast" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:bread" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:toast" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/zap_apple_jam_jar.json b/src/main/resources/data/unicopia/advancements/recipes/food/zap_apple_jam_jar.json deleted file mode 100644 index 7d3d9474..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/food/zap_apple_jam_jar.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:zap_apple_jam_jar" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:empty_jar" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:zap_apple_jam_jar" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/friendship_bracelet.json b/src/main/resources/data/unicopia/advancements/recipes/friendship_bracelet.json deleted file mode 100644 index 278fdaad..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/friendship_bracelet.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:friendship_bracelet" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:leather", "minecraft:string" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:friendship_bracelet" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/gemstone.json b/src/main/resources/data/unicopia/advancements/recipes/gemstone.json deleted file mode 100644 index b6fcf7b1..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/gemstone.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:gemstone" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:crystal_shard" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:gemstone" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/golden_feather.json b/src/main/resources/data/unicopia/advancements/recipes/golden_feather.json deleted file mode 100644 index 2878ae38..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/golden_feather.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:golden_feather", - "unicopia:pegasus_amulet" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:magic_feathers" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:golden_feather" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/golden_wing.json b/src/main/resources/data/unicopia/advancements/recipes/golden_wing.json deleted file mode 100644 index f35f7e46..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/golden_wing.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:golden_wing" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:golden_feather" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:golden_wing" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/meadowbrooks_staff.json b/src/main/resources/data/unicopia/advancements/recipes/meadowbrooks_staff.json deleted file mode 100644 index 26462f67..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/meadowbrooks_staff.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:meadowbrooks_staff" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "minecraft:stick" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:meadowbrooks_staff" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/mug.json b/src/main/resources/data/unicopia/advancements/recipes/mug.json deleted file mode 100644 index 0620cedf..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/mug.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:mug" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:stick" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:mug" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/pegasus_amulet.json b/src/main/resources/data/unicopia/advancements/recipes/pegasus_amulet.json deleted file mode 100644 index 8129b43e..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/pegasus_amulet.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:pegasus_amulet" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:golden_wing" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:pegasus_amulet" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/pineapple_crown.json b/src/main/resources/data/unicopia/advancements/recipes/pineapple_crown.json deleted file mode 100644 index 13904af1..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/pineapple_crown.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:pineapple_crown" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:pineapple" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:pineapple_crown" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/shelly.json b/src/main/resources/data/unicopia/advancements/recipes/shelly.json deleted file mode 100644 index 08119d10..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/shelly.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:shelly" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:clam_shell", "unicopia:rock_candy" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:shelly" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/spellbook.json b/src/main/resources/data/unicopia/advancements/recipes/spellbook.json deleted file mode 100644 index 7d4a3307..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/spellbook.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:spellbook" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:gemstone", "unicopia:botched_gem" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:spellbook" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/tools/diamond_polearm.json b/src/main/resources/data/unicopia/advancements/recipes/tools/diamond_polearm.json deleted file mode 100644 index 52794d3d..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/tools/diamond_polearm.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:diamond_polearm" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:diamond" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:diamond_polearm" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/tools/golden_polearm.json b/src/main/resources/data/unicopia/advancements/recipes/tools/golden_polearm.json deleted file mode 100644 index ab03c0bd..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/tools/golden_polearm.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:golden_polearm" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:gold_ingot" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:golden_polearm" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/tools/iron_polearm.json b/src/main/resources/data/unicopia/advancements/recipes/tools/iron_polearm.json deleted file mode 100644 index 4db161bd..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/tools/iron_polearm.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:iron_polearm" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:iron_ingot" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:iron_polearm" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/tools/netherite_polearm_smithing.json b/src/main/resources/data/unicopia/advancements/recipes/tools/netherite_polearm_smithing.json deleted file mode 100644 index 07d09b50..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/tools/netherite_polearm_smithing.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:netherite_polearm_smithing" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:netherite_ingot" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:netherite_polearm_smithing" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/tools/stone_polearm.json b/src/main/resources/data/unicopia/advancements/recipes/tools/stone_polearm.json deleted file mode 100644 index bd846770..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/tools/stone_polearm.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:stone_polearm" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "minecraft:stone_tool_materials" } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:stone_polearm" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/tools/wooden_polearm.json b/src/main/resources/data/unicopia/advancements/recipes/tools/wooden_polearm.json deleted file mode 100644 index fd9a8fd9..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/tools/wooden_polearm.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:wooden_polearm" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:stick" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:wooden_polearm" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/unicorn_amulet.json b/src/main/resources/data/unicopia/advancements/recipes/unicorn_amulet.json deleted file mode 100644 index a0de0620..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/unicorn_amulet.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:unicorn_amulet" - ] - }, - "criteria": { - "has_ingredients": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:broken_alicorn_amulet" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:broken_alicorn_amulet" - } - } - }, - "requirements": [ - [ - "has_ingredients", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/recipes/weather_vane.json b/src/main/resources/data/unicopia/advancements/recipes/weather_vane.json deleted file mode 100644 index 3b6f199a..00000000 --- a/src/main/resources/data/unicopia/advancements/recipes/weather_vane.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "unicopia:weather_vane" - ] - }, - "criteria": { - "has_iron": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:iron_nugget", "minecraft:iron_ingot" ] } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "unicopia:weather_vane" - } - } - }, - "requirements": [ - [ - "has_iron", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/unicopia/apple_route.json b/src/main/resources/data/unicopia/advancements/unicopia/apple_route.json deleted file mode 100644 index 1191a00d..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/apple_route.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/earth_route", - "display": { - "icon": { - "item": "unicopia:green_apple" - }, - "title": { - "translate": "advancements.unicopia.apple_route.title" - }, - "description": { - "translate": "advancements.unicopia.apple_route.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": true - }, - "criteria": { - "has_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "tag": "unicopia:apples" } - ] - } - } - }, - "requirements": [ - [ "has_apple" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/baked_bads.json b/src/main/resources/data/unicopia/advancements/unicopia/baked_bads.json deleted file mode 100644 index a71df331..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/baked_bads.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/earth_route", - "display": { - "icon": { - "item": "unicopia:muffin" - }, - "title": { - "translate": "advancements.unicopia.baked_bads.title" - }, - "description": { - "translate": "advancements.unicopia.baked_bads.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "throw_muffin": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:muffin" ] } - ] - } - } - }, - "requirements": [ - [ "throw_muffin" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/bat/cool_potato.json b/src/main/resources/data/unicopia/advancements/unicopia/bat/cool_potato.json deleted file mode 100644 index b320384b..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/bat/cool_potato.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/bat/praise_the_sun", - "display": { - "icon": { - "item": "unicopia:sunglasses" - }, - "title": { - "translate": "advancements.unicopia.cool_potato.title" - }, - "description": { - "translate": "advancements.unicopia.cool_potato.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "wear_shades": { - "trigger": "unicopia:custom", - "conditions": { - "event": "wear_shades" - } - } - }, - "requirements": [ - [ "wear_shades" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/bat/extra_spooky.json b/src/main/resources/data/unicopia/advancements/unicopia/bat/extra_spooky.json deleted file mode 100644 index 322c20d0..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/bat/extra_spooky.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/bat/screech_twenty_mobs", - "display": { - "icon": { - "item": "minecraft:brick" - }, - "title": { - "translate": "advancements.unicopia.extra_spooky.title" - }, - "description": { - "translate": "advancements.unicopia.extra_spooky.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "spook_extra_hard": { - "trigger": "unicopia:custom", - "conditions": { - "event": "super_scare_entity" - } - } - }, - "requirements": [ - [ "spook_extra_hard" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/bat/night_route.json b/src/main/resources/data/unicopia/advancements/unicopia/bat/night_route.json deleted file mode 100644 index 572b1896..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/bat/night_route.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/root", - "display": { - "icon": { - "item": "unicopia:bat_badge" - }, - "title": { - "translate": "advancements.unicopia.night_route.title" - }, - "description": { - "translate": "advancements.unicopia.night_route.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "be_bat": { - "trigger": "unicopia:player_change_race", - "conditions": { - "race": "bat" - } - } - }, - "requirements": [ - [ "be_bat" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/bat/praise_the_sun.json b/src/main/resources/data/unicopia/advancements/unicopia/bat/praise_the_sun.json deleted file mode 100644 index 6d0298ee..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/bat/praise_the_sun.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/bat/night_route", - "display": { - "icon": { - "item": "minecraft:light" - }, - "title": { - "translate": "advancements.unicopia.praise_the_sun.title" - }, - "description": { - "translate": "advancements.unicopia.praise_the_sun.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "look_into_sun": { - "trigger": "unicopia:custom", - "conditions": { - "event": "look_into_sun" - } - } - }, - "requirements": [ - [ "look_into_sun" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/bat/screech_self.json b/src/main/resources/data/unicopia/advancements/unicopia/bat/screech_self.json deleted file mode 100644 index a2d24129..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/bat/screech_self.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/bat/night_route", - "display": { - "icon": { - "item": "minecraft:black_candle" - }, - "title": { - "translate": "advancements.unicopia.screech_self.title" - }, - "description": { - "translate": "advancements.unicopia.screech_self.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "screech_self": { - "trigger": "unicopia:custom", - "conditions": { - "event": "screech_self" - } - } - }, - "requirements": [ - [ "screech_self" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/bat/screech_twenty_mobs.json b/src/main/resources/data/unicopia/advancements/unicopia/bat/screech_twenty_mobs.json deleted file mode 100644 index 3d50551c..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/bat/screech_twenty_mobs.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "unicopia:unicopia/bat/night_route", - "display": { - "icon": { - "item": "minecraft:black_candle" - }, - "title": { - "translate": "advancements.unicopia.screech_twenty_mobs.title" - }, - "description": { - "translate": "advancements.unicopia.screech_twenty_mobs.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "screech_twenty_mobs": { - "trigger": "unicopia:custom", - "conditions": { - "event": "screech_twenty_mobs", - "flying": true - } - } - }, - "requirements": [ - [ "screech_twenty_mobs" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/bat/sweet_sweet_revenge.json b/src/main/resources/data/unicopia/advancements/unicopia/bat/sweet_sweet_revenge.json deleted file mode 100644 index 66bbcd5f..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/bat/sweet_sweet_revenge.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "parent": "unicopia:unicopia/bat/praise_the_sun", - "display": { - "icon": { - "item": "minecraft:anvil" - }, - "title": { - "translate": "advancements.unicopia.sweet_sweet_revenge.title" - }, - "description": { - "translate": "advancements.unicopia.sweet_sweet_revenge.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "ding_sun": { - "trigger": "unicopia:send_dragon_breath", - "conditions": { - "item": { - "tag": "unicopia:is_delivered_aggressively" - }, - "recipient_name": "princess celestia", - "recipient_present": false, - "counter": "dings_on_celestias_head", - "race": { - "include": [ "unicopia:bat" ] - } - } - } - }, - "requirements": [ - [ "ding_sun" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/brew_cider.json b/src/main/resources/data/unicopia/advancements/unicopia/brew_cider.json deleted file mode 100644 index 2d81dfcf..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/brew_cider.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/burn_juice", - "display": { - "icon": { - "item": "unicopia:cider" - }, - "title": { - "translate": "advancements.unicopia.brew_cider.title" - }, - "description": { - "translate": "advancements.unicopia.brew_cider.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "has_cider": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:cider" ] } - ] - } - } - }, - "requirements": [ - [ "has_cider" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/burn_juice.json b/src/main/resources/data/unicopia/advancements/unicopia/burn_juice.json deleted file mode 100644 index 43ddb181..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/burn_juice.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/juice", - "display": { - "icon": { - "item": "unicopia:burned_juice" - }, - "title": { - "translate": "advancements.unicopia.burn_juice.title" - }, - "description": { - "translate": "advancements.unicopia.burn_juice.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "has_burned_juice": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:burned_juice" ] } - ] - } - } - }, - "requirements": [ - [ "has_burned_juice" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/burn_toast.json b/src/main/resources/data/unicopia/advancements/unicopia/burn_toast.json deleted file mode 100644 index 1a667430..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/burn_toast.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/toast", - "display": { - "icon": { - "item": "unicopia:burned_toast" - }, - "title": { - "translate": "advancements.unicopia.burn_toast.title" - }, - "description": { - "translate": "advancements.unicopia.burn_toast.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "has_burned_toast": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:burned_toast" ] } - ] - } - } - }, - "requirements": [ - [ "has_burned_toast" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/blasphemy.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/blasphemy.json deleted file mode 100644 index f3285cbd..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/blasphemy.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/earth_route", - "display": { - "icon": { - "item": "minecraft:anvil" - }, - "title": { - "translate": "advancements.unicopia.blasphemy.title" - }, - "description": { - "translate": "advancements.unicopia.blasphemy.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "ding_sun": { - "trigger": "unicopia:send_dragon_breath", - "conditions": { - "item": { - "tag": "unicopia:is_delivered_aggressively" - }, - "recipient_name": "princess celestia", - "recipient_present": false, - "counter": "dings_on_celestias_head", - "race": { - "exclude": [ "unicopia:bat" ] - } - } - } - }, - "requirements": [ - [ "ding_sun" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/born_on_a_rock_farm.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/born_on_a_rock_farm.json deleted file mode 100644 index 792cd712..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/born_on_a_rock_farm.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/earth_route", - "display": { - "icon": { - "item": "unicopia:rock" - }, - "title": { - "translate": "advancements.unicopia.born_on_a_rock_farm.title" - }, - "description": { - "translate": "advancements.unicopia.born_on_a_rock_farm.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_rock": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:rock" ] } - ] - } - } - }, - "requirements": [ - [ "has_rock" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/dead_ringer.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/dead_ringer.json deleted file mode 100644 index dc70d6e7..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/dead_ringer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/born_on_a_rock_farm", - "display": { - "icon": { - "item": "unicopia:iron_horse_shoe" - }, - "title": { - "translate": "advancements.unicopia.dead_ringer.title" - }, - "description": { - "translate": "advancements.unicopia.dead_ringer.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "killed_entity_with_horseshoe": { - "trigger": "minecraft:player_killed_entity", - "conditions": { - "killing_blow": { - "tags": [ - { - "id": "unicopia:from_horseshoes", - "expected": true - } - ] - } - } - } - }, - "requirements": [ - [ "killed_entity_with_horseshoe" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/earth_route.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/earth_route.json deleted file mode 100644 index c9adaf77..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/earth_route.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "parent": "unicopia:unicopia/root", - "display": { - "icon": { - "item": "unicopia:earth_badge" - }, - "title": { - "translate": "advancements.unicopia.earth_route.title" - }, - "description": { - "translate": "advancements.unicopia.earth_route.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "be_pony": { - "trigger": "unicopia:player_change_race", - "conditions": { - "race": "earth" - } - }, - "has_rock": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:rock" ] } - ] - } - } - }, - "requirements": [ - [ "be_pony", "has_rock" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/eat_pinecone.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/eat_pinecone.json deleted file mode 100644 index 43c1e8ee..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/eat_pinecone.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/earth_route", - "display": { - "icon": { - "item": "unicopia:pinecone" - }, - "title": { - "translate": "advancements.unicopia.eat_pinecone.title" - }, - "description": { - "translate": "advancements.unicopia.eat_pinecone.description" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "eat_pinecone": { - "trigger": "minecraft:consume_item", - "conditions": { - "item": { - "items": [ "unicopia:pinecone" ] - } - } - } - }, - "requirements": [ - [ "eat_pinecone" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/imported_oats.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/imported_oats.json deleted file mode 100644 index 8c58133d..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/imported_oats.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/earth_route", - "display": { - "icon": { - "item": "unicopia:imported_oats" - }, - "title": { - "translate": "advancements.unicopia.imported_oats.title" - }, - "description": { - "translate": "advancements.unicopia.imported_oats.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "send_oats": { - "trigger": "unicopia:send_dragon_breath", - "conditions": { - "item": { - "items": [ "unicopia:oats", "unicopia:imported_oats" ] - } - } - }, - "receive_oats": { - "trigger": "unicopia:send_dragon_breath", - "conditions": { - "item": { - "items": [ "unicopia:oats", "unicopia:imported_oats" ] - }, - "is_receiving_end": true - } - } - }, - "requirements": [ - [ "send_oats", "receive_oats" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/sticks_and_stones.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/sticks_and_stones.json deleted file mode 100644 index 083c3c04..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/sticks_and_stones.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/born_on_a_rock_farm", - "display": { - "icon": { - "item": "unicopia:rock" - }, - "title": { - "translate": "advancements.unicopia.sticks_and_stones.title" - }, - "description": { - "translate": "advancements.unicopia.sticks_and_stones.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "killed_entity_with_rock": { - "trigger": "minecraft:player_killed_entity", - "conditions": { - "killing_blow": { - "tags": [ - { - "id": "unicopia:from_rocks", - "expected": true - } - ] - } - } - } - }, - "requirements": [ - [ "killed_entity_with_rock" ] - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/thats_unusual.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/thats_unusual.json deleted file mode 100644 index 4ec3184e..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/thats_unusual.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/born_on_a_rock_farm", - "display": { - "icon": { - "item": "unicopia:weird_rock" - }, - "title": { - "translate": "advancements.unicopia.thats_unusual.title" - }, - "description": { - "translate": "advancements.unicopia.thats_unusual.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "has_rock": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:weird_rock" ] } - ] - } - } - }, - "requirements": [ - [ "has_rock" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/earth/travelling_in_style.json b/src/main/resources/data/unicopia/advancements/unicopia/earth/travelling_in_style.json deleted file mode 100644 index 5da55b06..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/earth/travelling_in_style.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/earth/earth_route", - "display": { - "icon": { - "item": "unicopia:imported_oats" - }, - "title": { - "translate": "advancements.unicopia.travelling_in_style.title" - }, - "description": { - "translate": "advancements.unicopia.travelling_in_style.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "ride_balloon": { - "trigger": "unicopia:custom", - "conditions": { - "event": "ride_balloon" - } - } - }, - "requirements": [ - [ "ride_balloon" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/eat_trick_apple.json b/src/main/resources/data/unicopia/advancements/unicopia/eat_trick_apple.json deleted file mode 100644 index 98a60749..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/eat_trick_apple.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/trick_apple", - "display": { - "icon": { - "item": "unicopia:zap_apple" - }, - "title": { - "translate": "advancements.unicopia.eat_trick_apple.title" - }, - "description": { - "translate": "advancements.unicopia.eat_trick_apple.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "eat_trick_apple": { - "trigger": "unicopia:custom", - "conditions": { - "event": "eat_trick_apple" - } - } - }, - "requirements": [ - [ "eat_trick_apple" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/experimental.json b/src/main/resources/data/unicopia/advancements/unicopia/enchanting/experimental.json deleted file mode 100644 index 5f6b8dcd..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/experimental.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "parent": "minecraft:story/enchant_item", - "display": { - "icon": { - "item": "minecraft:netherite_pickaxe" - }, - "title": { - "translate": "advancements.unicopia.experimental.title" - }, - "description": { - "translate": "advancements.unicopia.experimental.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "rewards": { - "experience": 120 - }, - "criteria": { - "enchant_with_consumption": { - "trigger": "minecraft:enchanted_item", - "conditions": { - "item": { - "enchantments": [ - { "enchantment": "unicopia:consumption" } - ] - } - } - } - }, - "requirements": [ - [ "enchant_with_consumption" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/hearts_stronger_than_horses.json b/src/main/resources/data/unicopia/advancements/unicopia/enchanting/hearts_stronger_than_horses.json deleted file mode 100644 index ceaf66b9..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/hearts_stronger_than_horses.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "parent": "minecraft:story/enchant_item", - "display": { - "icon": { - "item": "minecraft:golden_pickaxe" - }, - "title": { - "translate": "advancements.unicopia.hearts_stronger_than_horses.title" - }, - "description": { - "translate": "advancements.unicopia.hearts_stronger_than_horses.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "rewards": { - "experience": 120 - }, - "criteria": { - "enchant_with_heart_bound": { - "trigger": "minecraft:enchanted_item", - "conditions": { - "item": { - "enchantments": [ - { "enchantment": "unicopia:heart_bound" } - ] - } - } - } - }, - "requirements": [ - [ "enchant_with_heart_bound" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/soulmate.json b/src/main/resources/data/unicopia/advancements/unicopia/enchanting/soulmate.json deleted file mode 100644 index 18ef64c7..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/soulmate.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "unicopia:unicopia/enchanting/hearts_stronger_than_horses", - "display": { - "icon": { - "item": "minecraft:golden_apple" - }, - "title": { - "translate": "advancements.unicopia.soulmate.title" - }, - "description": { - "translate": "advancements.unicopia.soulmate.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "rewards": { - "experience": 1200 - }, - "criteria": { - "use_soulmate": { - "trigger": "unicopia:custom", - "conditions": { - "event": "use_soulmate" - } - } - }, - "requirements": [ - [ "use_soulmate" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/xp_miner.json b/src/main/resources/data/unicopia/advancements/unicopia/enchanting/xp_miner.json deleted file mode 100644 index ceec072b..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/enchanting/xp_miner.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "unicopia:unicopia/enchanting/experimental", - "display": { - "icon": { - "item": "minecraft:netherite_pickaxe" - }, - "title": { - "translate": "advancements.unicopia.xp_miner.title" - }, - "description": { - "translate": "advancements.unicopia.xp_miner.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "rewards": { - "experience": 1200 - }, - "criteria": { - "mine_xp": { - "trigger": "unicopia:custom", - "conditions": { - "event": "use_consumption" - } - } - }, - "requirements": [ - [ "mine_xp" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/feed_trick_apple.json b/src/main/resources/data/unicopia/advancements/unicopia/feed_trick_apple.json deleted file mode 100644 index 20d98e4e..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/feed_trick_apple.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/trick_apple", - "display": { - "icon": { - "item": "unicopia:zap_apple" - }, - "title": { - "translate": "advancements.unicopia.feed_trick_apple.title" - }, - "description": { - "translate": "advancements.unicopia.feed_trick_apple.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "eat_trick_apple": { - "trigger": "unicopia:custom", - "conditions": { - "event": "feed_trick_apple" - } - } - }, - "requirements": [ - [ "eat_trick_apple" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/gotcha.json b/src/main/resources/data/unicopia/advancements/unicopia/gotcha.json deleted file mode 100644 index 3c5b6708..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/gotcha.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "unicopia:unicopia/jar", - "display": { - "icon": { - "item": "unicopia:rain_cloud_jar" - }, - "title": { - "translate": "advancements.unicopia.gotcha.title" - }, - "description": { - "translate": "advancements.unicopia.gotcha.description" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "rewards": { - "experience": 55 - }, - "criteria": { - "has_the_jar": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:rain_cloud_jar" ] }, - { "items": [ "unicopia:storm_cloud_jar" ] } - ] - } - } - }, - "requirements": [ - [ "has_the_jar" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/jar.json b/src/main/resources/data/unicopia/advancements/unicopia/jar.json deleted file mode 100644 index 9e7d9158..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/jar.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/sky_route", - "display": { - "icon": { - "item": "unicopia:empty_jar" - }, - "title": { - "translate": "advancements.unicopia.jar.title" - }, - "description": { - "translate": "advancements.unicopia.jar.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_the_jar": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:empty_jar" ] } - ] - } - } - }, - "requirements": [ - [ "has_the_jar" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/juice.json b/src/main/resources/data/unicopia/advancements/unicopia/juice.json deleted file mode 100644 index ff380f21..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/juice.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/apple_route", - "display": { - "icon": { - "item": "unicopia:juice" - }, - "title": { - "translate": "advancements.unicopia.juice.title" - }, - "description": { - "translate": "advancements.unicopia.juice.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_juice": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:juice" ] } - ] - } - } - }, - "requirements": [ - [ "has_juice" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/lightning_bug.json b/src/main/resources/data/unicopia/advancements/unicopia/lightning_bug.json deleted file mode 100644 index f440b3fc..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/lightning_bug.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "parent": "unicopia:unicopia/mid_flight_interruption", - "display": { - "icon": { - "item": "unicopia:lightning_jar" - }, - "title": { - "translate": "advancements.unicopia.lightning_bug.title" - }, - "description": { - "translate": "advancements.unicopia.lightning_bug.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "rewards": { - "experience": 90 - }, - "criteria": { - "lightning_struck_player_1": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 1 - } - }, - "lightning_struck_player_2": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 2 - } - }, - "lightning_struck_player_3": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 3 - } - }, - "lightning_struck_player_4": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 4 - } - }, - "lightning_struck_player_5": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 5 - } - }, - "lightning_struck_player_6": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 6 - } - }, - "lightning_struck_player_7": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 7 - } - }, - "lightning_struck_player_8": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 8 - } - }, - "lightning_struck_player_9": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 9 - } - }, - "lightning_struck_player_10": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player", - "race": ["bat"], - "repeats": 10 - } - } - }, - "requirements": [ - [ "lightning_struck_player_1" ], - [ "lightning_struck_player_2" ], - [ "lightning_struck_player_3" ], - [ "lightning_struck_player_4" ], - [ "lightning_struck_player_5" ], - [ "lightning_struck_player_6" ], - [ "lightning_struck_player_7" ], - [ "lightning_struck_player_8" ], - [ "lightning_struck_player_9" ], - [ "lightning_struck_player_10" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/lucky.json b/src/main/resources/data/unicopia/advancements/unicopia/lucky.json deleted file mode 100644 index ba89a4ba..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/lucky.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/apple_route", - "display": { - "icon": { - "item": "unicopia:horse_shoe_fries" - }, - "title": { - "translate": "advancements.unicopia.lucky.title" - }, - "description": { - "translate": "advancements.unicopia.lucky.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_horse_shoe_fries": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:horse_shoe_fries" ] } - ] - } - } - }, - "requirements": [ - [ "has_horse_shoe_fries" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/mid_flight_interruption.json b/src/main/resources/data/unicopia/advancements/unicopia/mid_flight_interruption.json deleted file mode 100644 index 11eadf3a..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/mid_flight_interruption.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/sky_route", - "display": { - "icon": { - "item": "unicopia:pegasus_feather" - }, - "title": { - "translate": "advancements.unicopia.mid_flight_interruption.title" - }, - "description": { - "translate": "advancements.unicopia.mid_flight_interruption.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "lightning_strike": { - "trigger": "unicopia:custom", - "conditions": { - "event": "lightning_struck_player" - } - } - }, - "requirements": [ - [ "lightning_strike" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/deter_phantom.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/deter_phantom.json deleted file mode 100644 index a506144c..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/deter_phantom.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/sky_route", - "display": { - "icon": { - "item": "minecraft:phantom_membrane" - }, - "title": { - "translate": "advancements.unicopia.deter_phantom.title" - }, - "description": { - "translate": "advancements.unicopia.deter_phantom.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "the_thing": { - "trigger": "unicopia:custom", - "conditions": { - "event": "kill_phantom_while_flying" - } - } - }, - "requirements": [ - [ "the_thing" ] - ], - "rewards": { - "experience": 100 - } -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_1.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_1.json deleted file mode 100644 index f6003423..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_1.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/sky_route", - "display": { - "icon": { - "item": "unicopia:pegasus_feather" - }, - "title": { - "translate": "advancements.unicopia.molting_season_1.title" - }, - "description": { - "translate": "advancements.unicopia.molting_season_1.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "shed_feather": { - "trigger": "unicopia:custom", - "conditions": { - "event": "shed_feather" - } - } - }, - "requirements": [ - [ "shed_feather" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_2.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_2.json deleted file mode 100644 index 107577eb..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/molting_season_1", - "display": { - "icon": { - "item": "unicopia:pegasus_feather" - }, - "title": { - "translate": "advancements.unicopia.molting_season_2.title" - }, - "description": { - "translate": "advancements.unicopia.molting_season_2.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "shed_feather_5": { - "trigger": "unicopia:custom", - "conditions": { - "event": "shed_feather", - "repeats": 5 - } - } - }, - "requirements": [ - [ "shed_feather_5" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_3.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_3.json deleted file mode 100644 index 723c1e05..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_3.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/molting_season_2", - "display": { - "icon": { - "item": "unicopia:pegasus_feather" - }, - "title": { - "translate": "advancements.unicopia.molting_season_3.title" - }, - "description": { - "translate": "advancements.unicopia.molting_season_3.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "shed_feather_15": { - "trigger": "unicopia:custom", - "conditions": { - "event": "shed_feather", - "repeats": 15 - } - } - }, - "requirements": [ - [ "shed_feather_15" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/rainbow_crash.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/rainbow_crash.json deleted file mode 100644 index 2d46bd33..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/rainbow_crash.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/sky_route", - "display": { - "icon": { - "item": "minecraft:glass_pane" - }, - "title": { - "translate": "advancements.unicopia.rainbow_crash.title" - }, - "description": { - "translate": "advancements.unicopia.rainbow_crash.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "break_window": { - "trigger": "unicopia:custom", - "conditions": { - "event": "break_window" - } - } - }, - "requirements": [ - [ "break_window" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/second_wind.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/second_wind.json deleted file mode 100644 index 86417cee..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/second_wind.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/pegasus/sky_route", - "display": { - "icon": { - "item": "unicopia:pegasus_badge" - }, - "title": { - "translate": "advancements.unicopia.second_wind.title" - }, - "description": { - "translate": "advancements.unicopia.second_wind.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "fly_through_the_pain": { - "trigger": "unicopia:custom", - "conditions": { - "event": "second_wind" - } - } - }, - "requirements": [ - [ "fly_through_the_pain" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/sky_route.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/sky_route.json deleted file mode 100644 index d015e522..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/sky_route.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "unicopia:unicopia/root", - "display": { - "icon": { - "item": "unicopia:pegasus_badge" - }, - "title": { - "translate": "advancements.unicopia.sky_route.title" - }, - "description": { - "translate": "advancements.unicopia.sky_route.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "be_birb": { - "trigger": "unicopia:player_change_race", - "conditions": { - "race": "pegasus" - } - } - }, - "requirements": [ - [ "be_birb" ] - ], - "rewards": { - "experience": 100 - } -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/root.json b/src/main/resources/data/unicopia/advancements/unicopia/root.json deleted file mode 100644 index f554b338..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/root.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "display": { - "icon": { - "item": "unicopia:alicorn_badge" - }, - "title": { - "translate": "advancements.unicopia.root.title" - }, - "description": { - "translate": "advancements.unicopia.root.description" - }, - "frame": "task", - "show_toast": false, - "announce_to_chat": false, - "hidden": false, - "background": "minecraft:textures/gui/advancements/backgrounds/stone.png" - }, - "criteria": { - "crafting_table": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "item": "minecraft:crafting_table" } - ] - } - } - }, - "requirements": [ - [ "crafting_table" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/sweet_apple_acres.json b/src/main/resources/data/unicopia/advancements/unicopia/sweet_apple_acres.json deleted file mode 100644 index 6be80c2c..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/sweet_apple_acres.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "parent": "unicopia:unicopia/apple_route", - "display": { - "icon": { - "item": "unicopia:sweet_apple" - }, - "title": { - "translate": "advancements.unicopia.sweet_apple_acres.title" - }, - "description": { - "translate": "advancements.unicopia.sweet_apple_acres.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "rewards": { - "experience": 120 - }, - "criteria": { - "red_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:apple" ] } - ] - } - }, - "green_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:green_apple" ] } - ] - } - }, - "sweet_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:sweet_apple" ] } - ] - } - }, - "sour_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:sour_apple" ] } - ] - } - }, - "rotten_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:rotten_apple" ] } - ] - } - }, - "zap_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:zap_apple" ] } - ] - } - }, - "cooked_zap_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:cooked_zap_apple" ] } - ] - } - }, - "golden_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "minecraft:golden_apple" ] } - ] - } - } - }, - "requirements": [ - [ "red_apple" ], - [ "green_apple" ], - [ "sweet_apple" ], - [ "sour_apple" ], - [ "rotten_apple" ], - [ "zap_apple" ], - [ "cooked_zap_apple" ], - [ "golden_apple" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/toast.json b/src/main/resources/data/unicopia/advancements/unicopia/toast.json deleted file mode 100644 index 35500103..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/toast.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/apple_route", - "display": { - "icon": { - "item": "unicopia:toast" - }, - "title": { - "translate": "advancements.unicopia.toast.title" - }, - "description": { - "translate": "advancements.unicopia.toast.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_toast": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:toast" ] } - ] - } - } - }, - "requirements": [ - [ "has_toast" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/trick_apple.json b/src/main/resources/data/unicopia/advancements/unicopia/trick_apple.json deleted file mode 100644 index 3cb00e0b..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/trick_apple.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/apple_route", - "display": { - "icon": { - "item": "minecraft:enchanted_golden_apple" - }, - "title": { - "translate": "advancements.unicopia.trick_apple.title" - }, - "description": { - "translate": "advancements.unicopia.trick_apple.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false - }, - "criteria": { - "has_apple": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:zap_apple" ] } - ] - } - } - }, - "requirements": [ - [ "has_apple" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/a_falling_wizard.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/a_falling_wizard.json deleted file mode 100644 index bb6eada4..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/a_falling_wizard.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/magical_route", - "display": { - "icon": { - "item": "unicopia:pegasus_amulet" - }, - "title": { - "translate": "advancements.unicopia.a_falling_wizard.title" - }, - "description": { - "translate": "advancements.unicopia.a_falling_wizard.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "teleport_above_world": { - "trigger": "unicopia:custom", - "conditions": { - "event": "teleport_above_world" - } - } - }, - "requirements": [ - [ "teleport_above_world" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/ascension.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/ascension.json deleted file mode 100644 index 243f2e51..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/ascension.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/save_the_day", - "display": { - "icon": { - "item": "unicopia:unicorn_amulet" - }, - "title": { - "translate": "advancements.unicopia.ascension.title" - }, - "description": { - "translate": "advancements.unicopia.ascension.description" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "obtain_the_thing": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:unicorn_amulet" ] } - ] - } - } - }, - "requirements": [ - [ "obtain_the_thing" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/books.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/books.json deleted file mode 100644 index 9265ea81..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/books.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/magical_route", - "display": { - "icon": { - "item": "unicopia:spellbook" - }, - "title": { - "translate": "advancements.unicopia.books.title" - }, - "description": { - "translate": "advancements.unicopia.books.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_book": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:spellbook" ] } - ] - } - } - }, - "requirements": [ - [ "has_book" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/crystaline.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/crystaline.json deleted file mode 100644 index 083b3c0d..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/crystaline.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/books", - "display": { - "icon": { - "item": "unicopia:crystal_shard" - }, - "title": { - "translate": "advancements.unicopia.crystaline.title" - }, - "description": { - "translate": "advancements.unicopia.crystaline.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_shard": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:crystal_shard" ] } - ] - } - } - }, - "requirements": [ - [ "has_shard" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/doctor_sombrero.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/doctor_sombrero.json deleted file mode 100644 index 27f88d72..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/doctor_sombrero.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/save_the_day", - "display": { - "icon": { - "item": "unicopia:broken_alicorn_amulet" - }, - "title": { - "translate": "advancements.unicopia.doctor_sombrero.title" - }, - "description": { - "translate": "advancements.unicopia.doctor_sombrero.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "defeat_sombra": { - "trigger": "unicopia:custom", - "conditions": { - "event": "defeat_sombra", - "repeats": 2 - } - } - }, - "requirements": [ - [ "defeat_sombra" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/hello_darkness_my_old_friend.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/hello_darkness_my_old_friend.json deleted file mode 100644 index 3a6b55d3..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/hello_darkness_my_old_friend.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/tempted", - "display": { - "icon": { - "item": "unicopia:alicorn_amulet" - }, - "title": { - "translate": "advancements.unicopia.hello_darkness_my_old_friend.title" - }, - "description": { - "translate": "advancements.unicopia.hello_darkness_my_old_friend.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "light_altar": { - "trigger": "unicopia:custom", - "conditions": { - "event": "light_altar" - } - } - }, - "requirements": [ - [ "light_altar" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/magical_route.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/magical_route.json deleted file mode 100644 index cfa84eaf..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/magical_route.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "unicopia:unicopia/root", - "display": { - "icon": { - "item": "unicopia:unicorn_badge" - }, - "title": { - "translate": "advancements.unicopia.magical_route.title" - }, - "description": { - "translate": "advancements.unicopia.magical_route.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "be_horned": { - "trigger": "unicopia:player_change_race", - "conditions": { - "race": "unicorn" - } - }, - "be_alihorned": { - "trigger": "unicopia:player_change_race", - "conditions": { - "race": "alicorn" - } - } - }, - "requirements": [ - [ "be_horned", "be_alihorned" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/power_up_heart.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/power_up_heart.json deleted file mode 100644 index 6356e60e..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/power_up_heart.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/crystaline", - "display": { - "icon": { - "item": "unicopia:crystal_heart" - }, - "title": { - "translate": "advancements.unicopia.power_up_heart.title" - }, - "description": { - "translate": "advancements.unicopia.power_up_heart.description" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "power_up_heart": { - "trigger": "unicopia:custom", - "conditions": { - "event": "power_up_heart" - } - } - }, - "requirements": [ - [ "power_up_heart" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/save_the_day.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/save_the_day.json deleted file mode 100644 index eb47d02e..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/save_the_day.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/hello_darkness_my_old_friend", - "display": { - "icon": { - "item": "unicopia:broken_alicorn_amulet" - }, - "title": { - "translate": "advancements.unicopia.save_the_day.title" - }, - "description": { - "translate": "advancements.unicopia.save_the_day.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "defeat_sombra": { - "trigger": "unicopia:custom", - "conditions": { - "event": "defeat_sombra" - } - } - }, - "requirements": [ - [ "defeat_sombra" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/split_the_sea.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/split_the_sea.json deleted file mode 100644 index b2a69db4..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/split_the_sea.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/books", - "display": { - "icon": { - "item": "minecraft:water_bucket" - }, - "title": { - "translate": "advancements.unicopia.split_the_sea.title" - }, - "description": { - "translate": "advancements.unicopia.split_the_sea.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "split_sea": { - "trigger": "unicopia:custom", - "conditions": { - "event": "split_sea" - } - } - }, - "requirements": [ - [ "split_sea" ] - ] -} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/tempted.json b/src/main/resources/data/unicopia/advancements/unicopia/unicorn/tempted.json deleted file mode 100644 index fdb951f1..00000000 --- a/src/main/resources/data/unicopia/advancements/unicopia/unicorn/tempted.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parent": "unicopia:unicopia/unicorn/books", - "display": { - "icon": { - "item": "unicopia:alicorn_amulet" - }, - "title": { - "translate": "advancements.unicopia.tempted.title" - }, - "description": { - "translate": "advancements.unicopia.tempted.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "has_amulet": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { "items": [ "unicopia:alicorn_amulet" ] } - ] - } - } - }, - "requirements": [ - [ "has_amulet" ] - ] -} diff --git a/src/main/resources/data/unicopia/diets/food_effects/baked_goods.json b/src/main/resources/data/unicopia/diets/food_effects/baked_goods.json deleted file mode 100644 index 31306e54..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/baked_goods.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tags": [ "unicopia:food_types/baked_goods" ], - "food_component": { - "hunger": 1, - "saturation": 1 - }, - "ailment": { - "effects": [ - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/candy.json b/src/main/resources/data/unicopia/diets/food_effects/candy.json deleted file mode 100644 index a7d7d64b..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/candy.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tags": [ "unicopia:food_types/candy" ], - "food_component": { - "hunger": 1, - "saturation": 1 - }, - "ailment": { - "effects": [ - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/desserts.json b/src/main/resources/data/unicopia/diets/food_effects/desserts.json deleted file mode 100644 index 63913e02..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/desserts.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tags": [ "unicopia:food_types/desserts" ], - "food_component": { - "hunger": 1, - "saturation": 1 - }, - "ailment": { - "effects": [ - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/fish/cooked.json b/src/main/resources/data/unicopia/diets/food_effects/fish/cooked.json deleted file mode 100644 index 423e578f..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/fish/cooked.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "tags": [ "unicopia:food_types/cooked_fish" ], - "food_component": { - "hunger": 1, - "saturation": 0.1 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/fish/raw.json b/src/main/resources/data/unicopia/diets/food_effects/fish/raw.json deleted file mode 100644 index 40368a26..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/fish/raw.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "tags": [ "unicopia:food_types/raw_fish" ], - "food_component": { - "hunger": 1, - "saturation": 0.1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:poison", - "seconds": 45, - "amplifier": 2, - "chance": 80 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/fish/rotten.json b/src/main/resources/data/unicopia/diets/food_effects/fish/rotten.json deleted file mode 100644 index 4259828b..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/fish/rotten.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "tags": [ "unicopia:food_types/rotten_fish" ], - "food_component": { - "hunger": 1, - "saturation": 0.1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:poison", - "seconds": 45, - "amplifier": 2, - "chance": 80 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 400, - "amplifier": 3, - "chance": 5 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/blinding.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/blinding.json deleted file mode 100644 index ca392e74..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/blinding.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_blinding" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:blindness", - "seconds": 30, - "amplifier": 0 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/dangerous.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/dangerous.json deleted file mode 100644 index 372abede..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/dangerous.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_dangerous" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 250, - "amplifier": 2, - "chance": 4 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/edible.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/edible.json deleted file mode 100644 index 33887410..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/edible.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_edible" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/edible_filling.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/edible_filling.json deleted file mode 100644 index b6721b3f..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/edible_filling.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_edible_filling" ], - "food_component": { - "hunger": 18, - "saturation": 9 - }, - "ailment": { - "effects": [] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/leafy_greens.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/leafy_greens.json deleted file mode 100644 index 0c81ee64..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/leafy_greens.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "tags": [ "minecraft:leaves" ], - "food_component": { - "hunger": 2, - "saturation": 1.5 - }, - "ailment": { - "effects": [] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/moderate.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/moderate.json deleted file mode 100644 index 4d7a238a..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/moderate.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_moderate" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2, - "chance": 40 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/nauseating.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/nauseating.json deleted file mode 100644 index e79628a0..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/nauseating.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_nauseating" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:weakness", - "seconds": 200, - "amplifier": 1, - "chance": 30 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/prickly.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/prickly.json deleted file mode 100644 index d3c61180..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/prickly.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_prickly" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:instant_damage", - "seconds": 1, - "amplifier": 0, - "chance": 30 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/radioactive.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/radioactive.json deleted file mode 100644 index 7a023788..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/radioactive.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_radioactive" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:glowing", - "seconds": 15, - "amplifier": 0, - "chance": 30 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/risky.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/risky.json deleted file mode 100644 index 9ee5d1dc..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/risky.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_risky" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2, - "chance": 80 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/severely_nauseating.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/severely_nauseating.json deleted file mode 100644 index 7f4ef36e..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/severely_nauseating.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_severely_nauseating" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:weakness", - "seconds": 200, - "amplifier": 1 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/severely_prickly.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/severely_prickly.json deleted file mode 100644 index 3b5a1cd6..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/severely_prickly.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_severely_prickly" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:instant_damage", - "seconds": 1, - "amplifier": 0 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/foraging/strengthening.json b/src/main/resources/data/unicopia/diets/food_effects/foraging/strengthening.json deleted file mode 100644 index 11477833..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/foraging/strengthening.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "tags": [ "unicopia:food_types/forage_strengthening" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:strength", - "seconds": 30, - "amplifier": 0 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2, - "chance": 10 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/fruit.json b/src/main/resources/data/unicopia/diets/food_effects/fruit.json deleted file mode 100644 index 20793232..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/fruit.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tags": [ "unicopia:food_types/fruit" ], - "food_component": { - "hunger": 1, - "saturation": 1 - }, - "ailment": { - "effects": [ - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/insect/cooked.json b/src/main/resources/data/unicopia/diets/food_effects/insect/cooked.json deleted file mode 100644 index 9dbdc566..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/insect/cooked.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "tags": [ "unicopia:food_types/cooked_insect" ], - "food_component": { - "hunger": 1, - "saturation": 0.1 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/insect/raw.json b/src/main/resources/data/unicopia/diets/food_effects/insect/raw.json deleted file mode 100644 index 8683f240..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/insect/raw.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "tags": [ "unicopia:food_types/raw_insect" ], - "food_component": { - "hunger": 1, - "saturation": 0.1 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/meat/cooked.json b/src/main/resources/data/unicopia/diets/food_effects/meat/cooked.json deleted file mode 100644 index 80b1e542..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/meat/cooked.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "tags": [ "unicopia:food_types/cooked_meat" ], - "food_component": { - "hunger": 12, - "saturation": 1.2 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/meat/raw.json b/src/main/resources/data/unicopia/diets/food_effects/meat/raw.json deleted file mode 100644 index f2c547d9..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/meat/raw.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "tags": [ "unicopia:food_types/raw_meat" ], - "food_component": { - "hunger": 1, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:poison", - "seconds": 45, - "amplifier": 2, - "chance": 80 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2, - "chance": 5 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/meat/rotten.json b/src/main/resources/data/unicopia/diets/food_effects/meat/rotten.json deleted file mode 100644 index 72faee0e..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/meat/rotten.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "tags": [ "unicopia:food_types/rotten_meat" ], - "food_component": { - "hunger": 1, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "effect": "minecraft:poison", - "seconds": 45, - "amplifier": 2, - "chance": 80 - }, - { - "effect": "unicopia:food_poisoning", - "seconds": 400, - "amplifier": 3, - "chance": 5 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/nuts_and_seeds.json b/src/main/resources/data/unicopia/diets/food_effects/nuts_and_seeds.json deleted file mode 100644 index 30f205a2..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/nuts_and_seeds.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tags": [ "unicopia:food_types/nuts_and_seeds" ], - "food_component": { - "hunger": 2, - "saturation": 2.5 - }, - "ailment": { - "effects": [ - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/pinecone.json b/src/main/resources/data/unicopia/diets/food_effects/pinecone.json deleted file mode 100644 index 75f92718..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/pinecone.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "tags": [ "unicopia:food_types/pinecone" ], - "food_component": { - "hunger": 1, - "saturation": 0.1 - }, - "ailment": { - "effects": [ - { - "type": "unicopia:healing", - "health": 1 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/food_effects/rocks.json b/src/main/resources/data/unicopia/diets/food_effects/rocks.json deleted file mode 100644 index ebe7b986..00000000 --- a/src/main/resources/data/unicopia/diets/food_effects/rocks.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "tags": [ "unicopia:food_types/rocks" ], - "food_component": { - "hunger": 1, - "saturation": 0.1 - }, - "ailment": { - "effects": [] - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/diets/races/alicorn.json b/src/main/resources/data/unicopia/diets/races/alicorn.json deleted file mode 100644 index caf175c1..00000000 --- a/src/main/resources/data/unicopia/diets/races/alicorn.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "default_multiplier": 1.4, - "foraging_multiplier": 0.9, - "multipliers": [ - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "hunger": 1.5, - "saturation": 1.5 - }, - { - "tags": [ "unicopia:food_types/raw_fish" ], - "hunger": 0.5, - "saturation": 0.6 - }, - { - "tags": [ - "unicopia:food_types/baked_goods" - ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ - "unicopia:food_types/cooked_insect", - "unicopia:food_types/cooked_meat" - ], - "hunger": 0.1, - "saturation": 0.1 - }, - { - "tags": [ - "unicopia:food_types/love", - "unicopia:food_types/raw_insect", - "unicopia:food_types/raw_meat", - "unicopia:food_types/rotten_meat" - ], - "hunger": 0, - "saturation": 0 - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "hunger": 0.9, - "saturation": 0.9 - } - ], - "effects": [ - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/raw_fish" ], - "ailment": { - "effects": [ ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/bat.json b/src/main/resources/data/unicopia/diets/races/bat.json deleted file mode 100644 index 283a8788..00000000 --- a/src/main/resources/data/unicopia/diets/races/bat.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "default_multiplier": 0.6, - "foraging_multiplier": 0.9, - "multipliers": [ - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "hunger": 0.75, - "saturation": 0.75 - }, - { - "tags": [ "unicopia:food_types/raw_fish" ], - "hunger": 0.5, - "saturation": 0.6 - }, - { - "tags": [ "unicopia:food_types/cooked_insect" ], - "hunger": 1.75, - "saturation": 1.75 - }, - { - "tags": [ "unicopia:food_types/cooked_meat" ], - "hunger": 1.15, - "saturation": 1.15 - }, - { - "tags": [ "unicopia:food_types/raw_insect" ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ "unicopia:food_types/raw_meat" ], - "hunger": 0.25, - "saturation": 0.25 - }, - { - "tags": [ "unicopia:food_types/rotten_meat" ], - "hunger": 0.2, - "saturation": 0.2 - }, - { - "tags": [ "unicopia:food_types/love" ], - "hunger": 0, - "saturation": 0 - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "hunger": 0.9, - "saturation": 0.9 - } - ], - "effects": [ - { - "tags": [ "unicopia:food_types/rotten_fish" ], - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2, - "chance": 5 - } - ] - } - }, - { - "tags": [ - "unicopia:food_types/cooked_insect", - "unicopia:food_types/cooked_meat" - ], - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/raw_insect" ], - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 50, - "amplifier": 1 - } - ] - } - }, - { - "tags": [ - "unicopia:food_types/raw_meat", - "unicopia:food_types/rotten_meat" - ], - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2, - "chance": 5 - } - ] - } - }, - { - "tags": [ "unicopia:food_types/bat_ponys_delight" ], - "ailment": { - "effects": [ - { - "effect": "minecraft:health_boost", - "seconds": { "min": 30, "max": 60 }, - "amplifier": { "min": 2, "max": 6 } - }, - { - "effect": "minecraft:jump_boost", - "seconds": { "min": 30, "max": 60 }, - "amplifier": { "min": 1, "max": 6 } - }, - { - "effect": "minecraft:health_boost", - "seconds": 30, - "amplifier": { "min": 1, "max": 6 } - }, - { - "effect": "minecraft:regeneration", - "seconds": { "min": 3, "max": 30 }, - "amplifier": { "min": 3, "max": 6 } - } - ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/changeling.json b/src/main/resources/data/unicopia/diets/races/changeling.json deleted file mode 100644 index d728f503..00000000 --- a/src/main/resources/data/unicopia/diets/races/changeling.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "default_multiplier": 0.15, - "foraging_multiplier": 0, - "multipliers": [ - { - "tags": [ "unicopia:food_types/cooked_insect" ], - "hunger": 0.3, - "saturation": 0.3 - }, - { - "tags": [ "unicopia:food_types/cooked_meat" ], - "hunger": 0.1, - "saturation": 0.1 - }, - { - "tags": [ "unicopia:food_types/raw_insect" ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ "unicopia:food_types/raw_meat" ], - "hunger": 0.25, - "saturation": 0.25 - }, - { - "tags": [ "unicopia:food_types/rotten_meat" ], - "hunger": 0.6, - "saturation": 0.6 - }, - { - "tags": [ - "unicopia:food_types/baked_goods" - ], - "hunger": 0.5, - "saturation": 0.9 - }, - { - "tags": [ "unicopia:food_types/love" ], - "hunger": 1, - "saturation": 1 - } - ], - "default_effects": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - }, - { - "effect": "minecraft:weakness", - "seconds": 200, - "amplifier": 1 - }, - { - "type": "unicopia:lose_hunger", - "multiplier": 0.5 - } - ] - }, - "effects": [ - { - "tags": [ "unicopia:food_types/love" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ - { - "name": "Love Consumption", - "type": "unicopia:cure_love_sickness" - } - ] - } - }, - { - "tags": [ - "unicopia:food_types/cooked_fish", - "unicopia:food_types/raw_fish" - ], - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 50, - "amplifier": 2 - }, - { - "name": "unicopia.affliction.love_sickness", - "type": "unicopia:lose_hunger", - "multiplier": 0.5 - } - ] - } - }, - { - "tags": [ - "unicopia:food_types/rotten_fish", - "unicopia:food_types/cooked_insect", - "unicopia:food_types/raw_insect", - "unicopia:food_types/cooked_meat", - "unicopia:food_types/raw_meat", - "unicopia:food_types/rotten_meat" - ], - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ - "unicopia:food_types/forage_edible", - "unicopia:food_types/forage_edible_filling" - ], - "food_component": { - "hunger": 18, - "saturation": 9 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - }, - { - "effect": "minecraft:weakness", - "seconds": 200, - "amplifier": 1 - }, - { - "type": "unicopia:lose_hunger", - "multiplier": 0.5 - } - ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/earth.json b/src/main/resources/data/unicopia/diets/races/earth.json deleted file mode 100644 index e06a0fd5..00000000 --- a/src/main/resources/data/unicopia/diets/races/earth.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "default_multiplier": 0.7, - "foraging_multiplier": 1, - "multipliers": [ - { - "tags": [ - "unicopia:food_types/candy", - "unicopia:food_types/desserts", - "unicopia:food_types/rocks" - ], - "hunger": 2.5, - "saturation": 1.7 - }, - { - "tags": [ - "unicopia:food_types/baked_goods" - ], - "hunger": 1.2, - "saturation": 2 - }, - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "hunger": 0.2, - "saturation": 0.2 - }, - { - "tags": [ - "unicopia:food_types/cooked_insect", - "unicopia:food_types/cooked_meat" - ], - "hunger": 0.1, - "saturation": 0.1 - }, - { - "tags": [ - "unicopia:food_types/love", - "unicopia:food_types/raw_fish", - "unicopia:food_types/raw_insect", - "unicopia:food_types/raw_meat", - "unicopia:food_types/rotten_meat" - ], - "hunger": 0, - "saturation": 0 - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "hunger": 1, - "saturation": 1 - } - ], - "effects": [ - { - "tags": [ - "unicopia:food_types/candy", - "unicopia:food_types/rocks" - ], - "food_component": { - "hunger": 5, - "saturation": 12, - "fastFood": true - }, - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ - "unicopia:food_types/desserts" - ], - "food_component": { - "hunger": 12, - "saturation": 32, - "eatenQuickly": true, - "fastFood": true - }, - "ailment": { - "effects": [ ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/hippogriff.json b/src/main/resources/data/unicopia/diets/races/hippogriff.json deleted file mode 100644 index c91d791e..00000000 --- a/src/main/resources/data/unicopia/diets/races/hippogriff.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "default_multiplier": 0.5, - "foraging_multiplier": 0.8, - "multipliers": [ - { - "tags": [ - "unicopia:food_types/cooked_meat", - "unicopia:food_types/cooked_fish" - ], - "hunger": 1.6, - "saturation": 1.6 - }, - { - "tags": [ - "unicopia:food_types/nuts_and_seeds" - ], - "hunger": 1.4, - "saturation": 1.4 - }, - { - "tags": [ - "unicopia:food_types/baked_goods" - ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ - "unicopia:food_types/raw_meat", - "unicopia:food_types/raw_fish" - ], - "hunger": 0.6, - "saturation": 0.6 - }, - { - "tags": [ "unicopia:food_types/rotten_meat" ], - "hunger": 0.3, - "saturation": 0.3 - }, - { - "tags": [ - "unicopia:food_types/love", - "unicopia:food_types/raw_insect", - "unicopia:food_types/cooked_insect" - ], - "hunger": 0, - "saturation": 0 - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "hunger": 1, - "saturation": 1 - } - ], - "effects": [ - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/raw_fish" ], - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ - "unicopia:food_types/forage_prickly", - "unicopia:food_types/forage_severely_prickly" - ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "ailment": { - "effects": [ - { - "type": "unicopia:healing", - "health": 3 - } - ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/human.json b/src/main/resources/data/unicopia/diets/races/human.json deleted file mode 100644 index ddf024b3..00000000 --- a/src/main/resources/data/unicopia/diets/races/human.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "default_multiplier": 1, - "foraging_multiplier": 0, - "multipliers": [ ], - "effects": [ - { - "tags": [ - "unicopia:food_types/cooked_fish", - "unicopia:food_types/raw_fish", - "unicopia:food_types/rotten_fish", - "unicopia:food_types/cooked_meat", - "unicopia:food_types/raw_meat", - "unicopia:food_types/rotten_meat", - "unicopia:food_types/pinecone" - ], - "ailment": { - "effects": [ ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/kirin.json b/src/main/resources/data/unicopia/diets/races/kirin.json deleted file mode 100644 index 42b41a67..00000000 --- a/src/main/resources/data/unicopia/diets/races/kirin.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "default_multiplier": 0.25, - "foraging_multiplier": 0.9, - "multipliers": [ - { - "tags": [ "unicopia:food_types/cooked_meat" ], - "hunger": 1.5, - "saturation": 1.5 - }, - { - "tags": [ "unicopia:food_types/raw_meat" ], - "hunger": 0.5, - "saturation": 0.6 - }, - { - "tags": [ - "unicopia:food_types/baked_goods" - ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ - "unicopia:food_types/cooked_insect", - "unicopia:food_types/cooked_fish" - ], - "hunger": 0.1, - "saturation": 0.1 - }, - { - "tags": [ - "unicopia:food_types/love", - "unicopia:food_types/raw_insect", - "unicopia:food_types/raw_fish", - "unicopia:food_types/rotten_meat" - ], - "hunger": 0, - "saturation": 0 - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "hunger": 0.9, - "saturation": 0.9 - } - ], - "effects": [ - { - "tags": [ - "unicopia:food_types/rotten_fish", - "unicopia:food_types/cooked_insect", - "unicopia:food_types/cooked_meat", - "unicopia:food_types/raw_meat", - "unicopia:food_types/rotten_meat", - "unicopia:food_types/forage_blinding", - "unicopia:food_types/forage_prickly", - "unicopia:food_types/forage_severely_prickly", - "unicopia:food_types/forage_strengthening" - ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/pegasus.json b/src/main/resources/data/unicopia/diets/races/pegasus.json deleted file mode 100644 index d1208202..00000000 --- a/src/main/resources/data/unicopia/diets/races/pegasus.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "default_multiplier": 0.9, - "foraging_multiplier": 1, - "multipliers": [ - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "hunger": 1.5, - "saturation": 1.5 - }, - { - "tags": [ "unicopia:food_types/raw_fish" ], - "hunger": 0.5, - "saturation": 0.6 - }, - { - "tags": [ - "unicopia:food_types/baked_goods" - ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ - "unicopia:food_types/cooked_insect", - "unicopia:food_types/cooked_meat" - ], - "hunger": 0.1, - "saturation": 0.1 - }, - { - "tags": [ - "unicopia:food_types/love", - "unicopia:food_types/raw_insect", - "unicopia:food_types/raw_meat", - "unicopia:food_types/rotten_meat" - ], - "hunger": 0, - "saturation": 0 - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "hunger": 0.9, - "saturation": 0.9 - } - ], - "effects": [ - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/raw_fish" ], - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 50, - "amplifier": 2 - } - ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/seapony.json b/src/main/resources/data/unicopia/diets/races/seapony.json deleted file mode 100644 index 6558338a..00000000 --- a/src/main/resources/data/unicopia/diets/races/seapony.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "default_multiplier": 0.4, - "foraging_multiplier": 0.7, - "multipliers": [ - { - "tags": [ "unicopia:food_types/raw_sea_vegitable" ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ - "unicopia:food_types/shells", - "unicopia:food_types/shelly" - ], - "hunger": 1, - "saturation": 1 - } - ], - "default_effects": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - }, - "effects": [ - { - "tags": [ "unicopia:food_types/cooked_fish" ], - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/raw_fish" ], - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ - "unicopia:food_types/forage_edible", - "unicopia:food_types/forage_edible_filling" - ], - "food_component": { - "hunger": 18, - "saturation": 9 - }, - "ailment": { - "effects": [ - { - "effect": "unicopia:food_poisoning", - "seconds": 100, - "amplifier": 2 - } - ] - } - }, - { - "tags": [ "unicopia:food_types/raw_sea_vegitable" ], - "food_component": { - "hunger": 2, - "saturation": 1 - }, - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/cooked_sea_vegitable" ], - "food_component": { - "hunger": 6, - "saturation": 2 - }, - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/shells" ], - "food_component": { - "hunger": 3, - "saturation": 5 - }, - "ailment": { - "effects": [ ] - } - }, - { - "tags": [ "unicopia:food_types/shelly" ], - "food_component": { - "hunger": 6, - "saturation": 7 - }, - "ailment": { - "effects": [ ] - } - } - ] -} diff --git a/src/main/resources/data/unicopia/diets/races/unicorn.json b/src/main/resources/data/unicopia/diets/races/unicorn.json deleted file mode 100644 index be679a08..00000000 --- a/src/main/resources/data/unicopia/diets/races/unicorn.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "default_multiplier": 1.2, - "foraging_multiplier": 1, - "multipliers": [ - { - "tags": [ - "unicopia:food_types/cooked_insect", - "unicopia:food_types/cooked_meat", - "unicopia:food_types/cooked_fish" - ], - "hunger": 0.1, - "saturation": 0.1 - }, - { - "tags": [ - "unicopia:food_types/baked_goods" - ], - "hunger": 1, - "saturation": 1 - }, - { - "tags": [ - "unicopia:food_types/love", - "unicopia:food_types/raw_insect", - "unicopia:food_types/raw_meat", - "unicopia:food_types/raw_fish", - "unicopia:food_types/rotten_meat" - ], - "hunger": 0, - "saturation": 0 - }, - { - "tags": [ "unicopia:food_types/pinecone" ], - "hunger": 0.9, - "saturation": 0.9 - } - ], - "effects": [] -} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/apple_pie.json b/src/main/resources/data/unicopia/loot_tables/blocks/apple_pie.json deleted file mode 100644 index 21a0eb14..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/apple_pie.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "type": "minecraft:block", - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:all_of", - "terms": [ - { - "block": "unicopia:apple_pie", - "condition": "minecraft:block_state_property", - "properties": { - "stomped": "true" - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:apple_pie_hoof" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/bananas.json b/src/main/resources/data/unicopia/loot_tables/blocks/bananas.json deleted file mode 100644 index 7e5ce591..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/bananas.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "add": false, - "count": { - "type": "minecraft:uniform", - "max": 12.0, - "min": 6.0 - }, - "function": "minecraft:set_count" - }, - { - "enchantment": "minecraft:fortune", - "formula": "minecraft:binomial_with_bonus_count", - "function": "minecraft:apply_bonus", - "parameters": { - "extra": 3, - "probability": 0.5714286 - } - } - ], - "name": "unicopia:banana" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/chiselled_chitin_hull.json b/src/main/resources/data/unicopia/loot_tables/blocks/chiselled_chitin_hull.json deleted file mode 100644 index 5af0f74d..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/chiselled_chitin_hull.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:chitin", - "functions": [ - { - "add": false, - "count": 2, - "function": "minecraft:set_count" - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - }, - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:chiselled_chitin", - "functions": [ - { - "add": false, - "count": 2, - "function": "minecraft:set_count" - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/clam_shell.json b/src/main/resources/data/unicopia/loot_tables/blocks/clam_shell.json deleted file mode 100644 index f21c580e..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/clam_shell.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:clam_shell", - "conditions": [ - { - "block": "unicopia:clam_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "1" - } - } - ], - "functions": [ - { - "add": false, - "count": 1, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:clam_shell", - "conditions": [ - { - "block": "unicopia:clam_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "2" - } - } - ], - "functions": [ - { - "add": false, - "count": 2, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:clam_shell", - "conditions": [ - { - "block": "unicopia:clam_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "3" - } - } - ], - "functions": [ - { - "add": false, - "count": 3, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:clam_shell", - "conditions": [ - { - "block": "unicopia:clam_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "4" - } - } - ], - "functions": [ - { - "add": false, - "count": 4, - "function": "minecraft:set_count" - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/cloud_slab.json b/src/main/resources/data/unicopia/loot_tables/blocks/cloud_slab.json deleted file mode 100644 index 6926e7fe..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/cloud_slab.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:cloud_lump", - "functions": [ - { - "add": false, - "count": 2, - "function": "minecraft:set_count" - }, - { - "add": false, - "count": 4, - "function": "minecraft:set_count", - "conditions": [ - { - "block": "unicopia:cloud_slab", - "condition": "minecraft:block_state_property", - "properties": { - "type": "double" - } - } - ] - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/dense_cloud_slab.json b/src/main/resources/data/unicopia/loot_tables/blocks/dense_cloud_slab.json deleted file mode 100644 index e9d1f0e2..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/dense_cloud_slab.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:cloud_lump", - "functions": [ - { - "add": false, - "count": 4, - "function": "minecraft:set_count" - }, - { - "add": false, - "count": 8, - "function": "minecraft:set_count", - "conditions": [ - { - "block": "unicopia:dense_cloud_slab", - "condition": "minecraft:block_state_property", - "properties": { - "type": "double" - } - } - ] - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/etched_cloud_slab.json b/src/main/resources/data/unicopia/loot_tables/blocks/etched_cloud_slab.json deleted file mode 100644 index 4465e094..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/etched_cloud_slab.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:cloud_lump", - "functions": [ - { - "add": false, - "count": 4, - "function": "minecraft:set_count" - }, - { - "add": false, - "count": 8, - "function": "minecraft:set_count", - "conditions": [ - { - "block": "unicopia:etched_cloud_slab", - "condition": "minecraft:block_state_property", - "properties": { - "type": "double" - } - } - ] - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/gold_root.json b/src/main/resources/data/unicopia/loot_tables/blocks/gold_root.json deleted file mode 100644 index 6bfe9e77..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/gold_root.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "minecraft:block", - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:golden_carrot" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:gold_root", - "condition": "minecraft:block_state_property", - "properties": { - "age": "7" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "enchantment": "minecraft:fortune", - "formula": "minecraft:binomial_with_bonus_count", - "function": "minecraft:apply_bonus", - "parameters": { - "extra": 3, - "probability": 0.5714286 - } - } - ], - "name": "minecraft:golden_carrot" - } - ], - "rolls": 1.0 - } - ], - "random_sequence": "minecraft:blocks/carrots" -} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/golden_apple.json b/src/main/resources/data/unicopia/loot_tables/blocks/golden_apple.json deleted file mode 100644 index 7bd87a25..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/golden_apple.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:golden_apple" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - }, - { - "block": "unicopia:golden_apple", - "condition": "minecraft:block_state_property", - "properties": { - "enchanted": "false" - } - } - ] - }, - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:enchanted_golden_apple" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - }, - { - "block": "unicopia:golden_apple", - "condition": "minecraft:block_state_property", - "properties": { - "enchanted": "true" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/hay_block.json b/src/main/resources/data/unicopia/loot_tables/blocks/hay_block.json deleted file mode 100644 index 1101857f..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/hay_block.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_north_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_north_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_south_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_south_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_north_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_north_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_south_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:hay_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_south_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:wheat" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/mysterious_egg.json b/src/main/resources/data/unicopia/loot_tables/blocks/mysterious_egg.json deleted file mode 100644 index 915f5152..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/mysterious_egg.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:mysterious_egg", - "functions": [ - { - "add": false, - "count": 1, - "function": "minecraft:set_count", - "conditions": [ - { - "block": "unicopia:mysterious_egg", - "condition": "minecraft:block_state_property", - "properties": { - "count": "1" - } - } - ] - }, - { - "add": false, - "count": 2, - "function": "minecraft:set_count", - "conditions": [ - { - "block": "unicopia:mysterious_egg", - "condition": "minecraft:block_state_property", - "properties": { - "count": "2" - } - } - ] - }, - { - "add": false, - "count": 3, - "function": "minecraft:set_count", - "conditions": [ - { - "block": "unicopia:mysterious_egg", - "condition": "minecraft:block_state_property", - "properties": { - "count": "3" - } - } - ] - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/oats.json b/src/main/resources/data/unicopia/loot_tables/blocks/oats.json deleted file mode 100644 index 17b0d17a..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/oats.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "type": "minecraft:block", - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "name": "unicopia:oat_seeds" - } - ] - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:oats", - "condition": "minecraft:block_state_property", - "properties": { - "age": "11" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "enchantment": "minecraft:fortune", - "formula": "minecraft:binomial_with_bonus_count", - "function": "minecraft:apply_bonus", - "parameters": { - "extra": 3, - "probability": 0.5714286 - } - } - ], - "name": "unicopia:oat_seeds" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/oats_crown.json b/src/main/resources/data/unicopia/loot_tables/blocks/oats_crown.json deleted file mode 100644 index fe5807ed..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/oats_crown.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:block", - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "block": "unicopia:oats_crown", - "condition": "minecraft:block_state_property", - "properties": { - "age": "1" - } - } - ], - "name": "unicopia:oats" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/oats_stem.json b/src/main/resources/data/unicopia/loot_tables/blocks/oats_stem.json deleted file mode 100644 index 72ea00c4..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/oats_stem.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:block", - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "block": "unicopia:oats_stem", - "condition": "minecraft:block_state_property", - "properties": { - "age": "6" - } - } - ], - "name": "unicopia:oats" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/pineapple.json b/src/main/resources/data/unicopia/loot_tables/blocks/pineapple.json deleted file mode 100644 index aced6181..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/pineapple.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "unicopia:pineapple", - "properties": { - "age": "7", - "half": "top" - } - } - ], - "name": "unicopia:pineapple" - } - ] - } - ] - } - ], - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/plunder_vine.json b/src/main/resources/data/unicopia/loot_tables/blocks/plunder_vine.json deleted file mode 100644 index 857d1f4c..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/plunder_vine.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "type": "minecraft:block", - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:stick" - }, - { - "type": "minecraft:item", - "name": "minecraft:dead_bush" - } - ], - "rolls": 4.0 - }, - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:stick" - }, - { - "type": "minecraft:item", - "name": "minecraft:dead_bush" - }, - { - "type": "minecraft:item", - "name": "unicopia:gryphon_feather" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/rice_block.json b/src/main/resources/data/unicopia/loot_tables/blocks/rice_block.json deleted file mode 100644 index e79c51d7..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/rice_block.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "type": "minecraft:block", - "fabric:load_conditions": [ - { - "condition": "fabric:all_mods_loaded", - "values": [ - "farmersdelight" - ] - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_north_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_north_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_south_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_south_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_north_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_north_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_south_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:rice_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_south_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:rice_panicle" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/rocks.json b/src/main/resources/data/unicopia/loot_tables/blocks/rocks.json deleted file mode 100644 index 83eda199..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/rocks.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "unicopia:rocks", - "properties": { - "age": "7" - } - }, - { - "condition": "minecraft:random_chance", - "chance": 0.25 - } - ], - "name": "unicopia:weird_rock" - }, - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "unicopia:rocks", - "properties": { - "age": "7" - } - } - ], - "name": "unicopia:rock" - }, - { - "type": "minecraft:item", - "name": "unicopia:pebbles" - } - ] - } - ] - }, - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "function": "minecraft:apply_bonus", - "enchantment": "minecraft:fortune", - "formula": "minecraft:binomial_with_bonus_count", - "parameters": { - "extra": 3, - "probability": 0.5714286 - } - } - ], - "name": "unicopia:pebbles" - } - ], - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "unicopia:rocks", - "properties": { - "age": "7" - } - } - ] - } - ], - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/scallop_shell.json b/src/main/resources/data/unicopia/loot_tables/blocks/scallop_shell.json deleted file mode 100644 index c1e002b1..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/scallop_shell.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:scallop_shell", - "conditions": [ - { - "block": "unicopia:scallop_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "1" - } - } - ], - "functions": [ - { - "add": false, - "count": 1, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:scallop_shell", - "conditions": [ - { - "block": "unicopia:scallop_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "2" - } - } - ], - "functions": [ - { - "add": false, - "count": 2, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:scallop_shell", - "conditions": [ - { - "block": "unicopia:scallop_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "3" - } - } - ], - "functions": [ - { - "add": false, - "count": 3, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:scallop_shell", - "conditions": [ - { - "block": "unicopia:scallop_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "4" - } - } - ], - "functions": [ - { - "add": false, - "count": 4, - "function": "minecraft:set_count" - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/slime_pustule.json b/src/main/resources/data/unicopia/loot_tables/blocks/slime_pustule.json deleted file mode 100644 index 3945bf2f..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/slime_pustule.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:slime_pustule" - } - ], - "conditions": [ - { - "condition": "minecraft:all_of", - "terms": [ - { - "block": "unicopia:slime_pustule", - "condition": "minecraft:block_state_property", - "properties": { - "shape": "pod" - } - }, - { - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/soggy_cloud_slab.json b/src/main/resources/data/unicopia/loot_tables/blocks/soggy_cloud_slab.json deleted file mode 100644 index b805f097..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/soggy_cloud_slab.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:cloud", - "functions": [ - { - "add": false, - "count": 3, - "function": "minecraft:set_count" - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/straw_block.json b/src/main/resources/data/unicopia/loot_tables/blocks/straw_block.json deleted file mode 100644 index ca46ba50..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/straw_block.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "type": "minecraft:block", - "fabric:load_conditions": [ - { - "condition": "fabric:all_mods_loaded", - "values": [ - "farmersdelight" - ] - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_north_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_north_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_south_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "top_south_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_north_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_north_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_south_east": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "unicopia:straw_block", - "condition": "minecraft:block_state_property", - "properties": { - "bottom_south_west": "true" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "name": "farmersdelight:straw" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/turret_shell.json b/src/main/resources/data/unicopia/loot_tables/blocks/turret_shell.json deleted file mode 100644 index b300a2d4..00000000 --- a/src/main/resources/data/unicopia/loot_tables/blocks/turret_shell.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "unicopia:turret_shell", - "conditions": [ - { - "block": "unicopia:turret_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "1" - } - } - ], - "functions": [ - { - "add": false, - "count": 1, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:turret_shell", - "conditions": [ - { - "block": "unicopia:turret_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "2" - } - } - ], - "functions": [ - { - "add": false, - "count": 2, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:turret_shell", - "conditions": [ - { - "block": "unicopia:turret_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "3" - } - } - ], - "functions": [ - { - "add": false, - "count": 3, - "function": "minecraft:set_count" - } - ] - }, - { - "type": "minecraft:item", - "name": "unicopia:turret_shell", - "conditions": [ - { - "block": "unicopia:turret_shell", - "condition": "minecraft:block_state_property", - "properties": { - "count": "4" - } - } - ], - "functions": [ - { - "add": false, - "count": 4, - "function": "minecraft:set_count" - } - ] - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/chests/changeling_hive_trap.json b/src/main/resources/data/unicopia/loot_tables/chests/changeling_hive_trap.json deleted file mode 100644 index 2dac1a86..00000000 --- a/src/main/resources/data/unicopia/loot_tables/chests/changeling_hive_trap.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "type": "minecraft:chest", - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:short_morph_earth" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 3 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:short_morph_unicorn" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 1 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:short_morph_pegasus" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 1 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:short_morph_bat" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 1 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:short_morph_kirin" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 1 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:short_morph_hippogriff" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 1 - }, - - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:long_morph_earth" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 5 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:long_morph_unicorn" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 2 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:long_morph_pegasus" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 2 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:long_morph_bat" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 2 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:long_morph_kirin" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 2 - }, - { - "type": "minecraft:item", - "name": "minecraft:tipped_arrow", - "functions": [ - { "function": "minecraft:set_potion", "id": "unicopia:long_morph_hippogriff" }, - { - "function": "minecraft:set_count", - "count": { - "min": 3.0, - "max": 9.0, - "type": "minecraft:uniform" - } - } - ], - "weight": 2 - } - ], - "rolls": 6.0 - } - ] -} diff --git a/src/main/resources/data/unicopia/loot_tables/entities/butterfly.json b/src/main/resources/data/unicopia/loot_tables/entities/butterfly.json deleted file mode 100644 index 9992d4bd..00000000 --- a/src/main/resources/data/unicopia/loot_tables/entities/butterfly.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "type": "minecraft:entity", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "function": "minecraft:looting_enchant", - "count": { - "type": "minecraft:uniform", - "min": 0.0, - "max": 1.0 - } - } - ], - "name": "unicopia:butterfly" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/entities/loot_bug.json b/src/main/resources/data/unicopia/loot_tables/entities/loot_bug.json deleted file mode 100644 index 7e8ec0ae..00000000 --- a/src/main/resources/data/unicopia/loot_tables/entities/loot_bug.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "type": "minecraft:entity", - "pools": [ - { - "rolls": 11, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "add": false, - "count": { - "type": "minecraft:uniform", - "max": 12.0, - "min": 6.0 - }, - "function": "minecraft:set_count" - }, - { - "function": "minecraft:looting_enchant", - "count": { - "type": "minecraft:uniform", - "min": 0.0, - "max": 3.0 - } - } - ], - "name": "minecraft:gold_nugget" - }, - { - "type": "minecraft:item", - "functions": [ - { - "add": false, - "count": { - "type": "minecraft:uniform", - "max": 12.0, - "min": 6.0 - }, - "function": "minecraft:set_count" - }, - { - "function": "minecraft:looting_enchant", - "count": { - "type": "minecraft:uniform", - "min": 0.0, - "max": 3.0 - } - } - ], - "name": "minecraft:iron_nugget" - } - ] - }, - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:tag", - "functions": [ - { - "add": false, - "count": { - "type": "minecraft:uniform", - "max": 3.0, - "min": 1.0 - }, - "function": "minecraft:set_count" - }, - { - "function": "minecraft:looting_enchant", - "count": { - "type": "minecraft:uniform", - "min": 0.0, - "max": 6.0 - } - } - ], - "name": "unicopia:loot_bug_high_value_drops", - "expand": true - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/entities/storm_cloud.json b/src/main/resources/data/unicopia/loot_tables/entities/storm_cloud.json deleted file mode 100644 index 8d599d1a..00000000 --- a/src/main/resources/data/unicopia/loot_tables/entities/storm_cloud.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "minecraft:entity", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "add": false, - "count": { - "type": "minecraft:uniform", - "max": 12.0, - "min": 6.0 - }, - "function": "minecraft:set_count" - }, - { - "function": "minecraft:looting_enchant", - "count": { - "type": "minecraft:uniform", - "min": 0.0, - "max": 1.0 - } - } - ], - "name": "unicopia:cloud_lump" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/alicorn_amulet.json b/src/main/resources/data/unicopia/recipes/alicorn_amulet.json deleted file mode 100644 index 14db2133..00000000 --- a/src/main/resources/data/unicopia/recipes/alicorn_amulet.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { - "item": "unicopia:gemstone", - "spell": "unicopia:dark_vortex" - }, - "traits": { - "darkness": 30, "power": 30, "blood": 30 - }, - "ingredients": [], - "result": { - "item": "unicopia:alicorn_amulet" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/apple_pie.json b/src/main/resources/data/unicopia/recipes/apple_pie.json deleted file mode 100644 index 85f86ec6..00000000 --- a/src/main/resources/data/unicopia/recipes/apple_pie.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "***", - "###", - "***" - ], - "key": { - "#": { - "tag": "unicopia:fresh_apples" - }, - "*": { - "item": "minecraft:wheat" - } - }, - "result": { - "item": "unicopia:apple_pie" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/apple_pie_slice_to_apple_pie.json b/src/main/resources/data/unicopia/recipes/apple_pie_slice_to_apple_pie.json deleted file mode 100644 index e3a5c84b..00000000 --- a/src/main/resources/data/unicopia/recipes/apple_pie_slice_to_apple_pie.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:apple_pie_slice" }, - { "item": "unicopia:apple_pie_slice" }, - { "item": "unicopia:apple_pie_slice" }, - { "item": "unicopia:apple_pie_slice" } - ], - "result": { - "item": "unicopia:apple_pie" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/arrow.json b/src/main/resources/data/unicopia/recipes/arrow.json deleted file mode 100644 index d5339b04..00000000 --- a/src/main/resources/data/unicopia/recipes/arrow.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "X", - "#", - "Y" - ], - "key": { - "#": { - "item": "minecraft:stick" - }, - "X": { - "item": "minecraft:flint" - }, - "Y": { - "tag": "unicopia:magic_feathers" - } - }, - "result": { - "item": "minecraft:arrow", - "count": 4 - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/apple.json b/src/main/resources/data/unicopia/recipes/bed_sheets/apple.json deleted file mode 100644 index 59c07b8a..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/apple.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "#%#", - "% %", - " %#" - ], - "key": { - "#": { - "item": "minecraft:green_wool" - }, - "%": { - "item": "minecraft:lime_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:apple_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/bar.json b/src/main/resources/data/unicopia/recipes/bed_sheets/bar.json deleted file mode 100644 index c851297e..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/bar.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "#%#", - "% %", - " %#" - ], - "key": { - "#": { - "item": "minecraft:light_blue_wool" - }, - "%": { - "item": "minecraft:white_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:barred_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/black.json b/src/main/resources/data/unicopia/recipes/bed_sheets/black.json deleted file mode 100644 index 9bc645a0..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/black.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:black_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:black_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/blue.json b/src/main/resources/data/unicopia/recipes/bed_sheets/blue.json deleted file mode 100644 index a327c38e..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/blue.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:blue_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:blue_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/brown.json b/src/main/resources/data/unicopia/recipes/bed_sheets/brown.json deleted file mode 100644 index 873eee0a..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/brown.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:brown_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:brown_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/checker.json b/src/main/resources/data/unicopia/recipes/bed_sheets/checker.json deleted file mode 100644 index eb41d549..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/checker.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "#%#", - "% %", - " %#" - ], - "key": { - "#": { - "item": "minecraft:green_wool" - }, - "%": { - "item": "minecraft:brown_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:checkered_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/cyan.json b/src/main/resources/data/unicopia/recipes/bed_sheets/cyan.json deleted file mode 100644 index 55d27f39..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/cyan.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:cyan_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:cyan_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/gray.json b/src/main/resources/data/unicopia/recipes/bed_sheets/gray.json deleted file mode 100644 index c22908d1..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/gray.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:gray_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:gray_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/green.json b/src/main/resources/data/unicopia/recipes/bed_sheets/green.json deleted file mode 100644 index 44cefb48..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/green.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:green_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:green_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/kelp.json b/src/main/resources/data/unicopia/recipes/bed_sheets/kelp.json deleted file mode 100644 index 31590054..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/kelp.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:kelp" - } - }, - "result": { - "count": 1, - "item": "unicopia:kelp_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/light_blue.json b/src/main/resources/data/unicopia/recipes/bed_sheets/light_blue.json deleted file mode 100644 index 7da12483..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/light_blue.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:light_blue_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:light_blue_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/light_gray.json b/src/main/resources/data/unicopia/recipes/bed_sheets/light_gray.json deleted file mode 100644 index 2762e0a7..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/light_gray.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:light_gray_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:light_gray_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/lime.json b/src/main/resources/data/unicopia/recipes/bed_sheets/lime.json deleted file mode 100644 index 88734f2c..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/lime.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:lime_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:lime_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/magenta.json b/src/main/resources/data/unicopia/recipes/bed_sheets/magenta.json deleted file mode 100644 index eb70f444..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/magenta.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:magenta_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:magenta_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/orange.json b/src/main/resources/data/unicopia/recipes/bed_sheets/orange.json deleted file mode 100644 index 3fa98370..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/orange.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:orange_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:orange_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/pink.json b/src/main/resources/data/unicopia/recipes/bed_sheets/pink.json deleted file mode 100644 index 2d93ece3..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/pink.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:pink_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:pink_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/purple.json b/src/main/resources/data/unicopia/recipes/bed_sheets/purple.json deleted file mode 100644 index ab41e3ad..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/purple.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:purple_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:purple_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow.json b/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow.json deleted file mode 100644 index 16b2493b..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "ROY", - "L B", - " PG" - ], - "key": { - "Y": { - "item": "minecraft:yellow_wool" - }, - "O": { - "item": "minecraft:orange_wool" - }, - "R": { - "item": "minecraft:red_wool" - }, - "G": { - "item": "minecraft:green_wool" - }, - "B": { - "item": "minecraft:blue_wool" - }, - "P": { - "item": "minecraft:purple_wool" - }, - "L": { - "item": "minecraft:light_blue_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:rainbow_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_bpw.json b/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_bpw.json deleted file mode 100644 index 431b5bad..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_bpw.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "PWP", - "B B", - " WP" - ], - "key": { - "B": { - "item": "minecraft:light_blue_wool" - }, - "P": { - "item": "minecraft:pink_wool" - }, - "W": { - "item": "minecraft:white_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:rainbow_bpw_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_bpy.json b/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_bpy.json deleted file mode 100644 index f67eb380..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_bpy.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "PBP", - "Y Y", - " BP" - ], - "key": { - "P": { - "item": "minecraft:pink_wool" - }, - "B": { - "item": "minecraft:light_blue_wool" - }, - "Y": { - "item": "minecraft:yellow_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:rainbow_bpy_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_pgb.json b/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_pgb.json deleted file mode 100644 index 3e61b550..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_pgb.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "WGB", - "P G", - " PW" - ], - "key": { - "P": { - "item": "minecraft:purple_wool" - }, - "W": { - "item": "minecraft:white_wool" - }, - "G": { - "item": "minecraft:light_gray_wool" - }, - "B": { - "item": "minecraft:black_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:rainbow_pbg_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_pwr.json b/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_pwr.json deleted file mode 100644 index ba2c76df..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/rainbow_pwr.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "WRW", - "P P", - " RW" - ], - "key": { - "P": { - "item": "minecraft:pink_wool" - }, - "W": { - "item": "minecraft:white_wool" - }, - "R": { - "item": "minecraft:red_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:rainbow_pwr_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/red.json b/src/main/resources/data/unicopia/recipes/bed_sheets/red.json deleted file mode 100644 index ef489f95..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/red.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:red_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:red_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/bed_sheets/yellow.json b/src/main/resources/data/unicopia/recipes/bed_sheets/yellow.json deleted file mode 100644 index 84bdbe03..00000000 --- a/src/main/resources/data/unicopia/recipes/bed_sheets/yellow.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed_sheets", - "pattern": [ - "###", - "# #", - " ##" - ], - "key": { - "#": { - "item": "minecraft:yellow_wool" - } - }, - "result": { - "count": 1, - "item": "unicopia:yellow_bed_sheets" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/burned_juice.json b/src/main/resources/data/unicopia/recipes/burned_juice.json deleted file mode 100644 index 22ddf879..00000000 --- a/src/main/resources/data/unicopia/recipes/burned_juice.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "smelting", - "ingredient": { - "item": "unicopia:juice" - }, - "result": "unicopia:burned_juice", - "experience": 0, - "cookingtime": 100 -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/burned_juice_to_coal.json b/src/main/resources/data/unicopia/recipes/burned_juice_to_coal.json deleted file mode 100644 index 52f8062a..00000000 --- a/src/main/resources/data/unicopia/recipes/burned_juice_to_coal.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "smelting", - "ingredient": { - "item": "unicopia:burned_juice" - }, - "result": "minecraft:coal", - "experience": 1, - "cookingtime": 20 -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/burned_toast.json b/src/main/resources/data/unicopia/recipes/burned_toast.json deleted file mode 100644 index 341cb93e..00000000 --- a/src/main/resources/data/unicopia/recipes/burned_toast.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "smelting", - "ingredient": { - "item": "unicopia:toast" - }, - "result": "unicopia:burned_toast", - "experience": 0.2, - "cookingtime": 30 -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/candied_apple.json b/src/main/resources/data/unicopia/recipes/candied_apple.json deleted file mode 100644 index 0745ca43..00000000 --- a/src/main/resources/data/unicopia/recipes/candied_apple.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "minecraft:stick" }, - { "tag": "unicopia:fresh_apples" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" } - ], - "result": { "item": "unicopia:candied_apple" } -} diff --git a/src/main/resources/data/unicopia/recipes/carving/carved_cloud_cutting.json b/src/main/resources/data/unicopia/recipes/carving/carved_cloud_cutting.json deleted file mode 100644 index 4a933c98..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/carved_cloud_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud" }, - "result": "unicopia:carved_cloud", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_brick_slab_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_brick_slab_cutting.json deleted file mode 100644 index 80f2e283..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_brick_slab_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud_bricks" }, - "result": "unicopia:cloud_brick_slab", - "count": 2 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_brick_stairs_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_brick_stairs_cutting.json deleted file mode 100644 index 536622ad..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_brick_stairs_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud_bricks" }, - "result": "unicopia:cloud_brick_stairs", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_bricks_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_bricks_cutting.json deleted file mode 100644 index fde1cb89..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_bricks_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud" }, - "result": "unicopia:cloud_bricks", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_pillar_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_pillar_cutting.json deleted file mode 100644 index 1d60c72d..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_pillar_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud" }, - "result": "unicopia:cloud_pillar", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_plank_slab_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_plank_slab_cutting.json deleted file mode 100644 index 0ab285b9..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_plank_slab_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud_planks" }, - "result": "unicopia:cloud_plank_slab", - "count": 2 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_plank_stairs_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_plank_stairs_cutting.json deleted file mode 100644 index 77eed444..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_plank_stairs_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud_planks" }, - "result": "unicopia:cloud_plank_stairs", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_planks_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_planks_cutting.json deleted file mode 100644 index 97e40db7..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_planks_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud" }, - "result": "unicopia:cloud_planks", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_slab_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_slab_cutting.json deleted file mode 100644 index 03a75d8e..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_slab_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud" }, - "result": "unicopia:cloud_slab", - "count": 2 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/cloud_stairs_cutting.json b/src/main/resources/data/unicopia/recipes/carving/cloud_stairs_cutting.json deleted file mode 100644 index a43df56c..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/cloud_stairs_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:cloud" }, - "result": "unicopia:cloud_stairs", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/dense_cloud_slab_cutting.json b/src/main/resources/data/unicopia/recipes/carving/dense_cloud_slab_cutting.json deleted file mode 100644 index 45688bd5..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/dense_cloud_slab_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:dense_cloud" }, - "result": "unicopia:dense_cloud_slab", - "count": 2 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/dense_cloud_stairs_cutting.json b/src/main/resources/data/unicopia/recipes/carving/dense_cloud_stairs_cutting.json deleted file mode 100644 index 13b6e197..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/dense_cloud_stairs_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:dense_cloud" }, - "result": "unicopia:dense_cloud_stairs", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/etched_cloud_cutting.json b/src/main/resources/data/unicopia/recipes/carving/etched_cloud_cutting.json deleted file mode 100644 index 9f8b76ff..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/etched_cloud_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:dense_cloud" }, - "result": "unicopia:etched_cloud", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/etched_cloud_slab_cutting.json b/src/main/resources/data/unicopia/recipes/carving/etched_cloud_slab_cutting.json deleted file mode 100644 index 951b6f70..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/etched_cloud_slab_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:etched_cloud" }, - "result": "unicopia:etched_cloud_slab", - "count": 2 -} diff --git a/src/main/resources/data/unicopia/recipes/carving/etched_cloud_stairs_cutting.json b/src/main/resources/data/unicopia/recipes/carving/etched_cloud_stairs_cutting.json deleted file mode 100644 index 85ddf8e0..00000000 --- a/src/main/resources/data/unicopia/recipes/carving/etched_cloud_stairs_cutting.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "unicopia:cloud_shaping", - "ingredient": { "item": "unicopia:etched_cloud" }, - "result": "unicopia:etched_cloud_stairs", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/chiselled_chitin.json b/src/main/resources/data/unicopia/recipes/chiselled_chitin.json deleted file mode 100644 index 66888165..00000000 --- a/src/main/resources/data/unicopia/recipes/chiselled_chitin.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##" - ], - "key": { - "#": [ - { "item": "unicopia:chitin" } - ] - }, - "result": { "item": "unicopia:chiselled_chitin", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/chiselled_chitin_hull.json b/src/main/resources/data/unicopia/recipes/chiselled_chitin_hull.json deleted file mode 100644 index 30b4a65e..00000000 --- a/src/main/resources/data/unicopia/recipes/chiselled_chitin_hull.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "%%" - ], - "key": { - "#": [ - { "item": "unicopia:chiselled_chitin" } - ], - "%": [ - { "item": "unicopia:chitin" } - ] - }, - "result": { "item": "unicopia:chiselled_chitin_hull", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/chiselled_chitin_slab.json b/src/main/resources/data/unicopia/recipes/chiselled_chitin_slab.json deleted file mode 100644 index b5a25d9d..00000000 --- a/src/main/resources/data/unicopia/recipes/chiselled_chitin_slab.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###" - ], - "key": { - "#": [ - { "item": "unicopia:chiselled_chitin" } - ] - }, - "result": { "item": "unicopia:chiselled_chitin_slab", "count": 6 } -} diff --git a/src/main/resources/data/unicopia/recipes/chiselled_chitin_stairs.json b/src/main/resources/data/unicopia/recipes/chiselled_chitin_stairs.json deleted file mode 100644 index e74fdbd8..00000000 --- a/src/main/resources/data/unicopia/recipes/chiselled_chitin_stairs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# ", - "## ", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:chiselled_chitin" } - ] - }, - "result": { "item": "unicopia:chiselled_chitin_stairs", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/chitin.json b/src/main/resources/data/unicopia/recipes/chitin.json deleted file mode 100644 index c3509060..00000000 --- a/src/main/resources/data/unicopia/recipes/chitin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "###", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:carapace" } - ] - }, - "result": { "item": "unicopia:chitin", "count": 1 } -} diff --git a/src/main/resources/data/unicopia/recipes/chitin_spikes.json b/src/main/resources/data/unicopia/recipes/chitin_spikes.json deleted file mode 100644 index f7f20647..00000000 --- a/src/main/resources/data/unicopia/recipes/chitin_spikes.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " # ", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:chitin" } - ] - }, - "result": { "item": "unicopia:chitin_spikes", "count": 1 } -} diff --git a/src/main/resources/data/unicopia/recipes/cider.json b/src/main/resources/data/unicopia/recipes/cider.json deleted file mode 100644 index 2fbe7a94..00000000 --- a/src/main/resources/data/unicopia/recipes/cider.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "SBS", - "NAN", - " S " - ], - "key": { - "S": [ - { "item": "minecraft:stick" } - ], - "B": [ - { "item": "unicopia:burned_juice" } - ], - "N": [ - { "item": "minecraft:iron_nugget" } - ], - "A": [ - { "tag": "unicopia:fresh_apples" } - ] - }, - "result": { "item": "unicopia:cider" } -} diff --git a/src/main/resources/data/unicopia/recipes/cloth_bed.json b/src/main/resources/data/unicopia/recipes/cloth_bed.json deleted file mode 100644 index 54ba7a7f..00000000 --- a/src/main/resources/data/unicopia/recipes/cloth_bed.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "bed", - "pattern": [ - "^^^", - "###" - ], - "key": { - "^": { - "tag": "minecraft:wool" - }, - "#": { - "tag": "minecraft:logs" - } - }, - "result": { - "count": 1, - "item": "unicopia:cloth_bed" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/cloud_bed.json b/src/main/resources/data/unicopia/recipes/cloud_bed.json deleted file mode 100644 index b1de9a60..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_bed.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "$$$", - "###" - ], - "key": { - "$": [ - { "item": "unicopia:dense_cloud" } - ], - "#": [ - { "item": "unicopia:cloud_planks" } - ] - }, - "result": { "item": "unicopia:cloud_bed", "count": 1 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_block.json b/src/main/resources/data/unicopia/recipes/cloud_block.json deleted file mode 100644 index 949938df..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_block.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##" - ], - "key": { - "#": [ - { "item": "unicopia:cloud_lump" } - ] - }, - "result": { "item": "unicopia:cloud", "count": 1 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_brick_slab.json b/src/main/resources/data/unicopia/recipes/cloud_brick_slab.json deleted file mode 100644 index 9b4480e8..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_brick_slab.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud_bricks" } - ] - }, - "result": { "item": "unicopia:cloud_brick_slab", "count": 6 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_brick_stairs.json b/src/main/resources/data/unicopia/recipes/cloud_brick_stairs.json deleted file mode 100644 index 01d2cea2..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_brick_stairs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# ", - "## ", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud_bricks" } - ] - }, - "result": { "item": "unicopia:cloud_brick_stairs", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_chest.json b/src/main/resources/data/unicopia/recipes/cloud_chest.json deleted file mode 100644 index 5373f56c..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_chest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "# #", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud_planks" } - ] - }, - "result": { "item": "unicopia:cloud_chest", "count": 1 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_door.json b/src/main/resources/data/unicopia/recipes/cloud_door.json deleted file mode 100644 index 240bf34b..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_door.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##", - "##" - ], - "key": { - "#": [ - { "item": "unicopia:dense_cloud" } - ] - }, - "result": { "item": "unicopia:cloud_door", "count": 3 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_lump.json b/src/main/resources/data/unicopia/recipes/cloud_lump.json deleted file mode 100644 index 6890547d..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_lump.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "tag": "unicopia:cloud_jars" } - ], - "result": { "item": "unicopia:cloud_lump", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_pillar.json b/src/main/resources/data/unicopia/recipes/cloud_pillar.json deleted file mode 100644 index 202fc0d8..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_pillar.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##", - "##" - ], - "key": { - "#": [ - { "item": "unicopia:cloud" } - ] - }, - "result": { "item": "unicopia:cloud_pillar", "count": 3 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_plank_slab.json b/src/main/resources/data/unicopia/recipes/cloud_plank_slab.json deleted file mode 100644 index 4eca09e0..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_plank_slab.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud_planks" } - ] - }, - "result": { "item": "unicopia:cloud_plank_slab", "count": 6 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_plank_stairs.json b/src/main/resources/data/unicopia/recipes/cloud_plank_stairs.json deleted file mode 100644 index 82295d31..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_plank_stairs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# ", - "## ", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud_planks" } - ] - }, - "result": { "item": "unicopia:cloud_plank_stairs", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_planks.json b/src/main/resources/data/unicopia/recipes/cloud_planks.json deleted file mode 100644 index 1e02127f..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_planks.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##" - ], - "key": { - "#": [ - { "item": "unicopia:cloud" } - ] - }, - "result": { "item": "unicopia:cloud_planks", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_slab.json b/src/main/resources/data/unicopia/recipes/cloud_slab.json deleted file mode 100644 index 0612dbf3..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_slab.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud" } - ] - }, - "result": { "item": "unicopia:cloud_slab", "count": 6 } -} diff --git a/src/main/resources/data/unicopia/recipes/cloud_stairs.json b/src/main/resources/data/unicopia/recipes/cloud_stairs.json deleted file mode 100644 index d1e30a9f..00000000 --- a/src/main/resources/data/unicopia/recipes/cloud_stairs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# ", - "## ", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud" } - ] - }, - "result": { "item": "unicopia:cloud_stairs", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/cooked_zap_apple.json b/src/main/resources/data/unicopia/recipes/cooked_zap_apple.json deleted file mode 100644 index 4a37347e..00000000 --- a/src/main/resources/data/unicopia/recipes/cooked_zap_apple.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "smelting", - "ingredient": { - "item": "unicopia:zap_apple" - }, - "result": "unicopia:cooked_zap_apple", - "experience": 0.2, - "cookingtime": 430 -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/copper_horse_shoe.json b/src/main/resources/data/unicopia/recipes/copper_horse_shoe.json deleted file mode 100644 index 275c7652..00000000 --- a/src/main/resources/data/unicopia/recipes/copper_horse_shoe.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "* *", - "* *", - " * " - ], - "key": { - "*": { - "item": "minecraft:copper_ingot" - } - }, - "result": { - "item": "unicopia:copper_horse_shoe" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/crispy_hay_fries.json b/src/main/resources/data/unicopia/recipes/crispy_hay_fries.json deleted file mode 100644 index 69f54f7a..00000000 --- a/src/main/resources/data/unicopia/recipes/crispy_hay_fries.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "smelting", - "ingredient": { - "item": "unicopia:hay_fries" - }, - "result": "unicopia:crispy_hay_fries", - "experience": 1, - "cookingtime": 25 -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/crystal_door.json b/src/main/resources/data/unicopia/recipes/crystal_door.json deleted file mode 100644 index 0d952926..00000000 --- a/src/main/resources/data/unicopia/recipes/crystal_door.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "**", - "**", - "**" - ], - "key": { - "*": { - "item": "unicopia:crystal_shard" - } - }, - "result": { - "item": "unicopia:crystal_door" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/crystal_heart.json b/src/main/resources/data/unicopia/recipes/crystal_heart.json deleted file mode 100644 index 9f100a13..00000000 --- a/src/main/resources/data/unicopia/recipes/crystal_heart.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "* *", - "***", - " * " - ], - "key": { - "*": { - "item": "unicopia:crystal_shard" - } - }, - "result": { - "item": "unicopia:crystal_heart" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/crystal_shard.json b/src/main/resources/data/unicopia/recipes/crystal_shard.json deleted file mode 100644 index b01d5883..00000000 --- a/src/main/resources/data/unicopia/recipes/crystal_shard.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "minecraft:diamond" } - ], - "result": { - "item": "unicopia:crystal_shard", - "count": 3 - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/daffodil_daisy_sandwich.json b/src/main/resources/data/unicopia/recipes/daffodil_daisy_sandwich.json deleted file mode 100644 index ea2cf1e1..00000000 --- a/src/main/resources/data/unicopia/recipes/daffodil_daisy_sandwich.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " # ", - "~~~", - " # " - ], - "key": { - "#": { - "item": "minecraft:bread" - }, - "~": { - "tag": "minecraft:small_flowers" - } - }, - "result": { - "item": "unicopia:daffodil_daisy_sandwich" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/dark_oak_stable_door.json b/src/main/resources/data/unicopia/recipes/dark_oak_stable_door.json deleted file mode 100644 index 21aef6a2..00000000 --- a/src/main/resources/data/unicopia/recipes/dark_oak_stable_door.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "*#*", - "*#*", - "*#*" - ], - "key": { - "*": { - "item": "unicopia:rock" - }, - "#": { - "tag": "minecraft:planks" - } - }, - "result": { - "item": "unicopia:dark_oak_stable_door" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/dense_cloud.json b/src/main/resources/data/unicopia/recipes/dense_cloud.json deleted file mode 100644 index d1e57d5a..00000000 --- a/src/main/resources/data/unicopia/recipes/dense_cloud.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "###", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud" } - ] - }, - "result": { "item": "unicopia:dense_cloud", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/dense_cloud_slab.json b/src/main/resources/data/unicopia/recipes/dense_cloud_slab.json deleted file mode 100644 index 54a6f9ba..00000000 --- a/src/main/resources/data/unicopia/recipes/dense_cloud_slab.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###" - ], - "key": { - "#": [ - { "item": "unicopia:dense_cloud" } - ] - }, - "result": { "item": "unicopia:dense_cloud_slab", "count": 6 } -} diff --git a/src/main/resources/data/unicopia/recipes/dense_cloud_stairs.json b/src/main/resources/data/unicopia/recipes/dense_cloud_stairs.json deleted file mode 100644 index 1e4392ef..00000000 --- a/src/main/resources/data/unicopia/recipes/dense_cloud_stairs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# ", - "## ", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:dense_cloud" } - ] - }, - "result": { "item": "unicopia:dense_cloud_stairs", "count": 4 } -} diff --git a/src/main/resources/data/unicopia/recipes/diamond_polearm.json b/src/main/resources/data/unicopia/recipes/diamond_polearm.json deleted file mode 100644 index 5818e4cb..00000000 --- a/src/main/resources/data/unicopia/recipes/diamond_polearm.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " X", - " # ", - "# " - ], - "key": { - "#": { - "item": "minecraft:stick" - }, - "X": { - "item": "minecraft:diamond" - } - }, - "result": { - "item": "unicopia:diamond_polearm" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/dragon_breath_scroll.json b/src/main/resources/data/unicopia/recipes/dragon_breath_scroll.json deleted file mode 100644 index 468565ca..00000000 --- a/src/main/resources/data/unicopia/recipes/dragon_breath_scroll.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { - "item": "minecraft:paper" - }, - "traits": { - "fire": 1 - }, - "ingredients": [ - { "item": "minecraft:paper" } - ], - "result": { - "item": "unicopia:dragon_breath_scroll" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/easy_cider.json b/src/main/resources/data/unicopia/recipes/easy_cider.json deleted file mode 100644 index 9b88ce07..00000000 --- a/src/main/resources/data/unicopia/recipes/easy_cider.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:burned_juice" }, - { "item": "unicopia:mug" } - ], - "result": { - "item": "unicopia:cider" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/empty_jar.json b/src/main/resources/data/unicopia/recipes/empty_jar.json deleted file mode 100644 index e4915306..00000000 --- a/src/main/resources/data/unicopia/recipes/empty_jar.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "*#*", - "* *", - "***" - ], - "key": { - "#": { - "tag": "minecraft:planks" - }, - "*": { - "item": "minecraft:glass" - } - }, - "result": { - "item": "unicopia:empty_jar", - "count": 7 - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/filled_jar.json b/src/main/resources/data/unicopia/recipes/filled_jar.json deleted file mode 100644 index c18321e9..00000000 --- a/src/main/resources/data/unicopia/recipes/filled_jar.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "unicopia:jar_insert" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/filled_jar_emptied.json b/src/main/resources/data/unicopia/recipes/filled_jar_emptied.json deleted file mode 100644 index 7c78b525..00000000 --- a/src/main/resources/data/unicopia/recipes/filled_jar_emptied.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "unicopia:jar_extract" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/friendship_bracelet.json b/src/main/resources/data/unicopia/recipes/friendship_bracelet.json deleted file mode 100644 index 20a716d0..00000000 --- a/src/main/resources/data/unicopia/recipes/friendship_bracelet.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "*#*", - "# #", - "*#*" - ], - "key": { - "*": { - "item": "minecraft:string" - }, - "#": { - "item": "minecraft:leather" - } - }, - "result": { - "item": "unicopia:friendship_bracelet" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/gemstone.json b/src/main/resources/data/unicopia/recipes/gemstone.json deleted file mode 100644 index 927c960c..00000000 --- a/src/main/resources/data/unicopia/recipes/gemstone.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "**", - "**" - ], - "key": { - "*": { - "item": "unicopia:crystal_shard" - } - }, - "result": { - "item": "unicopia:gemstone" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/giant_balloon.json b/src/main/resources/data/unicopia/recipes/giant_balloon.json deleted file mode 100644 index 25e370e9..00000000 --- a/src/main/resources/data/unicopia/recipes/giant_balloon.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "group": "basket", - "key": { - "#": { - "item": "minecraft:white_wool" - }, - "-": { - "item": "minecraft:white_carpet" - } - }, - "pattern": [ - "---", - "# #", - "---" - ], - "result": { - "count": 1, - "item": "unicopia:giant_balloon" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/glowing_bangle.json b/src/main/resources/data/unicopia/recipes/glowing_bangle.json deleted file mode 100644 index 3e5bd045..00000000 --- a/src/main/resources/data/unicopia/recipes/glowing_bangle.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "unicopia:crafting_glowing" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/gold_nugget.json b/src/main/resources/data/unicopia/recipes/gold_nugget.json deleted file mode 100644 index 5b393a11..00000000 --- a/src/main/resources/data/unicopia/recipes/gold_nugget.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "smelting", - "ingredient": { - "item": "unicopia:golden_oak_seeds" - }, - "result": "minecraft:gold_nugget", - "experience": 0.2, - "cookingtime": 10 -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/golden_feather.json b/src/main/resources/data/unicopia/recipes/golden_feather.json deleted file mode 100644 index 3977a01c..00000000 --- a/src/main/resources/data/unicopia/recipes/golden_feather.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "***", - "*#*", - "***" - ], - "key": { - "#": [ - { "tag": "unicopia:magic_feathers" } - ], - "*": { - "item": "minecraft:gold_nugget" - } - }, - "result": { - "item": "unicopia:golden_feather" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/golden_horse_shoe.json b/src/main/resources/data/unicopia/recipes/golden_horse_shoe.json deleted file mode 100644 index 81ccb8a1..00000000 --- a/src/main/resources/data/unicopia/recipes/golden_horse_shoe.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "* *", - "* *", - " * " - ], - "key": { - "*": { - "item": "minecraft:gold_ingot" - } - }, - "result": { - "item": "unicopia:golden_horse_shoe" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/golden_polearm.json b/src/main/resources/data/unicopia/recipes/golden_polearm.json deleted file mode 100644 index 6c5297a3..00000000 --- a/src/main/resources/data/unicopia/recipes/golden_polearm.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " X", - " # ", - "# " - ], - "key": { - "#": { - "item": "minecraft:stick" - }, - "X": { - "item": "minecraft:gold_ingot" - } - }, - "result": { - "item": "unicopia:golden_polearm" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/golden_wing.json b/src/main/resources/data/unicopia/recipes/golden_wing.json deleted file mode 100644 index e150c42f..00000000 --- a/src/main/resources/data/unicopia/recipes/golden_wing.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "***", - "***", - "***" - ], - "key": { - "*": { - "item": "unicopia:golden_feather" - } - }, - "result": { - "item": "unicopia:golden_wing" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/gravel_to_pebbles.json b/src/main/resources/data/unicopia/recipes/gravel_to_pebbles.json deleted file mode 100644 index 0f33de27..00000000 --- a/src/main/resources/data/unicopia/recipes/gravel_to_pebbles.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "minecraft:gravel" } - ], - "result": { "item": "unicopia:pebbles", "count": 9 } -} diff --git a/src/main/resources/data/unicopia/recipes/green_apple_to_seeds.json b/src/main/resources/data/unicopia/recipes/green_apple_to_seeds.json deleted file mode 100644 index 7794b7ea..00000000 --- a/src/main/resources/data/unicopia/recipes/green_apple_to_seeds.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:green_apple" } - ], - "result": { "item": "unicopia:green_apple_seeds", "count": 3 } -} diff --git a/src/main/resources/data/unicopia/recipes/growing/curing_joke.json b/src/main/resources/data/unicopia/recipes/growing/curing_joke.json deleted file mode 100644 index 61625b41..00000000 --- a/src/main/resources/data/unicopia/recipes/growing/curing_joke.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:transform_crop", - "target": "minecraft:cornflower", - "consume": { - "Name": "minecraft:lapis_block", - "Properties": {} - }, - "output": { - "Name": "unicopia:curing_joke", - "Properties": {} - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/growing/gold_root.json b/src/main/resources/data/unicopia/recipes/growing/gold_root.json deleted file mode 100644 index a6d2d09b..00000000 --- a/src/main/resources/data/unicopia/recipes/growing/gold_root.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:transform_crop", - "target": "minecraft:carrots", - "consume": { - "Name": "minecraft:raw_gold_block", - "Properties": {} - }, - "output": { - "Name": "unicopia:gold_root", - "Properties": {} - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/growing/golden_oak_sapling.json b/src/main/resources/data/unicopia/recipes/growing/golden_oak_sapling.json deleted file mode 100644 index b129e3ae..00000000 --- a/src/main/resources/data/unicopia/recipes/growing/golden_oak_sapling.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:transform_crop", - "target": "minecraft:oak_sapling", - "consume": { - "Name": "minecraft:raw_gold_block", - "Properties": {} - }, - "output": { - "Name": "unicopia:golden_oak_sapling", - "Properties": {} - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/growing/plunder_vine.json b/src/main/resources/data/unicopia/recipes/growing/plunder_vine.json deleted file mode 100644 index df6a6eac..00000000 --- a/src/main/resources/data/unicopia/recipes/growing/plunder_vine.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:transform_crop", - "target": "minecraft:wither_rose", - "consume": { - "Name": "minecraft:netherrack", - "Properties": {} - }, - "output": { - "Name": "unicopia:plunder_vine_bud", - "Properties": {} - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/growing/zapling.json b/src/main/resources/data/unicopia/recipes/growing/zapling.json deleted file mode 100644 index 971c2099..00000000 --- a/src/main/resources/data/unicopia/recipes/growing/zapling.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:transform_crop", - "target": "minecraft:dark_oak_sapling", - "consume": { - "Name": "unicopia:chitin", - "Properties": {} - }, - "output": { - "Name": "unicopia:zapling", - "Properties": {} - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/hay_burger.json b/src/main/resources/data/unicopia/recipes/hay_burger.json deleted file mode 100644 index e6d4e43a..00000000 --- a/src/main/resources/data/unicopia/recipes/hay_burger.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " # ", - "~~~", - " # " - ], - "key": { - "#": { - "item": "minecraft:bread" - }, - "~": { - "item": "unicopia:oats" - } - }, - "result": { - "item": "unicopia:hay_burger" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/hay_fries.json b/src/main/resources/data/unicopia/recipes/hay_fries.json deleted file mode 100644 index 23a921d6..00000000 --- a/src/main/resources/data/unicopia/recipes/hay_fries.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###" - ], - "key": { - "#": { - "item": "unicopia:oats" - } - }, - "result": { - "item": "unicopia:hay_fries" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/hive.json b/src/main/resources/data/unicopia/recipes/hive.json deleted file mode 100644 index 28e4e633..00000000 --- a/src/main/resources/data/unicopia/recipes/hive.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " # ", - "#o#", - " # " - ], - "key": { - "#": [ - { "item": "unicopia:chitin" } - ], - "o": [ - { "item": "unicopia:mysterious_egg" } - ] - }, - "result": { "item": "unicopia:hive", "count": 1 } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/horse_shoe_fries.json b/src/main/resources/data/unicopia/recipes/horse_shoe_fries.json deleted file mode 100644 index fd256912..00000000 --- a/src/main/resources/data/unicopia/recipes/horse_shoe_fries.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "* *", - "* *", - " * " - ], - "key": { - "*": { - "item": "minecraft:baked_potato" - } - }, - "result": { - "item": "unicopia:horse_shoe_fries", - "count": 15 - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/iron_horse_shoe.json b/src/main/resources/data/unicopia/recipes/iron_horse_shoe.json deleted file mode 100644 index 4adc2b0b..00000000 --- a/src/main/resources/data/unicopia/recipes/iron_horse_shoe.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "* *", - "* *", - " * " - ], - "key": { - "*": { - "item": "minecraft:iron_ingot" - } - }, - "result": { - "item": "unicopia:iron_horse_shoe" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/iron_polearm.json b/src/main/resources/data/unicopia/recipes/iron_polearm.json deleted file mode 100644 index ceceac21..00000000 --- a/src/main/resources/data/unicopia/recipes/iron_polearm.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " X", - " # ", - "# " - ], - "key": { - "#": { - "item": "minecraft:stick" - }, - "X": { - "item": "minecraft:iron_ingot" - } - }, - "result": { - "item": "unicopia:iron_polearm" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/jam_toast.json b/src/main/resources/data/unicopia/recipes/jam_toast.json deleted file mode 100644 index 7e5bbd06..00000000 --- a/src/main/resources/data/unicopia/recipes/jam_toast.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "___", - "_X_", - "___" - ], - "key": { - "_": { - "item": "unicopia:toast" - }, - "X": { - "item": "unicopia:zap_apple_jam_jar" - } - }, - "result": { - "item": "unicopia:jam_toast", - "count": 8 - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/juice.json b/src/main/resources/data/unicopia/recipes/juice.json deleted file mode 100644 index a68d49df..00000000 --- a/src/main/resources/data/unicopia/recipes/juice.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "minecraft:glass_bottle" }, - { "tag": "unicopia:fresh_apples" }, - { "tag": "unicopia:fresh_apples" }, - { "tag": "unicopia:fresh_apples" }, - { "tag": "unicopia:fresh_apples" }, - { "tag": "unicopia:fresh_apples" }, - { "tag": "unicopia:fresh_apples" } - ], - "result": { "item": "unicopia:juice" } -} diff --git a/src/main/resources/data/unicopia/recipes/magic_staff.json b/src/main/resources/data/unicopia/recipes/magic_staff.json deleted file mode 100644 index 9ce441a0..00000000 --- a/src/main/resources/data/unicopia/recipes/magic_staff.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "unicopia:crafting_magical", - "pattern": [ - " o", - " # ", - "# " - ], - "key": { - "#": { - "item": "minecraft:stick" - }, - "o": { - "item": "unicopia:gemstone" - } - }, - "result": { - "item": "unicopia:magic_staff" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/meadowbrook_staff_dissassembly.json b/src/main/resources/data/unicopia/recipes/meadowbrook_staff_dissassembly.json deleted file mode 100644 index 75fd4264..00000000 --- a/src/main/resources/data/unicopia/recipes/meadowbrook_staff_dissassembly.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:meadowbrooks_staff" } - ], - "result": { - "item": "minecraft:stick", - "count": 2 - } -} diff --git a/src/main/resources/data/unicopia/recipes/meadowbrooks_staff.json b/src/main/resources/data/unicopia/recipes/meadowbrooks_staff.json deleted file mode 100644 index 5382d9ce..00000000 --- a/src/main/resources/data/unicopia/recipes/meadowbrooks_staff.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " #", - " # ", - "# " - ], - "key": { - "#": { - "item": "minecraft:stick" - } - }, - "result": { - "item": "unicopia:meadowbrooks_staff" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/muffin.json b/src/main/resources/data/unicopia/recipes/muffin.json deleted file mode 100644 index f78266a5..00000000 --- a/src/main/resources/data/unicopia/recipes/muffin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "minecraft:sugar" }, - { "item": "minecraft:egg" }, - { "item": "minecraft:potato" }, - { "item": "unicopia:juice" }, - { "item": "unicopia:wheat_worms" } - ], - "result": { - "item": "unicopia:muffin", - "count": 12 - } -} diff --git a/src/main/resources/data/unicopia/recipes/mug.json b/src/main/resources/data/unicopia/recipes/mug.json deleted file mode 100644 index 55404f71..00000000 --- a/src/main/resources/data/unicopia/recipes/mug.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# #", - "* *", - " # " - ], - "key": { - "#": [ - { "item": "minecraft:stick" } - ], - "*": [ - { "item": "minecraft:iron_nugget" } - ] - }, - "result": { "item": "unicopia:mug" } -} diff --git a/src/main/resources/data/unicopia/recipes/netherite_horse_shoe.json b/src/main/resources/data/unicopia/recipes/netherite_horse_shoe.json deleted file mode 100644 index 12ab6bed..00000000 --- a/src/main/resources/data/unicopia/recipes/netherite_horse_shoe.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "* *", - "* *", - " * " - ], - "key": { - "*": { - "item": "minecraft:netherite_ingot" - } - }, - "result": { - "item": "unicopia:netherite_horse_shoe" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/netherite_polearm_smithing.json b/src/main/resources/data/unicopia/recipes/netherite_polearm_smithing.json deleted file mode 100644 index 39fc0414..00000000 --- a/src/main/resources/data/unicopia/recipes/netherite_polearm_smithing.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "minecraft:smithing_transform", - "addition": { - "item": "minecraft:netherite_ingot" - }, - "base": { - "item": "unicopia:diamond_polearm" - }, - "result": { - "item": "unicopia:netherite_polearm" - }, - "template": { - "item": "minecraft:netherite_upgrade_smithing_template" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/oatmeal.json b/src/main/resources/data/unicopia/recipes/oatmeal.json deleted file mode 100644 index 14a6d641..00000000 --- a/src/main/resources/data/unicopia/recipes/oatmeal.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:oats" }, - { "item": "unicopia:oats" }, - { "item": "unicopia:oats" }, - { "item": "minecraft:milk_bucket" }, - { "item": "minecraft:bowl" } - ], - "result": { "item": "unicopia:oatmeal" } -} diff --git a/src/main/resources/data/unicopia/recipes/pearl_necklace.json b/src/main/resources/data/unicopia/recipes/pearl_necklace.json deleted file mode 100644 index 4b9a4db6..00000000 --- a/src/main/resources/data/unicopia/recipes/pearl_necklace.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# #", - "# #", - "~#~" - ], - "key": { - "#": { "tag": "unicopia:food_types/shells" }, - "~": { "item": "minecraft:string" } - }, - "result": { - "item": "unicopia:pearl_necklace" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/pebbles_to_gravel.json b/src/main/resources/data/unicopia/recipes/pebbles_to_gravel.json deleted file mode 100644 index fa55f673..00000000 --- a/src/main/resources/data/unicopia/recipes/pebbles_to_gravel.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "###", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:pebbles" } - ] - }, - "result": { "item": "minecraft:gravel" } -} diff --git a/src/main/resources/data/unicopia/recipes/pegasus_amulet.json b/src/main/resources/data/unicopia/recipes/pegasus_amulet.json deleted file mode 100644 index 71d48454..00000000 --- a/src/main/resources/data/unicopia/recipes/pegasus_amulet.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "*#*" - ], - "key": { - "#": { "item": "unicopia:gemstone" }, - "*": { "item": "unicopia:golden_wing" } - }, - "result": { - "item": "unicopia:pegasus_amulet" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/pineapple_crown.json b/src/main/resources/data/unicopia/recipes/pineapple_crown.json deleted file mode 100644 index 1d79690b..00000000 --- a/src/main/resources/data/unicopia/recipes/pineapple_crown.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:pineapple" } - ], - "result": { "item": "unicopia:pineapple_crown" } -} diff --git a/src/main/resources/data/unicopia/recipes/repair_sunglasses.json b/src/main/resources/data/unicopia/recipes/repair_sunglasses.json deleted file mode 100644 index d6c4a284..00000000 --- a/src/main/resources/data/unicopia/recipes/repair_sunglasses.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "minecraft:glass" }, - { "item": "unicopia:broken_sunglasses" } - ], - "result": { - "item": "unicopia:sunglasses" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/rock_candy.json b/src/main/resources/data/unicopia/recipes/rock_candy.json deleted file mode 100644 index 043e1a51..00000000 --- a/src/main/resources/data/unicopia/recipes/rock_candy.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:pebbles" }, - { "item": "unicopia:pebbles" }, - { "item": "unicopia:pebbles" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" }, - { "item": "minecraft:sugar" } - ], - "result": { "item": "unicopia:rock_candy", "count": 3 } -} diff --git a/src/main/resources/data/unicopia/recipes/rock_stew.json b/src/main/resources/data/unicopia/recipes/rock_stew.json deleted file mode 100644 index 907b249b..00000000 --- a/src/main/resources/data/unicopia/recipes/rock_stew.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:rock" }, - { "item": "unicopia:rock" }, - { "item": "unicopia:rock" }, - { "item": "minecraft:bowl" } - ], - "result": { "item": "unicopia:rock_stew" } -} diff --git a/src/main/resources/data/unicopia/recipes/rocks_to_cobblestone.json b/src/main/resources/data/unicopia/recipes/rocks_to_cobblestone.json deleted file mode 100644 index d6aa926b..00000000 --- a/src/main/resources/data/unicopia/recipes/rocks_to_cobblestone.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##" - ], - "key": { - "#": [ - { "item": "unicopia:rock" } - ] - }, - "result": { "item": "minecraft:cobblestone" } -} diff --git a/src/main/resources/data/unicopia/recipes/shaping_bench.json b/src/main/resources/data/unicopia/recipes/shaping_bench.json deleted file mode 100644 index 98263612..00000000 --- a/src/main/resources/data/unicopia/recipes/shaping_bench.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##" - ], - "key": { - "#": [ - { "item": "unicopia:dense_cloud" } - ] - }, - "result": { "item": "unicopia:shaping_bench", "count": 1 } -} diff --git a/src/main/resources/data/unicopia/recipes/shelly.json b/src/main/resources/data/unicopia/recipes/shelly.json deleted file mode 100644 index 54c4a93d..00000000 --- a/src/main/resources/data/unicopia/recipes/shelly.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "o o", - " C " - ], - "key": { - "C": { "item": "unicopia:clam_shell" }, - "o": { "item": "unicopia:rock_candy" } - }, - "result": { - "item": "unicopia:shelly" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/sour_apple_to_seeds.json b/src/main/resources/data/unicopia/recipes/sour_apple_to_seeds.json deleted file mode 100644 index 7884a668..00000000 --- a/src/main/resources/data/unicopia/recipes/sour_apple_to_seeds.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:sour_apple" } - ], - "result": { "item": "unicopia:sour_apple_seeds", "count": 2 } -} diff --git a/src/main/resources/data/unicopia/recipes/spell_duplicating_botched_gemstone.json b/src/main/resources/data/unicopia/recipes/spell_duplicating_botched_gemstone.json deleted file mode 100644 index 7994e225..00000000 --- a/src/main/resources/data/unicopia/recipes/spell_duplicating_botched_gemstone.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "unicopia:spellbook/duplicating", - "material": { "item": "unicopia:botched_gem" } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spellbook.json b/src/main/resources/data/unicopia/recipes/spellbook.json deleted file mode 100644 index 35b9a050..00000000 --- a/src/main/resources/data/unicopia/recipes/spellbook.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:gemstone" }, - { "item": "minecraft:book" } - ], - "result": { "item": "unicopia:spellbook" } -} diff --git a/src/main/resources/data/unicopia/recipes/spells/arcane_protection.json b/src/main/resources/data/unicopia/recipes/spells/arcane_protection.json deleted file mode 100644 index 0e394aef..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/arcane_protection.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "strength": 10, "knowledge": 18, "darkness": 1 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:shield" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:arcane_protection" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/bubble.json b/src/main/resources/data/unicopia/recipes/spells/bubble.json deleted file mode 100644 index 49127861..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/bubble.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "water": 9, "air": 9 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:catapult" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:bubble" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/catapult.json b/src/main/resources/data/unicopia/recipes/spells/catapult.json deleted file mode 100644 index d479f3ad..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/catapult.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "focus": 9, "air": 9 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:flame" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:catapult" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/chilling_breath.json b/src/main/resources/data/unicopia/recipes/spells/chilling_breath.json deleted file mode 100644 index aabe879c..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/chilling_breath.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "ice": 5, - "knowledge": 10 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:frost" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:chilling_breath" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/dark_vortex.json b/src/main/resources/data/unicopia/recipes/spells/dark_vortex.json deleted file mode 100644 index 09c5d5d1..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/dark_vortex.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "strength": 10, "knowledge": 8, "darkness": 9, "chaos": 8 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:vortex" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:dark_vortex" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/dispel_evil.json b/src/main/resources/data/unicopia/recipes/spells/dispel_evil.json deleted file mode 100644 index e0993076..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/dispel_evil.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "kindness": 1, - "power": 1 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:arcane_protection" }, - { "item": "unicopia:gemstone", "spell": "unicopia:displacement" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:dispel_evil" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/displacement.json b/src/main/resources/data/unicopia/recipes/spells/displacement.json deleted file mode 100644 index 2cd2aa77..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/displacement.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "knowledge": 18, "chaos": 20 - }, - "ingredients": [], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:displacement" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/feather_fall.json b/src/main/resources/data/unicopia/recipes/spells/feather_fall.json deleted file mode 100644 index 0d3b161a..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/feather_fall.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "knowledge": 20, "life": 10, "chaos": 4, - "generosity": 10 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:shield" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:feather_fall" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/fire_bolt.json b/src/main/resources/data/unicopia/recipes/spells/fire_bolt.json deleted file mode 100644 index b9c4e45e..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/fire_bolt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "focus": 9, "fire": 30 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:flame" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:fire_bolt" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/flame.json b/src/main/resources/data/unicopia/recipes/spells/flame.json deleted file mode 100644 index dca992e7..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/flame.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "fire": 15 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:scorch" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:flame" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/frost.json b/src/main/resources/data/unicopia/recipes/spells/frost.json deleted file mode 100644 index 4009534a..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/frost.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "ice": 15 - }, - "ingredients": [], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:frost" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/hydrophobic.json b/src/main/resources/data/unicopia/recipes/spells/hydrophobic.json deleted file mode 100644 index 681b1595..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/hydrophobic.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "focus": 6 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:frost" }, - { "item": "unicopia:gemstone", "spell": "unicopia:shield" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:hydrophobic" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/infernal.json b/src/main/resources/data/unicopia/recipes/spells/infernal.json deleted file mode 100644 index 9f2c8995..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/infernal.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "fire": 50, "darkness": 10 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:flame" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:infernal" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/light.json b/src/main/resources/data/unicopia/recipes/spells/light.json deleted file mode 100644 index daee45cb..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/light.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "ice": 30, "life": 30, "focus": 10 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:fire_bolt" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:light" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/mimic.json b/src/main/resources/data/unicopia/recipes/spells/mimic.json deleted file mode 100644 index 546c0908..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/mimic.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "knowledge": 19, "life": 10, "chaos": 4 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:transformation" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:mimic" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/mind_swap.json b/src/main/resources/data/unicopia/recipes/spells/mind_swap.json deleted file mode 100644 index c98d477b..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/mind_swap.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "knowledge": 19, "life": 10, "chaos": 40 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:mimic" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:mind_swap" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/necromancy.json b/src/main/resources/data/unicopia/recipes/spells/necromancy.json deleted file mode 100644 index bd106820..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/necromancy.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "strength": 10, "knowledge": 8, "darkness": 19, "chaos": 8, - "blood": 10, "poison": 9 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:siphoning" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:necromancy" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/portal.json b/src/main/resources/data/unicopia/recipes/spells/portal.json deleted file mode 100644 index 6e6f60f8..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/portal.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "knowledge": 18, "chaos": 20 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:displacement" }, - { "item": "unicopia:gemstone", "spell": "unicopia:dark_vortex" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:portal" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/reveal.json b/src/main/resources/data/unicopia/recipes/spells/reveal.json deleted file mode 100644 index 6b9f8c9c..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/reveal.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "knowledge": 18, "life": 1, "order": 4 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:shield" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:reveal" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/scorch.json b/src/main/resources/data/unicopia/recipes/spells/scorch.json deleted file mode 100644 index 499bce01..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/scorch.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "fire": 10 - }, - "ingredients": [], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:scorch" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/shield.json b/src/main/resources/data/unicopia/recipes/spells/shield.json deleted file mode 100644 index 2b12b91f..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/shield.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "strength": 10, "focus": 6, "power": 10 - }, - "ingredients": [], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:shield" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/siphoning.json b/src/main/resources/data/unicopia/recipes/spells/siphoning.json deleted file mode 100644 index 7c01454d..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/siphoning.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "blood": 8, "poison": 10 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:infernal" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:siphoning" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/transformation.json b/src/main/resources/data/unicopia/recipes/spells/transformation.json deleted file mode 100644 index 588cdcec..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/transformation.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "knowledge": 18, "life": 10, "chaos": 4 - }, - "ingredients": [], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:transformation" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/spells/vortex.json b/src/main/resources/data/unicopia/recipes/spells/vortex.json deleted file mode 100644 index 46e9a351..00000000 --- a/src/main/resources/data/unicopia/recipes/spells/vortex.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { "item": "unicopia:gemstone", "spell": "unicopia:none" }, - "traits": { - "strength": 10, "knowledge": 8, "air": 9 - }, - "ingredients": [ - { "item": "unicopia:gemstone", "spell": "unicopia:shield" } - ], - "result": { - "item": "unicopia:gemstone", - "spell": "unicopia:vortex" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/stable_door.json b/src/main/resources/data/unicopia/recipes/stable_door.json deleted file mode 100644 index c1acd242..00000000 --- a/src/main/resources/data/unicopia/recipes/stable_door.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "*#*", - "*#*", - "*#*" - ], - "key": { - "*": { - "item": "unicopia:rock_candy" - }, - "#": { - "tag": "minecraft:planks" - } - }, - "result": { - "item": "unicopia:stable_door" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_hull.json b/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_hull.json deleted file mode 100644 index 296f1c4d..00000000 --- a/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_hull.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "minecraft:stonecutting", - "ingredient": { "item": "unicopia:chiselled_chitin" }, - "result": "unicopia:chiselled_chitin_hull", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_slab.json b/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_slab.json deleted file mode 100644 index a9392025..00000000 --- a/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_slab.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "minecraft:stonecutting", - "ingredient": { "item": "unicopia:chiselled_chitin" }, - "result": "unicopia:chiselled_chitin_slab", - "count": 2 -} diff --git a/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_stairs.json b/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_stairs.json deleted file mode 100644 index 77707741..00000000 --- a/src/main/resources/data/unicopia/recipes/stone_cutting/chiselled_chitin_stairs.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "minecraft:stonecutting", - "ingredient": { "item": "unicopia:chiselled_chitin" }, - "result": "unicopia:chiselled_chitin_stairs", - "count": 1 -} diff --git a/src/main/resources/data/unicopia/recipes/stone_polearm.json b/src/main/resources/data/unicopia/recipes/stone_polearm.json deleted file mode 100644 index 49dcd70a..00000000 --- a/src/main/resources/data/unicopia/recipes/stone_polearm.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " X", - " # ", - "# " - ], - "key": { - "#": { - "item": "minecraft:stick" - }, - "X": { - "tag": "minecraft:stone_tool_materials" - } - }, - "result": { - "item": "unicopia:stone_polearm" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/stripped_palm_wood.json b/src/main/resources/data/unicopia/recipes/stripped_palm_wood.json deleted file mode 100644 index 1b4f818e..00000000 --- a/src/main/resources/data/unicopia/recipes/stripped_palm_wood.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "category": "building", - "group": "bark", - "pattern": [ - "##", - "##" - ], - "key": { - "#": { - "item": "unicopia:stripped_palm_log" - } - }, - "result": { - "count": 3, - "item": "unicopia:stripped_palm_wood" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/sunglasses.json b/src/main/resources/data/unicopia/recipes/sunglasses.json deleted file mode 100644 index 63961ec1..00000000 --- a/src/main/resources/data/unicopia/recipes/sunglasses.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "**" - ], - "key": { - "*": { - "item": "minecraft:glass" - } - }, - "result": { - "item": "unicopia:sunglasses" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/sweet_apple_to_seeds.json b/src/main/resources/data/unicopia/recipes/sweet_apple_to_seeds.json deleted file mode 100644 index efdbcc70..00000000 --- a/src/main/resources/data/unicopia/recipes/sweet_apple_to_seeds.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:sweet_apple" } - ], - "result": { "item": "unicopia:sweet_apple_seeds", "count": 3 } -} diff --git a/src/main/resources/data/unicopia/recipes/toast.json b/src/main/resources/data/unicopia/recipes/toast.json deleted file mode 100644 index 7edc3a02..00000000 --- a/src/main/resources/data/unicopia/recipes/toast.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "smelting", - "ingredient": { - "item": "minecraft:bread" - }, - "result": "unicopia:toast", - "experience": 0.2, - "cookingtime": 430 -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/trait_combining_botched_gemstone.json b/src/main/resources/data/unicopia/recipes/trait_combining_botched_gemstone.json deleted file mode 100644 index 9950b4dc..00000000 --- a/src/main/resources/data/unicopia/recipes/trait_combining_botched_gemstone.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "unicopia:spellbook/combining", - "material": { "item": "unicopia:botched_gem" } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/trait_combining_gemstone.json b/src/main/resources/data/unicopia/recipes/trait_combining_gemstone.json deleted file mode 100644 index 13ab2a9f..00000000 --- a/src/main/resources/data/unicopia/recipes/trait_combining_gemstone.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "unicopia:spellbook/combining", - "material": { "item": "unicopia:gemstone" } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/trick_green_apple.json b/src/main/resources/data/unicopia/recipes/trick_green_apple.json deleted file mode 100644 index b914d534..00000000 --- a/src/main/resources/data/unicopia/recipes/trick_green_apple.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "unicopia:crafting_zap_apple", - "ingredients": [ - { "item": "unicopia:zap_apple" }, - { "item": "minecraft:green_dye" } - ], - "appearance": "unicopia:green_apple" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/trick_red_apple.json b/src/main/resources/data/unicopia/recipes/trick_red_apple.json deleted file mode 100644 index cd5095ea..00000000 --- a/src/main/resources/data/unicopia/recipes/trick_red_apple.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "unicopia:crafting_zap_apple", - "ingredients": [ - { "item": "unicopia:zap_apple" }, - { "item": "minecraft:red_dye" } - ], - "appearance": "minecraft:apple" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/trick_sour_apple.json b/src/main/resources/data/unicopia/recipes/trick_sour_apple.json deleted file mode 100644 index f5be4b69..00000000 --- a/src/main/resources/data/unicopia/recipes/trick_sour_apple.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "unicopia:crafting_zap_apple", - "ingredients": [ - { "item": "unicopia:zap_apple" }, - { "item": "minecraft:yellow_dye" } - ], - "appearance": "unicopia:sour_apple" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/trick_sweet_apple.json b/src/main/resources/data/unicopia/recipes/trick_sweet_apple.json deleted file mode 100644 index 48794044..00000000 --- a/src/main/resources/data/unicopia/recipes/trick_sweet_apple.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "unicopia:crafting_zap_apple", - "ingredients": [ - { "item": "unicopia:zap_apple" }, - { "item": "minecraft:orange_dye" } - ], - "appearance": "unicopia:sweet_apple" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/trick_zap_apple.json b/src/main/resources/data/unicopia/recipes/trick_zap_apple.json deleted file mode 100644 index 38555616..00000000 --- a/src/main/resources/data/unicopia/recipes/trick_zap_apple.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "unicopia:crafting_zap_apple", - "ingredients": [ - { "item": "unicopia:zap_apple" }, - { "item": "minecraft:rotten_flesh" } - ], - "appearance": "unicopia:cooked_zap_apple" -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/unicorn_amulet.json b/src/main/resources/data/unicopia/recipes/unicorn_amulet.json deleted file mode 100644 index b5a4f434..00000000 --- a/src/main/resources/data/unicopia/recipes/unicorn_amulet.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "unicopia:spellbook/crafting", - "material": { - "item": "unicopia:broken_alicorn_amulet" - }, - "traits": {}, - "ingredients": [ - { "item": "unicopia:pegasus_amulet" }, - { "item": "unicopia:crystal_heart" }, - { "item": "unicopia:grogars_bell" }, - { "item": "minecraft:totem_of_undying" } - ], - "result": { - "item": "unicopia:unicorn_amulet" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/unstable_cloud.json b/src/main/resources/data/unicopia/recipes/unstable_cloud.json deleted file mode 100644 index 6ccbf5d4..00000000 --- a/src/main/resources/data/unicopia/recipes/unstable_cloud.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "#O#", - "###" - ], - "key": { - "#": [ - { "item": "unicopia:cloud" } - ], - "O": [ - { "item": "unicopia:lightning_jar" }, - { "item": "unicopia:zap_apple_jam_jar" } - ] - }, - "result": { "item": "unicopia:unstable_cloud", "count": 8 } -} diff --git a/src/main/resources/data/unicopia/recipes/waxed_stripped_zap_log.json b/src/main/resources/data/unicopia/recipes/waxed_stripped_zap_log.json deleted file mode 100644 index 49358b05..00000000 --- a/src/main/resources/data/unicopia/recipes/waxed_stripped_zap_log.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:stripped_zap_log" }, - { "item": "minecraft:honeycomb" } - ], - "result": { "item": "unicopia:waxed_stripped_zap_log" } -} diff --git a/src/main/resources/data/unicopia/recipes/waxed_stripped_zap_wood.json b/src/main/resources/data/unicopia/recipes/waxed_stripped_zap_wood.json deleted file mode 100644 index a025fe57..00000000 --- a/src/main/resources/data/unicopia/recipes/waxed_stripped_zap_wood.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:stripped_zap_wood" }, - { "item": "minecraft:honeycomb" } - ], - "result": { "item": "unicopia:waxed_stripped_zap_wood" } -} diff --git a/src/main/resources/data/unicopia/recipes/waxed_zap_log.json b/src/main/resources/data/unicopia/recipes/waxed_zap_log.json deleted file mode 100644 index 7196b38f..00000000 --- a/src/main/resources/data/unicopia/recipes/waxed_zap_log.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { "item": "unicopia:zap_log" }, - { "item": "minecraft:honeycomb" } - ], - "result": { "item": "unicopia:waxed_zap_log" } -} diff --git a/src/main/resources/data/unicopia/recipes/weather_vane.json b/src/main/resources/data/unicopia/recipes/weather_vane.json deleted file mode 100644 index 4818dbcc..00000000 --- a/src/main/resources/data/unicopia/recipes/weather_vane.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " **", - "** ", - " * " - ], - "key": { - "*": { - "item": "minecraft:iron_nugget" - } - }, - "result": { - "item": "unicopia:weather_vane" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/wooden_polearm.json b/src/main/resources/data/unicopia/recipes/wooden_polearm.json deleted file mode 100644 index 3b659c76..00000000 --- a/src/main/resources/data/unicopia/recipes/wooden_polearm.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " X", - " # ", - "# " - ], - "key": { - "#": { - "item": "minecraft:stick" - }, - "X": { - "tag": "minecraft:planks" - } - }, - "result": { - "item": "unicopia:wooden_polearm" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/worms_to_dirt.json b/src/main/resources/data/unicopia/recipes/worms_to_dirt.json deleted file mode 100644 index 172b1e4f..00000000 --- a/src/main/resources/data/unicopia/recipes/worms_to_dirt.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "WX", - "XW" - ], - "key": { - "W": { - "item": "unicopia:wheat_worms" - }, - "X": { - "item": "minecraft:sand" - } - }, - "result": { - "item": "minecraft:dirt", - "count": 2 - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/writable_book.json b/src/main/resources/data/unicopia/recipes/writable_book.json deleted file mode 100644 index 49af1f20..00000000 --- a/src/main/resources/data/unicopia/recipes/writable_book.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "minecraft:book" - }, - { - "item": "minecraft:ink_sac" - }, - { - "tag": "unicopia:magic_feathers" - } - ], - "result": { - "item": "minecraft:writable_book" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/zap_apple_jam_jar.json b/src/main/resources/data/unicopia/recipes/zap_apple_jam_jar.json deleted file mode 100644 index abc7831d..00000000 --- a/src/main/resources/data/unicopia/recipes/zap_apple_jam_jar.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "***", - "***", - " U " - ], - "key": { - "*": { - "item": "unicopia:cooked_zap_apple" - }, - "U": { - "item": "unicopia:empty_jar" - } - }, - "result": { - "item": "unicopia:zap_apple_jam_jar" - } -} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/tags/damage_type/breaks_sunglasses.json b/src/main/resources/data/unicopia/tags/damage_type/breaks_sunglasses.json deleted file mode 100644 index 3c832cc1..00000000 --- a/src/main/resources/data/unicopia/tags/damage_type/breaks_sunglasses.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:bat_screech", - "unicopia:rainboom" - ] -} diff --git a/src/main/resources/data/unicopia/tags/damage_type/from_horseshoes.json b/src/main/resources/data/unicopia/tags/damage_type/from_horseshoes.json deleted file mode 100644 index 276d2073..00000000 --- a/src/main/resources/data/unicopia/tags/damage_type/from_horseshoes.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:horseshoe" - ] -} diff --git a/src/main/resources/data/unicopia/tags/damage_type/from_rocks.json b/src/main/resources/data/unicopia/tags/damage_type/from_rocks.json deleted file mode 100644 index 9ab866dd..00000000 --- a/src/main/resources/data/unicopia/tags/damage_type/from_rocks.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:rock" - ] -} diff --git a/src/main/resources/data/unicopia/tags/damage_type/spellbook_immune_to.json b/src/main/resources/data/unicopia/tags/damage_type/spellbook_immune_to.json deleted file mode 100644 index f270bd7e..00000000 --- a/src/main/resources/data/unicopia/tags/damage_type/spellbook_immune_to.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "replace": false, - "values": [ - "#minecraft:is_fall", - "#minecraft:is_freezing", - "#minecraft:is_lightning", - "#minecraft:is_projectile", - "unicopia:zap", - "unicopia:love_draining", - "unicopia:life_draining", - "unicopia:rainboom", - "unicopia:sun", - "unicopia:sunlight", - "unicopia:smash" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/baked_goods.json b/src/main/resources/data/unicopia/tags/items/food_types/baked_goods.json deleted file mode 100644 index 02828b2e..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/baked_goods.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:bread", - "minecraft:cookie", - "unicopia:muffin", - "#c:grain", - "unicopia:cooked_zap_apple", - "minecraft:pumpkin_pie", - "#unicopia:pies", - "unicopia:apple_pie_slice", - "unicopia:toast", - "unicopia:burned_toast", - "unicopia:jam_toast", - "unicopia:imported_oats", - "unicopia:oatmeal", - "unicopia:hay_fries", - "unicopia:crispy_hay_fries", - "unicopia:horse_shoe_fries", - { "id": "farmersdelight:wheat_dough", "required": false }, - { "id": "farmersdelight:raw_pasta", "required": false }, - { "id": "farmersdelight:pie_crust", "required": false }, - { "id": "farmersdelight:sweet_berry_cookie", "required": false }, - { "id": "farmersdelight:honey_cookie", "required": false }, - { "id": "farmersdelight:egg_sandwich", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/bat_ponys_delight.json b/src/main/resources/data/unicopia/tags/items/food_types/bat_ponys_delight.json deleted file mode 100644 index 8309c0f0..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/bat_ponys_delight.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:mango", - { "id": "#c:mango", "required": false }, - { "id": "#c:mangoes", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/candy.json b/src/main/resources/data/unicopia/tags/items/food_types/candy.json deleted file mode 100644 index 8a152f67..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/candy.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:rock_candy", - "unicopia:candied_apple", - "minecraft:sugar", - { "id": "bakersdelight:sweet_berry_cheesecake_slice", "required": false }, - { "id": "bakersdelight:cake_slice", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/cooked_fish.json b/src/main/resources/data/unicopia/tags/items/food_types/cooked_fish.json deleted file mode 100644 index 216c3f5d..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/cooked_fish.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:cooked_fish", - { "id": "farmersdelight:fish_stew", "required": false }, - { "id": "farmersdelight:baked_cod_stew", "required": false }, - { "id": "farmersdelight:grilled_salmon", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/cooked_insect.json b/src/main/resources/data/unicopia/tags/items/food_types/cooked_insect.json deleted file mode 100644 index 8e23aa37..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/cooked_insect.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:cooked_insects" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/cooked_meat.json b/src/main/resources/data/unicopia/tags/items/food_types/cooked_meat.json deleted file mode 100644 index 9860573f..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/cooked_meat.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:cooked_meats", - { "id": "farmersdelight:chicken_soup", "required": false }, - { "id": "farmersdelight:bacon_and_eggs", "required": false }, - { "id": "farmersdelight:pasta_with_meatballs", "required": false }, - { "id": "farmersdelight:beef_stew", "required": false }, - { "id": "farmersdelight:bone_broth", "required": false }, - { "id": "farmersdelight:mutton_wrap", "required": false }, - { "id": "farmersdelight:bacon_sandwich", "required": false }, - { "id": "farmersdelight:hamburger", "required": false }, - { "id": "farmersdelight:chicken_sandwich", "required": false }, - { "id": "farmersdelight:barbecue_stick", "required": false }, - { "id": "farmersdelight:smoked_ham", "required": false }, - { "id": "farmersdelight:honey_glazed_ham", "required": false }, - { "id": "farmersdelight:honey_glazed_ham_block", "required": false }, - { "id": "farmersdelight:roast_chicken", "required": false }, - { "id": "farmersdelight:roast_chicken_block", "required": false }, - { "id": "farmersdelight:steak_and_potatoes", "required": false }, - { "id": "farmersdelight:roasted_mutton_chops", "required": false }, - { "id": "farmersdelight:pasta_with_mutton_chop", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/cooked_sea_vegitable.json b/src/main/resources/data/unicopia/tags/items/food_types/cooked_sea_vegitable.json deleted file mode 100644 index 30ffdfce..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/cooked_sea_vegitable.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:dried_kelp_block", - "minecraft:glow_lichen", - "#c:coral_blocks" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/desserts.json b/src/main/resources/data/unicopia/tags/items/food_types/desserts.json deleted file mode 100644 index c88f3f26..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/desserts.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:cake", - { "id": "farmersdelight:sweet_berry_cheesecake", "required": false }, - { "id": "farmersdelight:sweet_berry_cheesecake_slice", "required": false }, - { "id": "farmersdelight:chocolate_pie_slice", "required": false }, - { "id": "farmersdelight:cake_slice", "required": false }, - { "id": "farmersdelight:apple_pie_slice", "required": false }, - { "id": "farmersdelight:glow_berry_custard", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_blinding.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_blinding.json deleted file mode 100644 index 2734f9e9..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_blinding.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:oxeye_daisy" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_dangerous.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_dangerous.json deleted file mode 100644 index 40636af9..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_dangerous.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:poppy", - "minecraft:lily_of_the_valley" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_edible.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_edible.json deleted file mode 100644 index ee20b95a..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_edible.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:blue_orchid", - "minecraft:red_tulip", - "minecraft:orange_tulip", - "minecraft:pink_tulip", - "minecraft:cornflower", - "minecraft:peony", - "minecraft:sunflower", - "minecraft:dandelion", - "minecraft:lilac", - "minecraft:tall_grass", - "minecraft:wheat", - "minecraft:dead_bush", - "minecraft:pink_petals", - "#c:foraging/edibles" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_edible_filling.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_edible_filling.json deleted file mode 100644 index c3245df5..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_edible_filling.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:hay_block", - "#c:foraging/edibles_filling" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_nauseating.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_nauseating.json deleted file mode 100644 index e88c1674..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_nauseating.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:short_grass", - "unicopia:cider", - { "id": "farmersdelight:rotten_tomato", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_prickly.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_prickly.json deleted file mode 100644 index 3fbb59d5..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_prickly.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:rose_bush", - "#minecraft:saplings" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_radioactive.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_radioactive.json deleted file mode 100644 index f274ebe5..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_radioactive.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:azure_bluet", - "minecraft:torchflower" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_risky.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_risky.json deleted file mode 100644 index 533231e1..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_risky.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:allium", - "minecraft:white_tulip", - "unicopia:burned_juice", - "#c:foraging/risky" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_severely_nauseating.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_severely_nauseating.json deleted file mode 100644 index ae67591c..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_severely_nauseating.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:pitcher_plant" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_severely_prickly.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_severely_prickly.json deleted file mode 100644 index 4ff8aebc..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_severely_prickly.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:large_fern" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/forage_strengthening.json b/src/main/resources/data/unicopia/tags/items/food_types/forage_strengthening.json deleted file mode 100644 index 97038fab..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/forage_strengthening.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:fern" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/fruit.json b/src/main/resources/data/unicopia/tags/items/food_types/fruit.json deleted file mode 100644 index 39c40cdc..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/fruit.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:fruits", - "unicopia:zap_apple", - "unicopia:zap_bulb", - "unicopia:rotten_apple", - "minecraft:melon_slice", - "minecraft:sweet_berries", - "minecraft:glow_berries", - "minecraft:chorus_fruit", - "unicopia:juice", - { "id": "farmersdelight:pumpkin_slice", "required": false }, - { "id": "farmersdelight:tomato", "required": false }, - { "id": "farmersdelight:melon_juice", "required": false }, - { "id": "farmersdelight:fruit_salad", "required": false }, - { "id": "#garnished:berries", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/love.json b/src/main/resources/data/unicopia/tags/items/food_types/love.json deleted file mode 100644 index 72d0be9d..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/love.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:love" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/nuts_and_seeds.json b/src/main/resources/data/unicopia/tags/items/food_types/nuts_and_seeds.json deleted file mode 100644 index 937e7578..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/nuts_and_seeds.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:seeds", - "#c:acorns", - "#c:nuts", - { "id": "#garnished:nuts", "required": false }, - { "id": "#garnished:nut_mix", "required": false }, - { "id": "#garnished:neverable_delecacies", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/pinecone.json b/src/main/resources/data/unicopia/tags/items/food_types/pinecone.json deleted file mode 100644 index 9ad60d14..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/pinecone.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:pinecones" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/raw_fish.json b/src/main/resources/data/unicopia/tags/items/food_types/raw_fish.json deleted file mode 100644 index 1fb0b027..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/raw_fish.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:raw_fish", - { "id": "farmersdelight:cod_roll", "required": false }, - { "id": "farmersdelight:salmon_roll", "required": false }, - { "id": "farmersdelight:salmon_slice", "required": false }, - { "id": "farmersdelight:cod_slice", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/raw_insect.json b/src/main/resources/data/unicopia/tags/items/food_types/raw_insect.json deleted file mode 100644 index 24b2cff4..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/raw_insect.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:raw_insects" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/raw_meat.json b/src/main/resources/data/unicopia/tags/items/food_types/raw_meat.json deleted file mode 100644 index dcf23921..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/raw_meat.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:raw_meats", - { "id": "farmersdelight:ham", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/raw_sea_vegitable.json b/src/main/resources/data/unicopia/tags/items/food_types/raw_sea_vegitable.json deleted file mode 100644 index c570e4a4..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/raw_sea_vegitable.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:kelp", - "minecraft:dried_kelp", - "minecraft:seagrass", - "minecraft:sea_pickle", - "#c:corals", - "#c:coral_fans", - { "id": "farmersdelight:melon_popsicle", "required": false }, - { "id": "farmersdelight:kelp_roll", "required": false }, - { "id": "farmersdelight:kelp_roll_slice", "required": false } - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/rocks.json b/src/main/resources/data/unicopia/tags/items/food_types/rocks.json deleted file mode 100644 index 229f317a..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/rocks.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:rock_stew" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/rotten_meat.json b/src/main/resources/data/unicopia/tags/items/food_types/rotten_meat.json deleted file mode 100644 index 4dee31d1..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/rotten_meat.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:rotten_meats" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/shells.json b/src/main/resources/data/unicopia/tags/items/food_types/shells.json deleted file mode 100644 index d62b7052..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/shells.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:nautilus_shell", - "unicopia:clam_shell", - "unicopia:scallop_shell", - "unicopia:turret_shell", - "minecraft:seagrass", - "minecraft:sea_pickle" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/shelly.json b/src/main/resources/data/unicopia/tags/items/food_types/shelly.json deleted file mode 100644 index f8790589..00000000 --- a/src/main/resources/data/unicopia/tags/items/food_types/shelly.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:shelly" - ] -} diff --git a/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json b/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json index 8c547253..d8ace57f 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json +++ b/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json @@ -1,7 +1,7 @@ { "replace": false, "values": [ - "#unicopia:food_types/raw_insect", + "#c:raw_insect", "#unicopia:polearms", "unicopia:mango_leaves", "unicopia:mango_sapling", diff --git a/src/main/resources/data/unicopia/tags/items/groups/changeling.json b/src/main/resources/data/unicopia/tags/items/groups/changeling.json index 3cc31831..8f87e169 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/changeling.json +++ b/src/main/resources/data/unicopia/tags/items/groups/changeling.json @@ -10,12 +10,13 @@ "unicopia:chiselled_chitin_hull", "unicopia:chitin_spikes", "unicopia:mysterious_egg", + "unicopia:green_fried_egg", "unicopia:hive", "unicopia:dark_oak_stable_door", - "#unicopia:food_types/cooked_meat", - "#unicopia:food_types/raw_meat", - "#unicopia:food_types/raw_insect", - "#unicopia:food_types/rotten_meat", - "#unicopia:food_types/love" + "#c:cooked_meat", + "#c:raw_meat", + "#c:raw_insect", + "#c:rotten_meat", + "#unicopia:container_with_love" ] } diff --git a/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json b/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json index 618a0532..c75fb733 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json +++ b/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json @@ -51,15 +51,22 @@ "unicopia:oats", "unicopia:imported_oats", "unicopia:oatmeal", + "unicopia:oatmeal_cookie", + "unicopia:chocolate_oatmeal_cookie", "unicopia:daffodil_daisy_sandwich", "unicopia:hay_burger", "unicopia:hay_fries", "unicopia:crispy_hay_fries", "unicopia:horse_shoe_fries", "unicopia:wheat_worms", + "unicopia:baited_fishing_rod", + "unicopia:worm_block", "unicopia:muffin", + "unicopia:scone", "unicopia:acorn", "unicopia:pinecone", + "unicopia:pinecone_cookie", + "unicopia:bowl_of_nuts", "unicopia:crystal_shard", "unicopia:pebbles", "unicopia:rock", diff --git a/src/main/resources/data/unicopia/tags/items/groups/foraging.json b/src/main/resources/data/unicopia/tags/items/groups/foraging.json index f50de618..92eb5eee 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/foraging.json +++ b/src/main/resources/data/unicopia/tags/items/groups/foraging.json @@ -1,16 +1,16 @@ { "replace": false, "values": [ - "#unicopia:food_types/forage_dangerous", - "#unicopia:food_types/forage_edible_filling", - "#unicopia:food_types/forage_edible", - "#unicopia:food_types/forage_nauseating", - "#unicopia:food_types/forage_blinding", - "#unicopia:food_types/forage_prickly", - "#unicopia:food_types/forage_radioactive", - "#unicopia:food_types/forage_risky", - "#unicopia:food_types/forage_severely_nauseating", - "#unicopia:food_types/forage_severely_prickly", - "#unicopia:food_types/forage_strengthening" + "#unicopia:forage/dangerous", + "#unicopia:forage/filling", + "#unicopia:forage/safe", + "#unicopia:forage/nauseating", + "#unicopia:forage/blinding", + "#unicopia:forage/prickly", + "#unicopia:forage/glowing", + "#unicopia:forage/risky", + "#unicopia:forage/severe/nauseating", + "#unicopia:forage/severe/prickly", + "#unicopia:forage/strenghtening" ] } diff --git a/src/main/resources/data/unicopia/tags/items/groups/pegasus.json b/src/main/resources/data/unicopia/tags/items/groups/pegasus.json index b76a934d..269e51b9 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/pegasus.json +++ b/src/main/resources/data/unicopia/tags/items/groups/pegasus.json @@ -24,8 +24,9 @@ "unicopia:cloud_door", "unicopia:cloud_bed", "#unicopia:bed_sheets", - "#unicopia:food_types/raw_fish", - "#unicopia:food_types/cooked_fish", + "#c:raw_fish", + "#c:cooked_fish", + "#c:rotten_fish", "unicopia:rain_cloud_jar", "unicopia:storm_cloud_jar", "unicopia:lightning_jar", diff --git a/src/main/resources/data/unicopia/tags/items/groups/sea_pony.json b/src/main/resources/data/unicopia/tags/items/groups/sea_pony.json index a9259060..9aeefc68 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/sea_pony.json +++ b/src/main/resources/data/unicopia/tags/items/groups/sea_pony.json @@ -2,10 +2,9 @@ "replace": false, "values": [ "unicopia:pearl_necklace", - "minecraft:nautilus_shell", - "#unicopia:food_types/shells", - "#unicopia:food_types/shelly", - "#unicopia:food_types/raw_sea_vegitable", - "#unicopia:food_types/cooked_sea_vegitable" + "#unicopia:shells", + "#unicopia:special_shells", + "#unicopia:food_types/low_quality_sea_vegetables", + "#unicopia:food_types/high_quality_sea_vegetables" ] } diff --git a/src/main/resources/data/unicopia/tags/items/magic_spell_base.json b/src/main/resources/data/unicopia/tags/items/magic_spell_base.json deleted file mode 100644 index d3e5b431..00000000 --- a/src/main/resources/data/unicopia/tags/items/magic_spell_base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:gemstone", - "unicopia:magic_staff" - ] -} diff --git a/src/main/resources/data/unicopia/traits/love.json b/src/main/resources/data/unicopia/traits/love.json index 534e5a40..af8df4e3 100644 --- a/src/main/resources/data/unicopia/traits/love.json +++ b/src/main/resources/data/unicopia/traits/love.json @@ -2,7 +2,7 @@ "replace": false, "traits": "happiness:10 kindness:10", "items": [ - "#c:love", + "#unicopia:container_with_love", "#unicopia:clouds" ] } \ No newline at end of file diff --git a/src/main/resources/unicopia.mixin.json b/src/main/resources/unicopia.mixin.json index d59bf63e..855a75b7 100644 --- a/src/main/resources/unicopia.mixin.json +++ b/src/main/resources/unicopia.mixin.json @@ -13,13 +13,13 @@ "MixinBlockEntityType", "MixinBlockItem", "MixinBoatEntity", - "MixinBrain", "MixinChunkBlockLightProvider", "MutableBlockLightStorage", "MixinDamageSource", "MixinEnchantmentHelper", "MixinFallLocation", "MixinEntity", + "MixinEntityBucketItem", "MixinEntityView", "MixinEntityShapeContext", "MixinFallingBlock", @@ -53,8 +53,18 @@ "MixinVanillaBiomeParameters", "MixinWardenEntity", "MixinWorld", - "MixinWorldChunk", "PointOfInterestTypesAccessor", + "gravity.MixinBrain", + "gravity.MixinEntity", + "gravity.MixinLivingEntity", + "gravity.MixinMobEntity", + "gravity.MixinWorld", + "gravity.MixinPlayerEntity", + "gravity.MixinPistonBlockEntity", + "gravity.MixinServerWorld", + "gravity.MixinServerPlayerEntity", + "gravity.MixinServerPlayNetworkHandler", + "gravity.MixinWorldChunk", "trinkets.MixinTrinketSurvivalSlot", "trinkets.MixinTrinketItem", "trinkets.MixinTrinketInventory", @@ -88,7 +98,9 @@ "client.MixinWorldRenderer", "client.sodium.MixinSodiumWorldRenderer", "client.minelp.MixinPonyPosture", - "trinkets.MixinTrinketCreativeSlot" + "trinkets.MixinTrinketCreativeSlot", + "gravity.MixinClientWorld", + "gravity.MixinSoundSource" ], "injectors": { "defaultRequire": 1