diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 545dd518d..777b0ae22 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -8,7 +8,7 @@ body: attributes: value: | Thanks for taking the time to fill out this bug report! Anyhow before you take your time answering all of the question please make sure of the following: - - Are you sure that there is not already reported same or similiar bug? You can try to use the [search](https://github.com/Faboslav/friends-and-foes/issues). + - Are you sure that there is not already reported same or similar bug? You can try to use the [search](https://github.com/Faboslav/friends-and-foes/issues). - Are you using the latest version of the mod? You can find the latest version [here](https://github.com/Faboslav/friends-and-foes/releases). - type: input id: minecraft-version diff --git a/.github/ISSUE_TEMPLATE/crash_report.yml b/.github/ISSUE_TEMPLATE/crash_report.yml index f7e7372ff..4e404f150 100644 --- a/.github/ISSUE_TEMPLATE/crash_report.yml +++ b/.github/ISSUE_TEMPLATE/crash_report.yml @@ -8,7 +8,7 @@ body: attributes: value: | Thanks for taking the time to fill out this crash report! Anyhow before you take your time answering all of the question please make sure of the following: - - Are you sure that there is not already reported same or similiar crash? You can try to use the [search](https://github.com/Faboslav/friends-and-foes/issues). + - Are you sure that there is not already reported same or similar crash? You can try to use the [search](https://github.com/Faboslav/friends-and-foes/issues). - Are you using the latest version of the mod? You can find the latest version [here](https://github.com/Faboslav/friends-and-foes/releases). - type: input id: minecraft-version diff --git a/.github/versions.json b/.github/versions.json index a4014a142..7df745bbe 100644 --- a/.github/versions.json +++ b/.github/versions.json @@ -1,5 +1,5 @@ { - "1.19.2": "1.8.8", + "1.19.2": "1.8.9", "1.19.1": "1.8.8", "1.19": "1.8.8", "1.18.2": "1.4.8", diff --git a/blockbench/rascal/Rascal.bbmodel b/blockbench/rascal/Rascal.bbmodel new file mode 100644 index 000000000..b684889b7 --- /dev/null +++ b/blockbench/rascal/Rascal.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.5","model_format":"animated_entity_model","box_uv":true},"name":"Rascal","model_identifier":"rascal - Converted","visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"timeline_setups":[],"unhandled_root_fields":{},"resolution":{"width":64,"height":64},"elements":[{"name":"head","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-4,11,-10],"to":[4,17,-4],"autouv":0,"color":2,"origin":[0,0,0],"uv_offset":[0,52],"faces":{"north":{"uv":[6,58,14,64],"texture":0},"east":{"uv":[0,58,6,64],"texture":0},"south":{"uv":[20,58,28,64],"texture":0},"west":{"uv":[14,58,20,64],"texture":0},"up":{"uv":[14,58,6,52],"texture":0},"down":{"uv":[22,52,14,58],"texture":0}},"type":"cube","uuid":"5610797e-c25a-915d-ebd0-f98c266bd6b7"},{"name":"body","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-6,5,-4],"to":[6,20,4],"autouv":0,"color":2,"inflate":-0.01,"origin":[0,0,0],"faces":{"north":{"uv":[8,8,20,23],"texture":0},"east":{"uv":[0,8,8,23],"texture":0},"south":{"uv":[28,8,40,23],"texture":0},"west":{"uv":[20,8,28,23],"texture":0},"up":{"uv":[20,8,8,0],"texture":0},"down":{"uv":[32,0,20,8],"texture":0}},"type":"cube","uuid":"a1df3e93-d628-d164-4ae3-0d185d1c1fbb"},{"name":"rightArm","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-9,5,-2],"to":[-6,15,2],"autouv":0,"color":2,"origin":[0,0,0],"uv_offset":[50,28],"faces":{"north":{"uv":[54,32,57,42],"texture":0},"east":{"uv":[50,32,54,42],"texture":0},"south":{"uv":[61,32,64,42],"texture":0},"west":{"uv":[57,32,61,42],"texture":0},"up":{"uv":[57,32,54,28],"texture":0},"down":{"uv":[60,28,57,32],"texture":0}},"type":"cube","uuid":"179fffc8-c3cf-90a5-5543-4ccb1bffc903"},{"name":"scarf","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-4,9,-10],"to":[4,18,-4],"autouv":0,"color":2,"inflate":0.5,"origin":[0,0,0],"uv_offset":[28,36],"faces":{"north":{"uv":[34,42,42,51],"texture":0},"east":{"uv":[28,42,34,51],"texture":0},"south":{"uv":[48,42,56,51],"texture":0},"west":{"uv":[42,42,48,51],"texture":0},"up":{"uv":[42,42,34,36],"texture":0},"down":{"uv":[50,36,42,42],"texture":0}},"type":"cube","uuid":"bbb571c5-d309-7dd3-bdcc-71b68f8e646f"},{"name":"rightLeg","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-5,0,-2],"to":[-1,6,2],"autouv":0,"color":2,"origin":[0,0,0],"uv_offset":[28,54],"faces":{"north":{"uv":[32,58,36,64],"texture":0},"east":{"uv":[28,58,32,64],"texture":0},"south":{"uv":[40,58,44,64],"texture":0},"west":{"uv":[36,58,40,64],"texture":0},"up":{"uv":[36,58,32,54],"texture":0},"down":{"uv":[40,54,36,58],"texture":0}},"type":"cube","uuid":"548a108b-1e45-1f74-efd6-bebd0ed5f3b7"},{"name":"bag","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-7,8,4],"to":[1,17,10],"autouv":0,"color":2,"origin":[0,0,0],"uv_offset":[0,36],"faces":{"north":{"uv":[6,42,14,51],"texture":0},"east":{"uv":[0,42,6,51],"texture":0},"south":{"uv":[20,42,28,51],"texture":0},"west":{"uv":[14,42,20,51],"texture":0},"up":{"uv":[14,42,6,36],"texture":0},"down":{"uv":[22,36,14,42],"texture":0}},"type":"cube","uuid":"5a216366-ff71-da02-7427-6cc984f4c655"},{"name":"cloth","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-6,3,-4],"to":[6,8,4],"autouv":0,"color":2,"inflate":-0.5,"origin":[0,0,0],"uv_offset":[0,23],"faces":{"north":{"uv":[8,31,20,36],"texture":0},"east":{"uv":[0,31,8,36],"texture":0},"south":{"uv":[28,31,40,36],"texture":0},"west":{"uv":[20,31,28,36],"texture":0},"up":{"uv":[20,31,8,23],"texture":0},"down":{"uv":[32,23,20,31],"texture":0}},"type":"cube","uuid":"bc1d7d9f-9e05-85f9-6464-7bbd7a2c3ea3"},{"name":"stripe","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-5,5,-4],"to":[-3,20,4],"autouv":0,"color":2,"inflate":0.5,"origin":[0,0,0],"uv_offset":[44,0],"faces":{"north":{"uv":[52,8,54,23],"texture":0},"east":{"uv":[44,8,52,23],"texture":0},"south":{"uv":[62,8,64,23],"texture":0},"west":{"uv":[54,8,62,23],"texture":0},"up":{"uv":[54,8,52,0],"texture":0},"down":{"uv":[56,0,54,8],"texture":0}},"type":"cube","uuid":"950c57f0-4b76-bb9a-919b-156a5e446612"},{"name":"leftArm","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6,5,-2],"to":[9,15,2],"autouv":0,"color":2,"mirror_uv":true,"origin":[0,0,0],"uv_offset":[50,28],"faces":{"north":{"uv":[57,32,54,42],"texture":0},"east":{"uv":[61,32,57,42],"texture":0},"south":{"uv":[64,32,61,42],"texture":0},"west":{"uv":[54,32,50,42],"texture":0},"up":{"uv":[54,32,57,28],"texture":0},"down":{"uv":[57,28,60,32],"texture":0}},"type":"cube","uuid":"cf4e7090-c4a4-3bb1-5445-12df476a2ce7"},{"name":"leftLeg","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[1,0,-2],"to":[5,6,2],"autouv":0,"color":2,"mirror_uv":true,"origin":[0,0,0],"uv_offset":[28,54],"faces":{"north":{"uv":[36,58,32,64],"texture":0},"east":{"uv":[40,58,36,64],"texture":0},"south":{"uv":[44,58,40,64],"texture":0},"west":{"uv":[32,58,28,64],"texture":0},"up":{"uv":[32,58,36,54],"texture":0},"down":{"uv":[36,54,40,58],"texture":0}},"type":"cube","uuid":"13c935a5-2ec9-17ad-278b-f9863ee5654f"}],"outliner":[{"name":"head","origin":[0,15,-5],"color":0,"uuid":"133fc098-1dae-95b0-7cde-23c6f350c6c8","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["5610797e-c25a-915d-ebd0-f98c266bd6b7","bbb571c5-d309-7dd3-bdcc-71b68f8e646f"]},{"name":"leftArm","origin":[6,13,0],"color":0,"uuid":"a0b7942c-2039-3008-d5d4-71874ab3159d","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["cf4e7090-c4a4-3bb1-5445-12df476a2ce7"]},{"name":"rightArm","origin":[-6,13,0],"color":0,"uuid":"9325e427-5b09-6ca2-085d-c56aa11d6c95","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["179fffc8-c3cf-90a5-5543-4ccb1bffc903"]},{"name":"leftLeg","origin":[3,6,0],"color":0,"uuid":"616ae677-c704-3100-eb8c-5f389da56bab","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["13c935a5-2ec9-17ad-278b-f9863ee5654f"]},{"name":"rightLeg","origin":[-3,6,0],"color":0,"uuid":"e6ebbda9-64b3-bc6f-11c8-a889976b8bd8","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["548a108b-1e45-1f74-efd6-bebd0ed5f3b7"]},{"name":"bag","origin":[-3,16.5,4.5],"color":0,"uuid":"9f44f743-c317-b6a7-404d-9d80547e4fdb","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["5a216366-ff71-da02-7427-6cc984f4c655"]},{"name":"body","origin":[0,20,0],"color":0,"uuid":"ba135b89-9ee8-7155-efbf-7cd095edee53","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["a1df3e93-d628-d164-4ae3-0d185d1c1fbb","bc1d7d9f-9e05-85f9-6464-7bbd7a2c3ea3","950c57f0-4b76-bb9a-919b-156a5e446612"]}],"textures":[{"path":"/Users/alesfabianek/Projects/Minecraft/friends-and-foes/common/src/main/resources/assets/friendsandfoes/textures/entity/rascal/rascal.png","name":"rascal.png","folder":"entity/rascal","namespace":"friendsandfoes","id":"2","particle":false,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"857975cb-cca7-d368-12c5-aa7266647fa0","relative_path":"../../../common/src/main/resources/assets/friendsandfoes/textures/entity/rascal/rascal.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABzJJREFUeF7lWl1sVEUUvheLwSqmRWmlNipYy482EU0jSBR/YqPyU7UxRsEHwWhaHyQh4cWABt6akGCiJZoUX1RiTNUqCMFErYlC0igPKoIpRU0BadViwEKkds032zM5Ozt/9+697brel+7OOXPu+b4558zsnIaB4+nZ1pQhldo5VVrtgf5BOb503b7QZTNt+TN3X5N5/bNfvPxwKm1vmysIWFB/rfSbiODAITz0489Ba8cRp820CWh/pDaz4b0BLz+cSogA08qrQEBIMURA4gQAqIsEioaSI+Doh6tlDdCFLgFH+OMpyRRwFUHIiykCEi2C//saoNsFbFW8GGpApAgAwKb7G437O3KbtkBbIeS1APo63X17e8V7otiLQ6gPAaQT8hXmTgMQwB/84VywcP4lVqfVQkgg+XmBimRUe3GKqs82SDohmFjVPE8bAUQAhCABztOD77pHBch13uo+nDOfH65UW4XsKj4EyAjABwLInQCQzvLZYii86kqvw1vm19+k/pr+XkGaapN/N5EIHSLb90jL7UYi4KJlSzNrR46J+TvmNAZwnD6HFdXi8+Lq/N8A90y7Qsg+Pf+7fPf+U9nfBND/6si3wha3yQml95iYxTwQ+s/uHudpVbXhQwDNCcvWtsiDzu1zG4TjePhnIoIm6QgB+MzpU9kIGCcO37kd+dKKaqlrIgA2MH+0sytdAqaub8sAEK2eziECbNPh85K0d2FrR7oEIALUFSYw6oq6CoFL3yVX7U9IBPAUcAGcDHnqKYAiSFWe5y7A8qrO85cTQauq00/CXpwi6HMQkng4AXkhOL6ticLm2AqJLJuuj45Mv/F3xyEgSqSG02+pzYzMuj5bvcdBkqPlJ4+KcZLrwHFQqn4S9s5843ezEwU01w0pAmjb4aE+dvj7HGLUkFbTgusnZS/1CCACsJJYMb6iEiAbV1eV5vC5urEc1iPYmxAC8BIQob4MY3CcxoksXWXGbkLkJWkvdQJcuVO55EF5Uiwrn65VHx05I8eHv/w48sHF5UOacqezly1oFARMrZwp/SAiOHAILwwPBWcP9Tptpgkoqm2ns4gA08qrLwMhJRcBlAIuEigaSo6Amfc9Zr0WJ+AIfzwlmQIU6rYoKLYI4L9y9z7ZKrP13psbctK+ZGvAne0vychdVX+bJODZhx6IRoBuF7BV2mKpAZyAF5tazBFAADkobHmU0ypYvh3S1ufaegqxF7em8BR45Y4V5ggAASoo0iYSTHIOnBOWpD1fAggwfOJ3k/yzThbaDjrnjvdLjLqDEOR83EQCFc849nwJoJstfj+R8/vDcA8Z0kEHVVyt8lTZMW6S8zk++nAqij3fmsKv9vjVm+6iFj7Qr1VBAL2EyBj65J0cYmxyGKMTIB2akrTnSwC/2OE3WeqtliozboO4VqqrHNPWt77hKcGJ0+ettW/XwUHnFssN0N0kv6Cl1fPpDzy1cbP2wLboVn3f88DX2f6H0Uk0F7q/G9GCbL6pPPji2N9CNvzXaI5O5aVl4nscAtRGDBUwn9thlQAAr7uu1rpIfT8NuAkYOpsLEBafXnS5IEAFT28DCVEJ0F3Owh5Fget2+LUP9uRFwH+KAL6Noe2mttxcDRIQQGFNYc8JwGrjUcecKWCLgDRSgLfdoqSALgJUwDwfiJCiK4K0RfHwFzuNo0cYOwVQ7OqunpFTLPqO/5ENF2WclExyn3kvzF6Z123GSvP+Iz7zNEDDFgVSbcryCNFVO8xxpY74Bwl1u8M2JwiwbIM6uc88tL11Wx2/cudgedeZR4dPgcTW6oqcSSFAB4Rfy5uu2HXE2dKjYAJsqxxXhgggArDFATg6StR9Ml3Nkw7IUZsuplX2JsB6WkhYuPPPMQGWgMA8OkoAaGqDUftuyrwbhTecOHy3zXO11sLlC6syNRXTZL7zYy4flwWQHYPjzNtTMz8PvG/zA4cllQT4ZZqva/ao6ykJ4AI65wOg7jHJfeYRAWTX55xPumonm3eidH56EbCkfkYGR1cCCxB0xOXj9AKT3HfegRsasjVgvD9oC30VFKWC2sMsOAISTnOruZ7wYlnwooAno7ydT+34gmrARIIvxncZj8LL1j5nbYi4wOzufDXSfYDLXlpyJwFVNdl/lqRn8ET2fwHxqDKuUxIE2ACaZETCG1s2eUWAGmmqXV87cSPEGgE2ApKKgKImQAeSUgDk2O7bfFeu6AkwhdbKFcutUaf24EzKk06Aqdq7cpwXw7j5F2de0sU1dK2Ay0kdEa7a4bJpk6dGgM7p1S0PB81PrAkebck2F9/t+ijofntH8GbX+3k++m6PrshykeNbW1x2SC4iwOTUhnXPB49v2Rq03rVY6G//fH+wc+P6oH3by1r7NhJ48fR1TqeXKgFqVTfdq9ONKjlI19E+dcFVPF3k+BZXlx1tBJi6KSc3dQj9WZvb8uyCjEIJANGwQ39tzidNwL/B1qTFXkVWIQAAAABJRU5ErkJggg=="}],"animations":[{"uuid":"bf367973-9c39-500a-196f-41619e52a6bb","name":"nod","loop":"once","override":false,"length":0.4167,"snapping":12,"selected":false,"saved":true,"path":"/Users/alesfabianek/Downloads/rascal.animation.json","anim_time_update":"","blend_weight":"","start_delay":"","loop_delay":"","animators":{"133fc098-1dae-95b0-7cde-23c6f350c6c8":{"name":"head","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"68028f48-a178-14f8-c0eb-bf259bae56b0","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":15,"y":0,"z":0}],"uuid":"22970608-ef03-ea86-c1b4-fd10176bbad8","time":0.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":20,"y":0,"z":0}],"uuid":"62bceae8-5e5c-a731-ed09-89c34a8d02e6","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":10,"y":0,"z":0}],"uuid":"feab9ad1-27a2-b6ad-c2af-2f7f4ae6df5e","time":0.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"b625a124-ccfc-830a-c361-6cabf7e0f4f8","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"d4ff9c9f-cbd6-0ac1-f743-48f5c423ab3d","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":2,"z":0}],"uuid":"3d68b782-37d0-3a4f-6842-7fd098e016e3","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"079ac161-dc3f-1219-6439-4b1dc0fbfb70","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"a0b7942c-2039-3008-d5d4-71874ab3159d":{"name":"leftArm","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"7443b36e-0fa5-b463-172f-23fdaef86121","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-15,"y":0,"z":0}],"uuid":"8edb7b07-3c44-a4c5-e566-849d21bb09eb","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-25,"y":0,"z":0}],"uuid":"b2f106ad-5a40-af54-1af9-be37b4edf2c2","time":0.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":5,"y":0,"z":0}],"uuid":"1a10873c-aecc-c6a0-bca6-fe90f4cdd145","time":0.3333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"6917799d-823e-3f2d-e448-cc375227ff1b","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"3b3fc7c3-4f14-ae3d-4309-58b589436897","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":2,"z":0}],"uuid":"3145f830-5d86-b4f9-f616-93c964f17867","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"c19c59d2-a9ef-acd3-cf0e-fe6be92825ef","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"9325e427-5b09-6ca2-085d-c56aa11d6c95":{"name":"rightArm","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"258412cf-45da-0013-ad40-72b810439816","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":15,"y":0,"z":0}],"uuid":"14e62eb8-71e6-09c5-5b2a-4fb82f827868","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":25,"y":0,"z":0}],"uuid":"2d85af2f-719b-b030-bbf1-9f5772ce19d1","time":0.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":5,"y":0,"z":0}],"uuid":"17802068-56cd-2ead-3739-f2e2a4937e46","time":0.3333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"9a5c4666-f2d3-1fef-b832-b59f00d213ba","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"15c49bee-d5bf-440e-d7cb-ebf1fd9b047e","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":2,"z":0}],"uuid":"86a0f4b5-3f05-57a7-e2bc-1afae5c689c8","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"d994ed99-4178-b5df-e0c7-f4f86c98a814","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"616ae677-c704-3100-eb8c-5f389da56bab":{"name":"leftLeg","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"e0fb010d-3190-1bfd-3c3c-1ddb974411b3","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":15,"y":0,"z":0}],"uuid":"54fa12c1-8ff4-103f-12d0-bc5f7f4232d8","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":20,"y":0,"z":0}],"uuid":"a08c38e3-7335-2277-8904-759d3d31b582","time":0.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-5,"y":0,"z":0}],"uuid":"ef99149c-46e5-875f-4d96-09f8526042fd","time":0.3333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"688fcebb-0a6a-b5fe-201b-38bfe76ddda2","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"ac707ced-690a-2fa1-c0c6-2abddd4bee0f","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":2,"z":0}],"uuid":"597f296b-0077-a9f4-a098-9c27352d97cd","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"93a1388a-e424-f8bd-5054-eac62000e769","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"e6ebbda9-64b3-bc6f-11c8-a889976b8bd8":{"name":"rightLeg","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"74abd9e5-0153-9680-2cd8-30122acff1bf","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-15,"y":0,"z":0}],"uuid":"775fd33a-ff36-2fe3-41e1-7576e35617f5","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-20,"y":0,"z":0}],"uuid":"df2a9446-d289-1409-b614-a5e3824f4901","time":0.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":5,"y":0,"z":0}],"uuid":"26722351-d8b0-0dbe-24a2-707b608520ed","time":0.3333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"6eda2e60-3fa9-6843-1e9e-a9c8c94ac152","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"533a7380-91b5-1866-b4de-537cf49caa22","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":2,"z":0}],"uuid":"c9c7491f-2940-9cff-51b7-f3f8a5c23183","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"2e87dab6-89db-cc98-f711-c33d4434bc51","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"9f44f743-c317-b6a7-404d-9d80547e4fdb":{"name":"bag","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"e2f72faf-db93-c0a0-06f0-50acbfd89f7e","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":10,"y":0,"z":0}],"uuid":"ecc16605-b850-408f-565d-e9aeb775f217","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":15,"y":0,"z":0}],"uuid":"d2a8b668-0103-b818-f347-789f05dabfb1","time":0.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-5,"y":0,"z":0}],"uuid":"fd3248c8-56b4-8769-953b-247b5ee358fe","time":0.3333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"50bcaaa6-204e-a3aa-4aea-d47b55699cc7","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"492e2754-deb7-d08f-134e-d70259dab0d1","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":2,"z":0}],"uuid":"b3844fea-4d9e-b83b-25f0-feee279ef86b","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"2b00b14d-27a7-c131-8bf2-f45225967eb3","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"ba135b89-9ee8-7155-efbf-7cd095edee53":{"name":"body","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"63a39535-7992-ffb9-b413-9fdefc43b199","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-1,"y":0,"z":0}],"uuid":"adc19087-028d-13ae-627c-ef749b5b4fef","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":1,"y":0,"z":0}],"uuid":"6d9f4daf-ea8d-e10d-ba96-f0358b1d0fd8","time":0.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"feed89b5-6ab7-3500-07de-cb48fffa6067","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"a26179a9-17b9-e884-43d7-fd7b29958fb9","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":2,"z":0}],"uuid":"130c99a6-ad72-0883-4d49-d1b9fde1ad6c","time":0.1667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"857416d2-be89-963f-e3fc-d552f20047b7","time":0.4167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]}}},{"uuid":"bcc26bb9-6121-af56-f187-d95f289fd936","name":"give_reward","loop":"once","override":false,"length":1.5416666666666667,"snapping":24,"selected":true,"saved":true,"path":"/Users/alesfabianek/Downloads/rascal.animation.json","anim_time_update":"","blend_weight":"","start_delay":"","loop_delay":"","animators":{"133fc098-1dae-95b0-7cde-23c6f350c6c8":{"name":"head","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"49e58ef7-060e-09b5-3162-1e3b38fe5c62","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-7.5,"y":-50,"z":0}],"uuid":"8173b1e3-6850-3610-5087-f9391419bad4","time":0.375,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0],"easing":"linear"},{"channel":"rotation","data_points":[{"x":-7.5,"y":-40,"z":0}],"uuid":"f117fe51-5737-d098-376f-887fb96dc92d","time":0.4583,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"63e21710-b690-14f4-d808-ed11ddbfaef3","time":0.6667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":15,"y":0,"z":0}],"uuid":"5a846fcc-691d-1cd3-6540-6b0f2fda6c71","time":0.8333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":15,"y":0,"z":0}],"uuid":"2ca86ac1-a646-27a8-d03a-9cc329d1b71f","time":0.9583,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"5f617e2c-4daa-0c4b-38f8-c544e0c37b91","time":1.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"a48a6fbd-744a-1665-eee2-d5ed59790afb","time":1.5416666666666667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"cf6f312a-8336-20fa-13a6-afb684afd1e0","time":1.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"9325e427-5b09-6ca2-085d-c56aa11d6c95":{"name":"rightArm","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"a308f72c-d6be-228c-5ad8-f8b511f0134f","time":0,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-37.5,"y":0,"z":-20}],"uuid":"96e94fb3-8315-613b-e83e-bb50bfe48740","time":0.125,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-170,"y":0,"z":-20}],"uuid":"c433ea30-db65-356b-4b91-cde759f2183f","time":0.4583,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0],"easing":"easeInElastic"},{"channel":"rotation","data_points":[{"x":-170,"y":0,"z":-20}],"uuid":"ea446466-bf78-58ff-07dd-5c0b0845d7ae","time":0.5417,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0],"easing":"easeInElastic"},{"channel":"rotation","data_points":[{"x":-60,"y":0,"z":0}],"uuid":"82ef740b-7149-e41e-1a58-c4365d81599a","time":0.625,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-60,"y":20,"z":0}],"uuid":"58a5aa14-66b4-7f9a-64c8-2846495b34ec","time":0.75,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-60,"y":20,"z":0}],"uuid":"7cee4cd4-1dd6-ae95-7f0d-7fa24f96f1b6","time":1.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"58719358-1807-6de2-7ea6-181a78595c84","time":1.5416666666666667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-60,"y":20,"z":0}],"uuid":"9f29bdf1-aabd-ef78-66c5-520570c16749","time":1.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"94e91bec-494a-31d2-b6c9-b2da81617a0a","time":0.625,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":-2,"z":-1}],"uuid":"3586756f-5f5e-b2a2-ee56-850d4a868eed","time":0.75,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":-2,"z":-1}],"uuid":"86061ca1-41f6-90f5-7c60-a2adaa80ebd4","time":1.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"431e78a0-5fec-34ad-cfbc-a5994edd89df","time":1.5416666666666667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":-2,"z":-1}],"uuid":"639bc6db-a3c6-a813-473f-3fa5a2e2636e","time":1.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"9f44f743-c317-b6a7-404d-9d80547e4fdb":{"name":"bag","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"f6e6d089-b248-221d-7df0-096b7ebc4bf1","time":0.4583,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":5,"y":0,"z":0}],"uuid":"756e21b7-0366-2a50-044d-aecf84094338","time":0.5417,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":90,"z":0}],"uuid":"81cd931d-c61d-b78d-7489-9a16f8792c0d","time":0.625,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-30,"y":180,"z":0}],"uuid":"26521ef8-c3f3-a678-6e04-7f38d9d226b6","time":0.75,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-30,"y":180,"z":0}],"uuid":"18e1dcd5-4758-36bb-504f-aa929f5809a5","time":0.8333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-30,"y":180,"z":0}],"uuid":"c6d41636-1b14-71c6-7330-982d4997b7a8","time":1.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":90,"z":0}],"uuid":"f899f04a-93b5-c991-486f-e344a0c66b9e","time":1.375,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"8f43eabe-5cc0-fd8a-b527-efca9340afba","time":1.5416666666666667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":5,"y":0,"z":0}],"uuid":"964e7955-dfd3-e357-db7d-0e7862beaa4c","time":1.4583333333333333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-30,"y":180,"z":0}],"uuid":"84b19f0f-3e27-9e68-6214-2b7c1c2a10cd","time":1.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"9671e34b-219e-9348-ed57-210eb8f32e73","time":0.4583,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":7,"y":0,"z":-6}],"uuid":"c52be187-6a5e-157e-a9e4-4edd37e4b41e","time":0.625,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":-3,"y":-7,"z":-12}],"uuid":"60788298-e846-1906-f9aa-6849c6ec9104","time":0.75,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":-3,"y":-7,"z":-12}],"uuid":"ab97aa43-f7bf-ca9f-cccb-2624003c9bad","time":1.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":7,"y":0,"z":-6}],"uuid":"ce485e6f-73e9-caa3-81b6-0051e38b30e2","time":1.375,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"dcec27b5-fabd-256b-71a5-52004bfd6f56","time":1.5416666666666667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":-3,"y":-7,"z":-12}],"uuid":"21ff6a1c-dd05-b2b7-a956-d213e0c8e6f9","time":1.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"a0b7942c-2039-3008-d5d4-71874ab3159d":{"name":"leftArm","type":"bone","keyframes":[{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"31a52416-5b8b-2ff8-1c6c-cb9b7ffe3261","time":0.75,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-52.5,"y":0,"z":0}],"uuid":"0a82a540-e987-a54a-fc3c-831723f98629","time":0.8333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-65,"y":-30,"z":0}],"uuid":"f7e9b8a2-9cf6-2586-1a47-5ac67bcb6126","time":0.9167,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-90,"y":0,"z":0}],"uuid":"9b9a0092-aaa6-2d7f-ac83-dc6ad98bf6ea","time":1.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":0,"y":0,"z":0}],"uuid":"8ab3e61b-3787-0e68-cfa9-3cdcc7fa4121","time":1.5416666666666667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"rotation","data_points":[{"x":-90,"y":0,"z":0}],"uuid":"631fe700-be88-50aa-389f-102ba431cf21","time":1.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"dc4444ff-5e3a-06b8-c9c3-e99266b06cd5","time":0.4583,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":-0.25,"z":0}],"uuid":"4a4c2f63-0435-a266-ab4b-8e619b9a1198","time":0.5833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0],"easing":"linear"},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"38ff154f-0a7b-fa1e-afa3-6510c45f4ead","time":0.6667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"27aa9190-9d64-be7d-0f3c-d8b165314435","time":0.75,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":-2,"z":-1}],"uuid":"94718078-eff9-6604-07f8-cbb0446483b6","time":0.8333,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"b3abc752-d378-2b06-5877-43d8754b8056","time":1.5416666666666667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":-2,"z":-1}],"uuid":"b625a61b-a63f-f9f0-e593-3dd1783ead2d","time":1.25,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]},"ba135b89-9ee8-7155-efbf-7cd095edee53":{"name":"body","type":"bone","keyframes":[{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"d92ad28c-4b83-fd20-b899-cfd457b112d9","time":0.4583,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":-0.25,"z":0}],"uuid":"d00881fe-1a7e-4859-da9c-28794c53a1ff","time":0.5833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0],"easing":"linear"},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"f3a06a76-cbe6-20ab-d8f3-69d9fc46db37","time":0.6667,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"1de576d2-593a-16fd-8644-1ca2e815fb31","time":1.0833,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]},{"channel":"position","data_points":[{"x":0,"y":0,"z":0}],"uuid":"768ff7cb-2fbf-bfd8-52d9-b737bb907a59","time":1.5,"color":-1,"interpolation":"linear","bezier_linked":true,"bezier_left_time":[-0.1,-0.1,-0.1],"bezier_left_value":[0,0,0],"bezier_right_time":[0.1,0.1,0.1],"bezier_right_value":[0,0,0]}]}}}],"reference_images":[{"name":"Pasted","scope":"project","position":[960,0],"size":[653,653],"source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAE9klEQVR4nO3ZX0hbVxwH8K+ayDVktFu1mrlla5W1021SnEwRJsLcKHYrA4sbG2WFzYe+lRYGHfVBqE/t6x5a8WFI61Bpq+2EtUz2IGmRTtSl3YppZ6qN0TgFQ3JX0509pPc2N//8l+6e0u8HxHvPOffm5Pzu75x7bwAiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIjJbltkdyKTaN14S6eqH7/wt3fe1mN2B1bTUO9MOqsY9E8T+t2yrNROyBUHqAGiD/+2R99O2O3jsJ33wJxez4Z4JJm1XXmwHJAuC1AEAgC/278b03blV200uZgOIZkL74XcBALfuTBnaHLl8D5WKPfOd3ARTr4Scxro1TS8am88DZVutoUxdGAYAfL7lSQAA4MsPChKO1wLADMCTwT/xUZOh/OTUbXz32pspjzs5dRtbxxdQXL4LADDjBpbe2YbzQ/16EMbtNnRdm08aBNmYOgXV1tXjF3VB33f551BTuN1QFsvln4NY8mPRCYR/HtTLhTNiaBdylGDc59GDEB+MVHdLZmSGNGvA8K9D0f9/uFFbV79qe7XGmbIuqygf8HkAAF3X5vWMAKILcemL/yYcc+n30Ea6vWnSBKC2rl7PgEzQskAzbrcBavDxGiHPQixNALQMGB3qN5Tv+ezrDZ8z5Cgx7FsDq99N/d9MD8BodwcAIPYRqqmxRd/u7T6jbysAwnveAwCI2QCAx9PNMyzb7A4I1YGmxhZc7ByEUB0QqiOhXqgOXOwcTH78bAB5ozewkuLqtvk8+p81f3t0KpKIaRlg83kw2u0BEB3wl191ovTDvQCA6soqvd3ockSvB4C80Rv61KJd/eGifFiuDiT9DC1jNGI2gPM+j37LajbTArD823QWANjLHKK6sgoP7ntx+qsDCe20sgf3vTjVehZHj7cie3c5xJI/7flTDb5sTF8DAKD09Vc23c5ir8A5PwBLIRSXF6fazxrqj7V9o2dOyFEiTRZIEYB4vtbv9W1H2+FV2ysuLy6d60xZ39V3IaFsJTAHbCnaWAczyPR3IoozV1jsFYgEx9bU3mKvwD97q/QpaD2D33vlDEKOElgnXDhYYhx890zw+X0SDu+wweZLfABbCczBmm8sF2ri8ZN/Ta/5s6wTLgDAD57Z9XXyKTE9AKr3YZYClwi9XQNbzJOrJv5hKu/exl8ZCNUB1TttetbHkqYzijM36QuySMPHCWXxt5wWewVOt7elPPf1myPo6RtAJDgG1ftQmu8MSJABmtiBsZdVibzinVAXhvFoa2FC20cHjK8nLIMjac/d0zeA8A4brBMZ6mwGSROAePuqy9F7ZVjfV4b6odZ/AgAQS35kxQXm6PHWlOfKUnwASlLWm0naAMRbCcwhp6dD39eyIKenAxEYs0Is+Q3TlFXJzBvWp0HqAMQO+gu7PtXLl/+8YCiP3ddY7BUAgEhwLHo3JeGbUECiRTiWvazKsCDnFe9c1/HhmbsJZTIuwICkGRC8NWJYkIHoVa/Rrvr4rNDqNNrDnZYNtAGKM1cozlxR0NAsDp1oE9p+7HaqskMn2kRBQ7O+b/Z3SUa6lEyloKFZ7KsuT1p3+bob6ermr/4o7feUcgpKJfZ3AiD6gLWWOpmZ/z72OfdMBUD7PSDZ7wLp6mQm7dwYr6ChecOLqMxrwH8ii9KT6rax3QAAAABJRU5ErkJggg=="}],"geckoSettings":{"formatVersion":2,"modSDK":"Forge 1.12 - 1.16","objectType":"OBJ_TYPE_ENTITY","entityType":"Entity","javaPackage":"com.example.mod","animFileNamespace":"MODID","animFilePath":"animations/ANIMATIONFILE.json"}} \ No newline at end of file diff --git a/blockbench/rascal/rascal.animation.json b/blockbench/rascal/rascal.animation.json new file mode 100644 index 000000000..f8dde1993 --- /dev/null +++ b/blockbench/rascal/rascal.animation.json @@ -0,0 +1,215 @@ +{ + "format_version": "1.8.0", + "animations": { + "give_reward": { + "animation_length": 1.54167, + "bones": { + "head": { + "rotation": { + "0.0": { + "vector": [0, 0, 0] + }, + "0.375": { + "vector": [-7.5, -50, 0], + "easing": "linear" + }, + "0.4583": { + "vector": [-7.5, -40, 0] + }, + "0.6667": { + "vector": [0, 0, 0] + }, + "0.8333": { + "vector": [15, 0, 0] + }, + "0.9583": { + "vector": [15, 0, 0] + }, + "1.0833": { + "vector": [0, 0, 0] + }, + "1.25": { + "vector": [0, 0, 0] + }, + "1.5417": { + "vector": [0, 0, 0] + } + } + }, + "rightArm": { + "rotation": { + "0.0": { + "vector": [0, 0, 0] + }, + "0.125": { + "vector": [-37.5, 0, -20] + }, + "0.4583": { + "vector": [-170, 0, -20], + "easing": "easeInElastic" + }, + "0.5417": { + "vector": [-170, 0, -20], + "easing": "easeInElastic" + }, + "0.625": { + "vector": [-60, 0, 0] + }, + "0.75": { + "vector": [-60, 20, 0] + }, + "1.0833": { + "vector": [-60, 20, 0] + }, + "1.25": { + "vector": [-60, 20, 0] + }, + "1.5417": { + "vector": [0, 0, 0] + } + }, + "position": { + "0.625": { + "vector": [0, 0, 0] + }, + "0.75": { + "vector": [0, -2, -1] + }, + "1.0833": { + "vector": [0, -2, -1] + }, + "1.25": { + "vector": [0, -2, -1] + }, + "1.5417": { + "vector": [0, 0, 0] + } + } + }, + "bag": { + "rotation": { + "0.4583": { + "vector": [0, 0, 0] + }, + "0.5417": { + "vector": [5, 0, 0] + }, + "0.625": { + "vector": [0, 90, 0] + }, + "0.75": { + "vector": [-30, 180, 0] + }, + "0.8333": { + "vector": [-30, 180, 0] + }, + "1.0833": { + "vector": [-30, 180, 0] + }, + "1.25": { + "vector": [-30, 180, 0] + }, + "1.375": { + "vector": [0, 90, 0] + }, + "1.4583": { + "vector": [5, 0, 0] + }, + "1.5417": { + "vector": [0, 0, 0] + } + }, + "position": { + "0.4583": { + "vector": [0, 0, 0] + }, + "0.625": { + "vector": [7, 0, -6] + }, + "0.75": { + "vector": [-3, -7, -12] + }, + "1.0833": { + "vector": [-3, -7, -12] + }, + "1.25": { + "vector": [-3, -7, -12] + }, + "1.375": { + "vector": [7, 0, -6] + }, + "1.5417": { + "vector": [0, 0, 0] + } + } + }, + "leftArm": { + "rotation": { + "0.75": { + "vector": [0, 0, 0] + }, + "0.8333": { + "vector": [-52.5, 0, 0] + }, + "0.9167": { + "vector": [-65, -30, 0] + }, + "1.0833": { + "vector": [-90, 0, 0] + }, + "1.25": { + "vector": [-90, 0, 0] + }, + "1.5417": { + "vector": [0, 0, 0] + } + }, + "position": { + "0.4583": { + "vector": [0, 0, 0] + }, + "0.5833": { + "vector": [0, -0.25, 0], + "easing": "linear" + }, + "0.6667": { + "vector": [0, 0, 0] + }, + "0.75": { + "vector": [0, 0, 0] + }, + "0.8333": { + "vector": [0, -2, -1] + }, + "1.25": { + "vector": [0, -2, -1] + }, + "1.5417": { + "vector": [0, 0, 0] + } + } + }, + "body": { + "position": { + "0.4583": { + "vector": [0, 0, 0] + }, + "0.5833": { + "vector": [0, -0.25, 0], + "easing": "linear" + }, + "0.6667": { + "vector": [0, 0, 0] + }, + "1.0833": { + "vector": [0, 0, 0] + }, + "1.5": { + "vector": [0, 0, 0] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 38f1bb6dc..f1b50afcb 100644 --- a/build.gradle +++ b/build.gradle @@ -44,4 +44,4 @@ allprojects { java { withSourcesJar() } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoes.java b/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoes.java index 2c916563d..ff0ef846e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoes.java @@ -58,4 +58,4 @@ public static void postInit() { FriendsAndFoesStructureProcessorTypes.postInit(); FriendsAndFoesVillagerProfessions.postInit(); } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/ActivateZombieHorseTrapCriterion.java b/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/ActivateZombieHorseTrapCriterion.java index c079210e6..a189e700d 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/ActivateZombieHorseTrapCriterion.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/ActivateZombieHorseTrapCriterion.java @@ -66,4 +66,4 @@ public JsonObject toJson(AdvancementEntityPredicateSerializer predicateSerialize return jsonObject; } } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/CompleteHideAndSeekGameCriterion.java b/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/CompleteHideAndSeekGameCriterion.java new file mode 100644 index 000000000..ae406ae1a --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/CompleteHideAndSeekGameCriterion.java @@ -0,0 +1,71 @@ +package com.faboslav.friendsandfoes.advancements.criterion; + +import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.entity.RascalEntity; +import com.google.gson.JsonObject; +import net.minecraft.advancement.criterion.AbstractCriterion; +import net.minecraft.advancement.criterion.AbstractCriterionConditions; +import net.minecraft.loot.context.LootContext; +import net.minecraft.predicate.entity.AdvancementEntityPredicateDeserializer; +import net.minecraft.predicate.entity.AdvancementEntityPredicateSerializer; +import net.minecraft.predicate.entity.EntityPredicate; +import net.minecraft.predicate.entity.LootContextPredicate; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.Identifier; + +public final class CompleteHideAndSeekGameCriterion extends AbstractCriterion +{ + static final Identifier ID = FriendsAndFoes.makeID("complete_hide_and_seek_game"); + + public CompleteHideAndSeekGameCriterion() { + } + + public Identifier getId() { + return ID; + } + + public CompleteHideAndSeekGameCriterion.Conditions conditionsFromJson( + JsonObject jsonObject, + LootContextPredicate extended, + AdvancementEntityPredicateDeserializer advancementEntityPredicateDeserializer + ) { + LootContextPredicate extended2 = EntityPredicate.contextPredicateFromJson(jsonObject, "rascal", advancementEntityPredicateDeserializer); + + return new CompleteHideAndSeekGameCriterion.Conditions(extended, extended2); + } + + public void trigger(ServerPlayerEntity player, RascalEntity entity) { + LootContext lootContext = EntityPredicate.createAdvancementEntityLootContext(player, entity); + this.trigger(player, (conditions) -> { + return conditions.matches(lootContext); + }); + } + + public static class Conditions extends AbstractCriterionConditions + { + private final LootContextPredicate entity; + + public Conditions(LootContextPredicate player, LootContextPredicate entity) { + super(CompleteHideAndSeekGameCriterion.ID, player); + this.entity = entity; + } + + public static CompleteHideAndSeekGameCriterion.Conditions any() { + return new CompleteHideAndSeekGameCriterion.Conditions(LootContextPredicate.EMPTY, LootContextPredicate.EMPTY); + } + + public static CompleteHideAndSeekGameCriterion.Conditions create(EntityPredicate entity) { + return new CompleteHideAndSeekGameCriterion.Conditions(LootContextPredicate.EMPTY, EntityPredicate.asLootContextPredicate(entity)); + } + + public boolean matches(LootContext entityContext) { + return this.entity.test(entityContext); + } + + public JsonObject toJson(AdvancementEntityPredicateSerializer predicateSerializer) { + JsonObject jsonObject = super.toJson(predicateSerializer); + jsonObject.add("entity", this.entity.toJson(predicateSerializer)); + return jsonObject; + } + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/TameGlareCriterion.java b/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/TameGlareCriterion.java index 67618d914..701d9453f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/TameGlareCriterion.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/advancements/criterion/TameGlareCriterion.java @@ -67,4 +67,4 @@ public JsonObject toJson(AdvancementEntityPredicateSerializer predicateSerialize return jsonObject; } } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/block/CopperButtonBlock.java b/common/src/main/java/com/faboslav/friendsandfoes/block/CopperButtonBlock.java index 48967dd05..947f71240 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/block/CopperButtonBlock.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/block/CopperButtonBlock.java @@ -51,4 +51,4 @@ public ActionResult onUse( return super.onUse(state, world, pos, player, hand, hit); } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/block/ExposedCopperButtonBlock.java b/common/src/main/java/com/faboslav/friendsandfoes/block/ExposedCopperButtonBlock.java index 5916ecf1f..348baa63e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/block/ExposedCopperButtonBlock.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/block/ExposedCopperButtonBlock.java @@ -7,4 +7,4 @@ public final class ExposedCopperButtonBlock extends CopperButtonBlock public ExposedCopperButtonBlock(Settings settings) { super(settings); } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/block/Oxidizable.java b/common/src/main/java/com/faboslav/friendsandfoes/block/Oxidizable.java index 852fe9dc5..233c68351 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/block/Oxidizable.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/block/Oxidizable.java @@ -67,4 +67,4 @@ default Optional getDegradationResult(BlockState state) { default float getDegradationChanceMultiplier() { return this.getDegradationLevel() == net.minecraft.block.Oxidizable.OxidationLevel.UNAFFECTED ? 0.75F:1.0F; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/block/OxidizedCopperButtonBlock.java b/common/src/main/java/com/faboslav/friendsandfoes/block/OxidizedCopperButtonBlock.java index 6b7b7dbf3..4d6c120bf 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/block/OxidizedCopperButtonBlock.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/block/OxidizedCopperButtonBlock.java @@ -7,4 +7,4 @@ public final class OxidizedCopperButtonBlock extends CopperButtonBlock public OxidizedCopperButtonBlock(Settings settings) { super(settings); } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/block/WeatheredCopperButtonBlock.java b/common/src/main/java/com/faboslav/friendsandfoes/block/WeatheredCopperButtonBlock.java index 02de3aaf4..7c81466d9 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/block/WeatheredCopperButtonBlock.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/block/WeatheredCopperButtonBlock.java @@ -7,4 +7,4 @@ public final class WeatheredCopperButtonBlock extends CopperButtonBlock public WeatheredCopperButtonBlock(Settings settings) { super(settings); } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/ModelAnimator.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/ModelAnimator.java new file mode 100644 index 000000000..b515584f1 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/ModelAnimator.java @@ -0,0 +1,233 @@ +package com.faboslav.friendsandfoes.client.render.entity.animation; + +import com.faboslav.friendsandfoes.client.render.entity.animation.animator.ModelPartAnimationType; +import com.faboslav.friendsandfoes.client.render.entity.animation.animator.ModelPartAnimator; +import com.faboslav.friendsandfoes.client.render.entity.animation.animator.context.AnimationContextTracker; +import com.faboslav.friendsandfoes.client.render.entity.animation.animator.context.ModelPartAnimationContext; +import com.faboslav.friendsandfoes.entity.animation.AnimatedEntity; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.model.ModelPart; +import net.minecraft.entity.Entity; +import org.joml.Vector3f; + +@Environment(EnvType.CLIENT) +public final class ModelAnimator +{ + AnimatedEntity entity; + + public void setEntity(AnimatedEntity entity) { + this.entity = entity; + } + + public void animateXPositionWithProgress(ModelPart modelPart, float targetX, float progress) { + this.animatePositionWithProgress(modelPart, targetX, modelPart.pivotY, modelPart.pivotZ, progress); + } + + public void animateYPositionWithProgress(ModelPart modelPart, float targetY, float progress) { + this.animatePositionWithProgress(modelPart, modelPart.pivotX, targetY, modelPart.pivotZ, progress); + } + + public void animateZPositionWithProgress(ModelPart modelPart, float targetZ, float progress) { + this.animatePositionWithProgress(modelPart, modelPart.pivotX, modelPart.pivotY, targetZ, progress); + } + + public void animatePositionWithProgress( + ModelPart modelPart, + float targetX, + float targetY, + float targetZ, + float progress + ) { + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); + this.animateWithProgress(modelPart, ModelPartAnimationType.POSITION, targetVector, progress); + } + + public void animateXRotationWithProgress(ModelPart modelPart, float targetX, float progress) { + this.animateRotationWithProgress(modelPart, targetX, modelPart.yaw, modelPart.roll, progress); + } + + public void animateYRotationWithProgress(ModelPart modelPart, float targetY, float progress) { + this.animateRotationWithProgress(modelPart, modelPart.pitch, targetY, modelPart.roll, progress); + } + + public void animateZRotationWithProgress(ModelPart modelPart, float targetX, float progress) { + this.animateRotationWithProgress(modelPart, targetX, modelPart.yaw, modelPart.roll, progress); + } + + public void animateRotationWithProgress( + ModelPart modelPart, + float targetX, + float targetY, + float targetZ, + float progress + ) { + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); + this.animateWithProgress(modelPart, ModelPartAnimationType.ROTATION, targetVector, progress); + } + + private void animateWithProgress( + ModelPart modelPart, + ModelPartAnimationType animationType, + Vector3f targetVector, + float progress + ) { + String modelPartName = modelPart.toString(); + ModelPartAnimationContext animationContext; + Vector3f animationCurrentVector; + Vector3f animationTargetVector; + + if (this.getAnimationContextTracker().contains(modelPartName, animationType)) { + animationContext = this.getAnimationContextTracker().get(modelPartName, animationType); + animationCurrentVector = animationContext.getCurrentVector(); + animationTargetVector = animationContext.getTargetVector(); + + if (animationTargetVector.equals(targetVector) == false) { + this.getAnimationContextTracker().remove(modelPartName, animationType); + animationContext = ModelPartAnimationContext.createWithProgress( + progress, + targetVector, + animationCurrentVector + ); + this.getAnimationContextTracker().add(modelPartName, animationType, animationContext); + } + } else { + animationCurrentVector = switch (animationType) { + case POSITION -> new Vector3f(modelPart.pivotX, modelPart.pivotY, modelPart.pivotZ); + case ROTATION -> new Vector3f(modelPart.pitch, modelPart.yaw, modelPart.roll); + }; + + animationContext = ModelPartAnimationContext.createWithProgress( + progress, + targetVector, + animationCurrentVector + ); + this.getAnimationContextTracker().add(modelPartName, animationType, animationContext); + } + + animationContext.setProgress(progress); + animationContext.recalculateCurrentVector(); + animationCurrentVector = animationContext.getCurrentVector(); + + switch (animationType) { + case POSITION -> ModelPartAnimator.setPosition(modelPart, animationCurrentVector); + case ROTATION -> ModelPartAnimator.setRotation(modelPart, animationCurrentVector); + } + } + + public void animateXPositionOverTicks(ModelPart modelPart, float targetX, int ticks) { + this.animatePositionOverTicks(modelPart, targetX, modelPart.pivotY, modelPart.pivotZ, ticks); + } + + public void animateYPositionOverTicks(ModelPart modelPart, float targetY, int ticks) { + this.animatePositionOverTicks(modelPart, modelPart.pivotX, targetY, modelPart.pivotZ, ticks); + } + + public void animateZPositionOverTicks(ModelPart modelPart, float targetX, int ticks) { + this.animatePositionOverTicks(modelPart, targetX, modelPart.pivotY, modelPart.pivotZ, ticks); + } + + public void animatePositionOverTicks( + ModelPart modelPart, + float targetX, + float targetY, + float targetZ, + int ticks + ) { + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); + this.animateOverTicks(modelPart, ModelPartAnimationType.POSITION, targetVector, ticks); + } + + public void animateXRotationOverTicks(ModelPart modelPart, float targetX, int ticks) { + this.animateRotationOverTicks(modelPart, targetX, modelPart.yaw, modelPart.roll, ticks); + } + + public void animateYRotationOverTicks(ModelPart modelPart, float targetY, int ticks) { + this.animateRotationOverTicks(modelPart, modelPart.pitch, targetY, modelPart.roll, ticks); + } + + public void animateZRotationOverTicks(ModelPart modelPart, float targetZ, int ticks) { + this.animateRotationOverTicks(modelPart, modelPart.yaw, modelPart.roll, targetZ, ticks); + } + + public void animateRotationOverTicks( + ModelPart modelPart, + float targetX, + float targetY, + float targetZ, + int ticks + ) { + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); + this.animateOverTicks(modelPart, ModelPartAnimationType.ROTATION, targetVector, ticks); + } + + private void animateOverTicks( + ModelPart modelPart, + ModelPartAnimationType animationType, + Vector3f targetVector, + int ticks + ) { + String modelPartName = modelPart.toString(); + ModelPartAnimationContext animationContext; + Vector3f currentVector; + Vector3f animationTargetVector; + + if (this.getAnimationContextTracker().contains(modelPartName, animationType)) { + animationContext = this.getAnimationContextTracker().get(modelPartName, animationType); + currentVector = animationContext.getCurrentVector(); + + if (currentVector.equals(targetVector)) { + switch (animationType) { + case POSITION -> ModelPartAnimator.setPosition(modelPart, targetVector); + case ROTATION -> ModelPartAnimator.setRotation(modelPart, targetVector); + } + + return; + } + + animationTargetVector = animationContext.getTargetVector(); + + if (animationTargetVector.equals(targetVector) == false) { + this.getAnimationContextTracker().remove(modelPartName, animationType); + animationContext = ModelPartAnimationContext.createWithTicks( + this.getEntityCurrentTick(), + ticks, + targetVector, + currentVector + ); + this.getAnimationContextTracker().add(modelPartName, animationType, animationContext); + } + } else { + currentVector = switch (animationType) { + case POSITION -> new Vector3f(modelPart.pivotX, modelPart.pivotY, modelPart.pivotZ); + case ROTATION -> new Vector3f(modelPart.pitch, modelPart.yaw, modelPart.roll); + }; + + animationContext = ModelPartAnimationContext.createWithTicks( + this.getEntityCurrentTick(), + ticks, + targetVector, + currentVector + ); + this.getAnimationContextTracker().add(modelPartName, animationType, animationContext); + } + + animationContext.setCurrentTick(this.getEntityCurrentTick()); + animationContext.recalculateProgress(); + animationContext.recalculateCurrentVector(); + currentVector = animationContext.getCurrentVector(); + + switch (animationType) { + case POSITION -> ModelPartAnimator.setPosition(modelPart, currentVector); + case ROTATION -> ModelPartAnimator.setRotation(modelPart, currentVector); + } + } + + private AnimationContextTracker getAnimationContextTracker() { + return this.entity.getAnimationContextTracker(); + } + + private int getEntityCurrentTick() { + return ((Entity) this.entity).age; + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/RascalAnimations.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/RascalAnimations.java new file mode 100644 index 000000000..7e1757046 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/RascalAnimations.java @@ -0,0 +1,303 @@ +package com.faboslav.friendsandfoes.client.render.entity.animation; + +import com.faboslav.friendsandfoes.entity.animation.Animation; +import com.faboslav.friendsandfoes.entity.animation.Keyframe; +import com.faboslav.friendsandfoes.entity.animation.Transformation; +import com.faboslav.friendsandfoes.entity.animation.VectorHelper; + +import java.util.ArrayList; + +public final class RascalAnimations +{ + public static final KeyframeAnimation DEFAULT; + public static final KeyframeAnimation NOD; + public static final KeyframeAnimation GIVE_REWARD; + public static final ArrayList ANIMATIONS; + + public RascalAnimations() { + } + + static { + DEFAULT = new KeyframeAnimation("default", Animation.Builder.create(0.0f).build()); + NOD = new KeyframeAnimation("nod", Animation.Builder.create(0.4167f) + .addBoneAnimation("head", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createTranslationalVector(0f, 2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("head", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.0833f, VectorHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createRotationalVector(20f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, VectorHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("leftArm", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createTranslationalVector(0f, 2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("leftArm", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createRotationalVector(-15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, VectorHelper.createRotationalVector(-25f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.3333f, VectorHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("rightArm", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createTranslationalVector(0f, 2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("rightArm", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, VectorHelper.createRotationalVector(25f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.3333f, VectorHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("leftLeg", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createTranslationalVector(0f, 2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("leftLeg", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, VectorHelper.createRotationalVector(20f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.3333f, VectorHelper.createRotationalVector(-5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("rightLeg", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createTranslationalVector(0f, 2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("rightLeg", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createRotationalVector(-15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, VectorHelper.createRotationalVector(-20f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.3333f, VectorHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("bag", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createTranslationalVector(0f, 2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("bag", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, VectorHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.3333f, VectorHelper.createRotationalVector(-5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("body", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createTranslationalVector(0f, 2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("body", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.1667f, VectorHelper.createRotationalVector(-1f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, VectorHelper.createRotationalVector(1f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))).build() + ); + GIVE_REWARD = new KeyframeAnimation("giveReward", Animation.Builder.create(1.5416767f) + .addBoneAnimation("head", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.375f, VectorHelper.createRotationalVector(-7.5f, -50f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4583f, VectorHelper.createRotationalVector(-7.5f, -40f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.6667f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.8333f, VectorHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.9583f, VectorHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0833f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("rightArm", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0.625f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.75f, VectorHelper.createTranslationalVector(0f, -2f, -1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0833f, VectorHelper.createTranslationalVector(0f, -2f, -1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, VectorHelper.createTranslationalVector(0f, -2f, -1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("rightArm", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.125f, VectorHelper.createRotationalVector(-37.5f, 0f, -20f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4583f, VectorHelper.createRotationalVector(-170f, 0f, -20f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5417f, VectorHelper.createRotationalVector(-170f, 0f, -20f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.625f, VectorHelper.createRotationalVector(-60f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.75f, VectorHelper.createRotationalVector(-60f, 20f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0833f, VectorHelper.createRotationalVector(-60f, 20f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, VectorHelper.createRotationalVector(-60f, 20f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("bag", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0.4583f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.625f, VectorHelper.createTranslationalVector(7f, 0f, -6f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.75f, VectorHelper.createTranslationalVector(-3f, -7f, -12f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0833f, VectorHelper.createTranslationalVector(-3f, -7f, -12f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, VectorHelper.createTranslationalVector(-3f, -7f, -12f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.375f, VectorHelper.createTranslationalVector(7f, 0f, -6f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("bag", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0.4583f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5417f, VectorHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.625f, VectorHelper.createRotationalVector(0f, 90f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.75f, VectorHelper.createRotationalVector(-30f, 180f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.8333f, VectorHelper.createRotationalVector(-30f, 180f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0833f, VectorHelper.createRotationalVector(-30f, 180f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, VectorHelper.createRotationalVector(-30f, 180f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.375f, VectorHelper.createRotationalVector(0f, 90f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.4583433f, VectorHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("leftArm", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0.4583f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5833f, VectorHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.6667f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.75f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.8333f, VectorHelper.createTranslationalVector(0f, -2f, -1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, VectorHelper.createTranslationalVector(0f, -2f, -1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("leftArm", + new Transformation(Transformation.Type.ROTATE, + new Keyframe(0.75f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.8333f, VectorHelper.createRotationalVector(-52.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.9167f, VectorHelper.createRotationalVector(-65f, -30f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0833f, VectorHelper.createRotationalVector(-90f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, VectorHelper.createRotationalVector(-90f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, VectorHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("body", + new Transformation(Transformation.Type.TRANSLATE, + new Keyframe(0.4583f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5833f, VectorHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.6667f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0833f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, VectorHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))).build() + ); + ANIMATIONS = new ArrayList<>() + {{ + add(DEFAULT); + add(NOD); + add(GIVE_REWARD); + }}; + } +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelAnimator.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelAnimator.java index 947353648..5b8a38b2e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelAnimator.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelAnimator.java @@ -14,7 +14,7 @@ import net.minecraft.entity.AnimationState; import net.minecraft.entity.Entity; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3f; +import org.joml.Vector3f; import java.util.Iterator; import java.util.List; @@ -39,7 +39,7 @@ public static void updateKeyframeAnimations( animationState.update(animationProgress, 1.0F); animationState.run((state) -> { - animateKeyframe(animatedEntityModel, animation, state.getTimeRunning(), 1.0F, new Vec3f()); + animateKeyframe(animatedEntityModel, animation, state.getTimeRunning(), 1.0F, new Vector3f()); }); } @@ -48,7 +48,7 @@ public static void animateKeyframe( Animation animation, long runningTime, float f, - Vec3f vec3f + Vector3f vec3f ) { float g = getRunningSeconds(animation, runningTime); Iterator var7 = animation.boneAnimations().entrySet().iterator(); @@ -145,7 +145,7 @@ public static void animateModelPartPositionWithProgress( float targetZ, float progress ) { - Vec3f targetVector = new Vec3f(targetX, targetY, targetZ); + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); animateWithProgress( animatedEntity, modelPart, @@ -211,7 +211,7 @@ public static void animateModelPartRotationBasedOnProgress( float targetZ, float progress ) { - Vec3f targetVector = new Vec3f(targetX, targetY, targetZ); + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); animateWithProgress( animatedEntity, modelPart, @@ -225,14 +225,14 @@ private static void animateWithProgress( AnimatedEntity animatedEntity, ModelPart modelPart, ModelPartAnimationType animationType, - Vec3f targetVector, + Vector3f targetVector, float progress ) { AnimationContextTracker animationContextTracker = animatedEntity.getAnimationContextTracker(); String modelPartName = modelPart.toString(); ModelPartAnimationContext animationContext; - Vec3f animationCurrentVector; - Vec3f animationTargetVector; + Vector3f animationCurrentVector; + Vector3f animationTargetVector; if (animationContextTracker.contains(modelPartName, animationType)) { animationContext = animationContextTracker.get(modelPartName, animationType); @@ -250,8 +250,8 @@ private static void animateWithProgress( } } else { animationCurrentVector = switch (animationType) { - case POSITION -> new Vec3f(modelPart.pivotX, modelPart.pivotY, modelPart.pivotZ); - case ROTATION -> new Vec3f(modelPart.pitch, modelPart.yaw, modelPart.roll); + case POSITION -> new Vector3f(modelPart.pivotX, modelPart.pivotY, modelPart.pivotZ); + case ROTATION -> new Vector3f(modelPart.pitch, modelPart.yaw, modelPart.roll); }; animationContext = ModelPartAnimationContext.createWithProgress( @@ -328,7 +328,7 @@ public static void animateModelPartModelPartPositionBasedOnTicks( float targetZ, int ticks ) { - Vec3f targetVector = new Vec3f(targetX, targetY, targetZ); + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); animateModelPartBasedOnTicks( animatedEntity, modelPart, @@ -394,7 +394,7 @@ public static void animateModelPartRotationBasedOnTicks( float targetZ, int ticks ) { - Vec3f targetVector = new Vec3f(targetX, targetY, targetZ); + Vector3f targetVector = new Vector3f(targetX, targetY, targetZ); animateModelPartBasedOnTicks( animatedEntity, modelPart, @@ -408,7 +408,7 @@ private static void animateModelPartBasedOnTicks( AnimatedEntity animatedEntity, ModelPart modelPart, ModelPartAnimationType animationType, - Vec3f targetVector, + Vector3f targetVector, int ticks ) { AnimationContextTracker animationContextTracker = animatedEntity.getAnimationContextTracker(); @@ -416,8 +416,8 @@ private static void animateModelPartBasedOnTicks( String modelPartName = modelPart.toString(); ModelPartAnimationContext animationContext; - Vec3f currentVector; - Vec3f animationTargetVector; + Vector3f currentVector; + Vector3f animationTargetVector; if (animationContextTracker.contains(modelPartName, animationType)) { animationContext = animationContextTracker.get(modelPartName, animationType); @@ -446,8 +446,8 @@ private static void animateModelPartBasedOnTicks( } } else { currentVector = switch (animationType) { - case POSITION -> new Vec3f(modelPart.pivotX, modelPart.pivotY, modelPart.pivotZ); - case ROTATION -> new Vec3f(modelPart.pitch, modelPart.yaw, modelPart.roll); + case POSITION -> new Vector3f(modelPart.pivotX, modelPart.pivotY, modelPart.pivotZ); + case ROTATION -> new Vector3f(modelPart.pitch, modelPart.yaw, modelPart.roll); }; animationContext = ModelPartAnimationContext.createWithTicks( diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelPartAnimator.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelPartAnimator.java index 01fa201c7..44dc15c23 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelPartAnimator.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/ModelPartAnimator.java @@ -3,7 +3,7 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.model.ModelPart; -import net.minecraft.util.math.Vec3f; +import org.joml.Vector3f; @Environment(EnvType.CLIENT) public final class ModelPartAnimator @@ -22,9 +22,9 @@ public static void setZPosition(ModelPart modelPart, float z) { public static void setPosition( ModelPart modelPart, - Vec3f position + Vector3f position ) { - modelPart.setPivot(position.getX(), position.getY(), position.getZ()); + modelPart.setPivot(position.x(), position.y(), position.z()); } public static void setXRotation(ModelPart modelPart, float x) { @@ -41,8 +41,8 @@ public static void setZRotation(ModelPart modelPart, float z) { public static void setRotation( ModelPart modelPart, - Vec3f rotation + Vector3f rotation ) { - modelPart.setAngles(rotation.getX(), rotation.getY(), rotation.getZ()); + modelPart.setAngles(rotation.x(), rotation.y(), rotation.z()); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java index 2f7b6716c..c98fcd2f0 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java @@ -13,7 +13,13 @@ public final class AnimationContextTracker private final Map animationRotationContext = new HashMap<>(); public KeyframeAnimationContext get(KeyframeAnimation keyframeAnimation) { - return this.animationKeyframeContext.get(keyframeAnimation.getName()); + KeyframeAnimationContext keyframeAnimationContext = this.animationKeyframeContext.get(keyframeAnimation.getName()); + + if (keyframeAnimationContext == null) { + throw new RuntimeException(String.format("Keyframe animation '%s' is not added.", keyframeAnimation.getName())); + } + + return keyframeAnimationContext; } public void add(KeyframeAnimation keyframeAnimation) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/ModelPartAnimationContext.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/ModelPartAnimationContext.java index 93a8fca26..4587d679a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/ModelPartAnimationContext.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/ModelPartAnimationContext.java @@ -3,7 +3,7 @@ import com.faboslav.friendsandfoes.util.animation.AnimationMath; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.util.math.Vec3f; +import org.joml.Vector3f; @Environment(EnvType.CLIENT) public final class ModelPartAnimationContext @@ -12,8 +12,8 @@ public final class ModelPartAnimationContext private final int totalTicks; private int currentTick; - private final Vec3f targetVector; - private final Vec3f currentVector; + private final Vector3f targetVector; + private Vector3f currentVector; private float progress; @@ -21,8 +21,8 @@ private ModelPartAnimationContext( int initialTick, int totalTicks, float progress, - Vec3f targetVector, - Vec3f currentVector + Vector3f targetVector, + Vector3f currentVector ) { this.initialTick = initialTick; this.totalTicks = totalTicks; @@ -35,8 +35,8 @@ private ModelPartAnimationContext( public static ModelPartAnimationContext createWithTicks( int initialTick, int totalTicks, - Vec3f targetVector, - Vec3f currentVector + Vector3f targetVector, + Vector3f currentVector ) { return new ModelPartAnimationContext( initialTick, @@ -49,8 +49,8 @@ public static ModelPartAnimationContext createWithTicks( public static ModelPartAnimationContext createWithProgress( float progress, - Vec3f targetVector, - Vec3f currentVector + Vector3f targetVector, + Vector3f currentVector ) { return new ModelPartAnimationContext( 0, @@ -74,16 +74,16 @@ public void setProgress(float progress) { this.progress = progress; } - public Vec3f getCurrentVector() { + public Vector3f getCurrentVector() { return currentVector; } - public Vec3f getTargetVector() { + public Vector3f getTargetVector() { return targetVector; } public void recalculateCurrentVector() { - this.currentVector.set( + this.currentVector = new Vector3f( recalculateCurrentX(), recalculateCurrentY(), recalculateCurrentZ() @@ -91,20 +91,20 @@ public void recalculateCurrentVector() { } private float recalculateCurrentX() { - return this.calculateNewValue(this.currentVector.getX(), this.targetVector.getX()); + return this.calculateNewValue(this.currentVector.x(), this.targetVector.x()); } private float recalculateCurrentY() { - return this.calculateNewValue(this.currentVector.getY(), this.targetVector.getY()); + return this.calculateNewValue(this.currentVector.y(), this.targetVector.y()); } private float recalculateCurrentZ() { - return this.calculateNewValue(this.currentVector.getZ(), this.targetVector.getZ()); + return this.calculateNewValue(this.currentVector.z(), this.targetVector.z()); } private float calculateNewValue( - float currentValue, - float targetValue + double currentValue, + double targetValue ) { return AnimationMath.lerp(this.progress, currentValue, targetValue); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/CapeFeatureRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/CapeFeatureRenderer.java index 535c7bb00..86df0f45c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/CapeFeatureRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/CapeFeatureRenderer.java @@ -74,4 +74,4 @@ public void render( } } } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/Deadmau5FeatureRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/Deadmau5FeatureRenderer.java index 02efbe08e..0b5ed544c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/Deadmau5FeatureRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/feature/Deadmau5FeatureRenderer.java @@ -52,4 +52,4 @@ public void render( } } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/AnimatedEntityModel.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/AnimatedEntityModel.java index d62f79e2e..50ce46c86 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/AnimatedEntityModel.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/AnimatedEntityModel.java @@ -288,4 +288,13 @@ public static void animateModelPartRotationBasedOnTicks( ticks ); } + + protected void updateKeyframeAnimations( + AnimatedEntity animatedEntity, + float animationProgress + ) { + animatedEntity.getAnimations().forEach((keyframeAnimation -> { + ModelAnimator.updateKeyframeAnimations(animatedEntity, this, keyframeAnimation, animationProgress); + })); + } } \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/RascalEntityModel.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/RascalEntityModel.java new file mode 100644 index 000000000..8919c16f7 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/RascalEntityModel.java @@ -0,0 +1,93 @@ +package com.faboslav.friendsandfoes.client.render.entity.model; + +import com.faboslav.friendsandfoes.entity.RascalEntity; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.model.*; +import net.minecraft.util.math.MathHelper; + +@Environment(EnvType.CLIENT) +public final class RascalEntityModel extends AnimatedEntityModel +{ + private static final String MODEL_PART_HEAD = "head"; + private static final String MODEL_PART_BODY = "body"; + private static final String MODEL_PART_BAG = "bag"; + private static final String MODEL_PART_LEFT_ARM = "leftArm"; + private static final String MODEL_PART_RIGHT_ARM = "rightArm"; + private static final String MODEL_PART_LEFT_LEG = "leftLeg"; + private static final String MODEL_PART_RIGHT_LEG = "rightLeg"; + + private final ModelPart head; + private final ModelPart body; + private final ModelPart bag; + private final ModelPart leftArm; + private final ModelPart rightArm; + private final ModelPart leftLeg; + private final ModelPart rightLeg; + + public RascalEntityModel(ModelPart root) { + super(root); + this.head = this.root.getChild(MODEL_PART_HEAD); + this.body = this.root.getChild(MODEL_PART_BODY); + this.bag = this.root.getChild(MODEL_PART_BAG); + this.leftArm = this.root.getChild(MODEL_PART_LEFT_ARM); + this.rightArm = this.root.getChild(MODEL_PART_RIGHT_ARM); + this.leftLeg = this.root.getChild(MODEL_PART_LEFT_LEG); + this.rightLeg = this.root.getChild(MODEL_PART_RIGHT_LEG); + } + + public static TexturedModelData getTexturedModelData() { + ModelData modelData = new ModelData(); + ModelPartData root = modelData.getRoot(); + + root.addChild(MODEL_PART_HEAD, ModelPartBuilder.create().uv(0, 52).cuboid(-4.0F, -2.0F, -5.0F, 8.0F, 6.0F, 6.0F, new Dilation(0.0F)) + .uv(28, 36).cuboid(-4.0F, -3.0F, -5.0F, 8.0F, 9.0F, 6.0F, new Dilation(0.5F)), ModelTransform.pivot(0.0F, 9.0F, -5.0F)); + root.addChild(MODEL_PART_BODY, ModelPartBuilder.create().uv(0, 0).cuboid(-6.0F, 0.0F, -4.0F, 12.0F, 15.0F, 8.0F, new Dilation(-0.01F)) + .uv(0, 23).cuboid(-6.0F, 12.0F, -4.0F, 12.0F, 5.0F, 8.0F, new Dilation(-0.5F)) + .uv(44, 0).cuboid(3.0F, 0.0F, -4.0F, 2.0F, 15.0F, 8.0F, new Dilation(0.5F)), ModelTransform.pivot(0.0F, 4.0F, 0.0F)); + root.addChild(MODEL_PART_BAG, ModelPartBuilder.create().uv(0, 36).cuboid(-4.0F, -0.5F, -0.5F, 8.0F, 9.0F, 6.0F, new Dilation(0.0F)), ModelTransform.pivot(3.0F, 7.5F, 4.5F)); + root.addChild(MODEL_PART_LEFT_ARM, ModelPartBuilder.create().uv(50, 28).mirrored().cuboid(-3.0F, -2.0F, -2.0F, 3.0F, 10.0F, 4.0F, new Dilation(0.0F)).mirrored(false), ModelTransform.pivot(-6.0F, 11.0F, 0.0F)); + root.addChild(MODEL_PART_RIGHT_ARM, ModelPartBuilder.create().uv(50, 28).cuboid(0.0F, -2.0F, -2.0F, 3.0F, 10.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(6.0F, 11.0F, 0.0F)); + root.addChild(MODEL_PART_LEFT_LEG, ModelPartBuilder.create().uv(28, 54).mirrored().cuboid(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)).mirrored(false), ModelTransform.pivot(-3.0F, 18.0F, 0.0F)); + root.addChild(MODEL_PART_RIGHT_LEG, ModelPartBuilder.create().uv(28, 54).cuboid(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(3.0F, 18.0F, 0.0F)); + + return TexturedModelData.of(modelData, 64, 64); + } + + @Override + public void animateModel( + T rascal, + float limbAngle, + float limbDistance, + float tickDelta + ) { + this.updateAnimations(rascal, limbAngle, limbDistance); + } + + @Override + public void setAngles( + T rascal, + float limbAngle, + float limbDistance, + float animationProgress, + float headYaw, + float headPitch + ) { + this.updateKeyframeAnimations(rascal, animationProgress); + } + + private void updateAnimations( + T rascal, + float limbAngle, + float limbDistance + ) { + this.applyModelTransforms(MODEL_PART_ROOT, this.root); + + this.rightLeg.pitch = -2.0F * MathHelper.wrap(limbAngle, 13.0F) * limbDistance; + this.leftLeg.pitch = 2.0F * MathHelper.wrap(limbAngle, 13.0F) * limbDistance; + this.rightLeg.yaw = 0.0F; + this.leftLeg.yaw = 0.0F; + this.leftArm.pitch = (-0.2F + 2.0F * MathHelper.wrap(limbAngle, 13.0F)) * limbDistance; + this.rightArm.pitch = (-0.2F - 2.0F * MathHelper.wrap(limbAngle, 13.0F)) * limbDistance; + } +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/TuffGolemEntityModel.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/TuffGolemEntityModel.java index 33664758b..d3209234a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/TuffGolemEntityModel.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/model/TuffGolemEntityModel.java @@ -1,7 +1,5 @@ package com.faboslav.friendsandfoes.client.render.entity.model; -import com.faboslav.friendsandfoes.client.render.entity.animation.TuffGolemAnimations; -import com.faboslav.friendsandfoes.client.render.entity.animation.animator.ModelAnimator; import com.faboslav.friendsandfoes.entity.TuffGolemEntity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; @@ -105,13 +103,4 @@ private void updateAnimations( this.rightArm.pitch = (-0.2F - 2.0F * MathHelper.wrap(limbAngle, 13.0F)) * limbDistance; } } - - private void updateKeyframeAnimations( - T tuffGolem, - float animationProgress - ) { - TuffGolemAnimations.ANIMATIONS.forEach((keyframeAnimation -> { - ModelAnimator.updateKeyframeAnimations(tuffGolem, this, keyframeAnimation, animationProgress); - })); - } } \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/IceologerIceChunkRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/IceologerIceChunkRenderer.java index a54c32438..a996bd5f4 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/IceologerIceChunkRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/IceologerIceChunkRenderer.java @@ -57,5 +57,4 @@ public void render( public Identifier getTexture(IceologerIceChunkEntity entity) { return TEXTURE; } -} - +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/PlayerIllusionEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/PlayerIllusionEntityRenderer.java index 1fd82a352..7f8ca23e4 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/PlayerIllusionEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/PlayerIllusionEntityRenderer.java @@ -214,4 +214,4 @@ protected void setupTransforms( } } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/RascalEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/RascalEntityRenderer.java new file mode 100644 index 000000000..699228444 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/renderer/RascalEntityRenderer.java @@ -0,0 +1,25 @@ +package com.faboslav.friendsandfoes.client.render.entity.renderer; + +import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.client.render.entity.model.RascalEntityModel; +import com.faboslav.friendsandfoes.entity.RascalEntity; +import com.faboslav.friendsandfoes.init.FriendsAndFoesEntityModelLayer; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.render.entity.EntityRendererFactory; +import net.minecraft.client.render.entity.MobEntityRenderer; +import net.minecraft.util.Identifier; + +@Environment(EnvType.CLIENT) +@SuppressWarnings({"rawtypes", "unchecked"}) +public final class RascalEntityRenderer extends MobEntityRenderer> +{ + public RascalEntityRenderer(EntityRendererFactory.Context context) { + super(context, new RascalEntityModel(context.getPart(FriendsAndFoesEntityModelLayer.RASCAL_LAYER)), 0.5F); + } + + @Override + public Identifier getTexture(RascalEntity entity) { + return FriendsAndFoes.makeID("textures/entity/rascal/rascal.png"); + } +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/config/FriendsAndFoesConfig.java b/common/src/main/java/com/faboslav/friendsandfoes/config/FriendsAndFoesConfig.java index 1cbf7e65f..97550698a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/config/FriendsAndFoesConfig.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/config/FriendsAndFoesConfig.java @@ -1,9 +1,9 @@ package com.faboslav.friendsandfoes.config; -import com.faboslav.friendsandfoes.FriendsAndFoes; -import com.faboslav.friendsandfoes.config.annotation.Category; -import com.faboslav.friendsandfoes.config.annotation.Description; -import com.faboslav.friendsandfoes.config.omegaconfig.api.Config; + import com.faboslav.friendsandfoes.FriendsAndFoes; + import com.faboslav.friendsandfoes.config.annotation.Category; + import com.faboslav.friendsandfoes.config.annotation.Description; + import com.faboslav.friendsandfoes.config.omegaconfig.api.Config; public final class FriendsAndFoesConfig implements Config { @@ -132,6 +132,13 @@ public final class FriendsAndFoesConfig implements Config @Description("Enable trap") public boolean enableZombieHorseTrap = true; + @Category("Rascal") + @Description("Enable rascal") + public boolean enableRascal = true; + + @Description("Enable rascal spawn") + public boolean enableRascalSpawn = true; + @Category("Tuff Golem") @Description("Enable tuff golem") public boolean enableTuffGolem = true; @@ -157,4 +164,4 @@ public final class FriendsAndFoesConfig implements Config public String getName() { return FriendsAndFoes.MOD_ID; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/CopperGolemEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/CopperGolemEntity.java index 1f5e7f8db..9aadeab3f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/CopperGolemEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/CopperGolemEntity.java @@ -5,6 +5,7 @@ import com.faboslav.friendsandfoes.entity.ai.goal.coppergolem.*; import com.faboslav.friendsandfoes.entity.animation.AnimatedEntity; import com.faboslav.friendsandfoes.init.FriendsAndFoesSoundEvents; +import com.faboslav.friendsandfoes.mixin.LimbAnimatorAccessor; import com.faboslav.friendsandfoes.util.ModelAnimationHelper; import net.minecraft.block.BlockState; import net.minecraft.block.Oxidizable; @@ -31,11 +32,11 @@ import net.minecraft.particle.ParticleTypes; import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.recipe.Ingredient; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; -import net.minecraft.tag.BlockTags; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; @@ -121,7 +122,6 @@ public CopperGolemEntity( World world ) { super(entityType, world); - this.stepHeight = 0.3F; } @Override @@ -208,9 +208,9 @@ public void applyEntitySnapshot() { this.headYaw = this.prevHeadYaw; this.lastHandSwingProgress = entitySnapshot.getFloat("lastHandSwingProgress"); this.handSwingProgress = this.lastHandSwingProgress; - this.lastLimbDistance = entitySnapshot.getFloat("lastLimbDistance"); - this.limbDistance = this.lastLimbDistance; - this.limbAngle = entitySnapshot.getFloat("limbAngle"); + ((LimbAnimatorAccessor) this.limbAnimator).setPrevSpeed(entitySnapshot.getFloat("limbAnimatorPrevSpeed")); + this.limbAnimator.setSpeed(entitySnapshot.getFloat("limbAnimatorSpeed")); + ((LimbAnimatorAccessor) this.limbAnimator).setPos(entitySnapshot.getFloat("limbAnimatorPos")); this.prevLookDirection = entitySnapshot.getFloat("prevLookDirection"); this.lookDirection = this.prevLookDirection; this.age = entitySnapshot.getInt("age"); @@ -266,7 +266,7 @@ protected void playStepSound( ) { if ( this.isOxidized() - || state.getMaterial().isLiquid() + || state.isLiquid() ) { return; } @@ -286,7 +286,7 @@ public boolean damage( if ( attacker == null || attacker instanceof LightningEntity - || source == DamageSource.SWEET_BERRY_BUSH + || source == this.getDamageSources().sweetBerryBush() ) { return false; } @@ -301,9 +301,9 @@ public boolean damage( if (this.isOxidized()) { NbtCompound entitySnapshot = this.getEntitySnapshot(); - this.lastLimbDistance = entitySnapshot.getFloat("lastLimbDistance"); - this.limbDistance = this.lastLimbDistance; - this.limbAngle = entitySnapshot.getFloat("limbAngle"); + ((LimbAnimatorAccessor) this.limbAnimator).setPrevSpeed(entitySnapshot.getFloat("limbAnimatorPrevSpeed")); + this.limbAnimator.setSpeed(entitySnapshot.getFloat("limbAnimatorSpeed")); + ((LimbAnimatorAccessor) this.limbAnimator).setPos(entitySnapshot.getFloat("limbAnimatorPos")); } return damageResult; @@ -445,7 +445,7 @@ public void tick() { if (this.getRandom().nextFloat() < SPARK_CHANCE) { for (int i = 0; i < 7; i++) { - ((ServerWorld) world).spawnParticles( + ((ServerWorld) this.getWorld()).spawnParticles( ParticleTypes.ELECTRIC_SPARK, this.getParticleX(0.35D), this.getRandomBodyY() + 0.25D, @@ -677,8 +677,9 @@ private NbtCompound takeEntitySnapshot() { entitySnapshot.putDouble("serverHeadYaw", this.serverHeadYaw); entitySnapshot.putFloat("prevHeadYaw", this.prevHeadYaw); // Same as headYaw entitySnapshot.putFloat("lastHandSwingProgress", this.lastHandSwingProgress); // Same as handSwingProgress - entitySnapshot.putFloat("lastLimbDistance", this.lastLimbDistance); // Same as limbDistance - entitySnapshot.putFloat("limbAngle", this.limbAngle); + entitySnapshot.putFloat("limbAnimatorPrevSpeed", ((LimbAnimatorAccessor) this.limbAnimator).getPresSpeed()); // Same as limbDistance + entitySnapshot.putFloat("limbAnimatorSpeed", this.limbAnimator.getSpeed()); + entitySnapshot.putFloat("limbAnimatorPos", this.limbAnimator.getPos()); entitySnapshot.putFloat("prevLookDirection", this.prevLookDirection); // Same as lookDirection entitySnapshot.putInt("age", this.age); entitySnapshot.putFloat("tickDelta", ModelAnimationHelper.getTickDelta()); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/GlareEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/GlareEntity.java index dd2ba6434..e0c5afcb1 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/GlareEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/GlareEntity.java @@ -36,16 +36,17 @@ import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; import net.minecraft.recipe.Ingredient; +import net.minecraft.registry.tag.TagKey; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; -import net.minecraft.tag.TagKey; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; +import net.minecraft.world.EntityView; import net.minecraft.world.ServerWorldAccess; import net.minecraft.world.World; import net.minecraft.world.event.GameEvent; @@ -97,7 +98,6 @@ public GlareEntity(EntityType entityType, World world) { this.moveControl = new FlightMoveControl(this, 10, true); this.setPathfindingPenalty(PathNodeType.DANGER_FIRE, -1.0F); - this.setPathfindingPenalty(PathNodeType.DANGER_CACTUS, -1.0F); this.setPathfindingPenalty(PathNodeType.WATER, -1.0F); this.setPathfindingPenalty(PathNodeType.LAVA, -1.0F); this.setPathfindingPenalty(PathNodeType.WATER_BORDER, 16.0F); @@ -568,6 +568,11 @@ public void setOwner(PlayerEntity owner) { } } + @Override + public EntityView method_48926() { + return this.getWorld(); + } + @Override public boolean isBreedingItem(ItemStack itemStack) { return TEMPT_ITEMS.test(itemStack); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/IceologerIceChunkEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/IceologerIceChunkEntity.java index 1ec1edc4d..dafa36171 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/IceologerIceChunkEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/IceologerIceChunkEntity.java @@ -8,14 +8,11 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.MovementType; -import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.data.TrackedDataHandlerRegistry; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.NbtCompound; -import net.minecraft.network.Packet; -import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket; import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; @@ -200,10 +197,6 @@ public void tick() { } } - public Packet createSpawnPacket() { - return new EntitySpawnS2CPacket(this); - } - public int getTicksUntilFall() { return this.dataTracker.get(TICKS_UNTIL_FALL); } @@ -247,7 +240,7 @@ private void damage(LivingEntity hitEntity) { return; } - hitEntity.damage(DamageSource.MAGIC, 12.0F); + hitEntity.damage(this.getDamageSources().magic(), 12.0F); if (hitEntity.canFreeze()) { hitEntity.setFrozenTicks(400); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/MaulerEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/MaulerEntity.java index 8acfc296b..a26dfc2d5 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/MaulerEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/MaulerEntity.java @@ -29,6 +29,7 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.RegistryKey; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; @@ -37,7 +38,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; -import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.LocalDifficulty; import net.minecraft.world.ServerWorldAccess; import net.minecraft.world.World; @@ -423,7 +423,7 @@ public boolean tryAttack(Entity target) { return false; } - return target.damage(DamageSource.mob(this), (float) this.getAttributeValue(EntityAttributes.GENERIC_ATTACK_DAMAGE)); + return target.damage(this.getDamageSources().mobAttack(this), (float) this.getAttributeValue(EntityAttributes.GENERIC_ATTACK_DAMAGE)); } public int getAngerTime() { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/MoobloomEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/MoobloomEntity.java index d4247d533..9c6920776 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/MoobloomEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/MoobloomEntity.java @@ -220,7 +220,13 @@ public void tickMovement() { // On average once per five minutes (1/6000) if (this.getRandom().nextFloat() <= 0.00016666666) { - Block blockUnderneath = this.getWorld().getBlockState(new BlockPos(this.getX(), this.getY() - 1, this.getZ())).getBlock(); + Block blockUnderneath = this.getWorld().getBlockState( + new BlockPos( + (int) this.getX(), + (int) this.getY() - 1, + (int) this.getZ() + ) + ).getBlock(); if (blockUnderneath == Blocks.GRASS_BLOCK && this.getWorld().isAir(this.getBlockPos())) { Block flower = this.getVariant().getFlower(); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/RascalEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/RascalEntity.java new file mode 100644 index 000000000..a22499b45 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/RascalEntity.java @@ -0,0 +1,443 @@ +package com.faboslav.friendsandfoes.entity; + +import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.client.render.entity.animation.KeyframeAnimation; +import com.faboslav.friendsandfoes.client.render.entity.animation.RascalAnimations; +import com.faboslav.friendsandfoes.client.render.entity.animation.animator.context.AnimationContextTracker; +import com.faboslav.friendsandfoes.entity.ai.brain.RascalBrain; +import com.faboslav.friendsandfoes.entity.animation.AnimatedEntity; +import com.faboslav.friendsandfoes.entity.pose.RascalEntityPose; +import com.faboslav.friendsandfoes.init.FriendsAndFoesSoundEvents; +import com.faboslav.friendsandfoes.util.RandomGenerator; +import com.mojang.serialization.Dynamic; +import net.minecraft.block.BlockState; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.brain.Brain; +import net.minecraft.entity.ai.brain.MemoryModuleType; +import net.minecraft.entity.ai.pathing.PathNodeType; +import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.data.DataTracker; +import net.minecraft.entity.data.TrackedData; +import net.minecraft.entity.data.TrackedDataHandlerRegistry; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.entity.mob.MobEntity; +import net.minecraft.entity.passive.PassiveEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.particle.ParticleEffect; +import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.tag.StructureTags; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.random.Random; +import net.minecraft.world.LocalDifficulty; +import net.minecraft.world.ServerWorldAccess; +import net.minecraft.world.World; +import net.minecraft.world.gen.StructureAccessor; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; + +public final class RascalEntity extends PassiveEntity implements AnimatedEntity +{ + private AnimationContextTracker animationContextTracker; + private static final TrackedData POSE_TICKS; + private static final TrackedData CAUGHT_COUNT; + private boolean ambientSounds; + + public RascalEntity(EntityType entityType, World world) { + super(entityType, world); + this.enableAmbientSounds(); + this.setPathfindingPenalty(PathNodeType.RAIL, 0.0F); + this.setPathfindingPenalty(PathNodeType.UNPASSABLE_RAIL, 0.0F); + this.setPathfindingPenalty(PathNodeType.WATER, 0.0F); + this.setPathfindingPenalty(PathNodeType.WATER_BORDER, 0.0F); + } + + @Override + public EntityData initialize( + ServerWorldAccess world, + LocalDifficulty difficulty, + SpawnReason spawnReason, + @Nullable EntityData entityData, + @Nullable NbtCompound entityNbt + ) { + EntityData superEntityData = super.initialize(world, difficulty, spawnReason, entityData, entityNbt); + + this.setPose(RascalEntityPose.DEFAULT); + RascalBrain.setNodCooldown(this); + + return superEntityData; + } + + public static boolean canSpawn( + EntityType rascalEntityType, + ServerWorldAccess serverWorldAccess, + SpawnReason spawnReason, + BlockPos blockPos, + Random random + ) { + if (spawnReason == SpawnReason.NATURAL) { + ServerWorld serverWorld = serverWorldAccess.toServerWorld(); + StructureAccessor structureAccessor = serverWorld.getStructureAccessor(); + + if (structureAccessor.getStructureContaining( + blockPos, + StructureTags.MINESHAFT + ).hasChildren() == false) { + return false; + } + + List nearbyRascals = serverWorld.getEntitiesByClass(RascalEntity.class, new Box(blockPos).expand(32.0F), (rascalEntity) -> true); + + if (nearbyRascals.isEmpty() == false) { + return false; + } + + if (blockPos.getY() < 63 && serverWorldAccess.isSkyVisible(blockPos) == false) { + return true; + } + } + + return false; + } + + @Override + public AnimationContextTracker getAnimationContextTracker() { + if (this.animationContextTracker == null) { + this.animationContextTracker = new AnimationContextTracker(); + + for (KeyframeAnimation keyframeAnimation : this.getAnimations()) { + this.animationContextTracker.add(keyframeAnimation); + } + } + + return this.animationContextTracker; + } + + @Override + public ArrayList getAnimations() { + return RascalAnimations.ANIMATIONS; + } + + @Override + public int getKeyframeAnimationTicks() { + return this.dataTracker.get(POSE_TICKS); + } + + public void setKeyframeAnimationTicks(int keyframeAnimationTicks) { + this.dataTracker.set(POSE_TICKS, keyframeAnimationTicks); + } + + @Override + protected void initDataTracker() { + super.initDataTracker(); + this.dataTracker.startTracking(POSE_TICKS, 0); + this.dataTracker.startTracking(CAUGHT_COUNT, 0); + } + + @Nullable + @Override + public PassiveEntity createChild(ServerWorld world, PassiveEntity entity) { + return null; + } + + @Override + protected Brain deserializeBrain(Dynamic dynamic) { + return RascalBrain.create(dynamic); + } + + @Override + @SuppressWarnings("all") + public Brain getBrain() { + return (Brain) super.getBrain(); + } + + @Override + protected void mobTick() { + this.getWorld().getProfiler().push("rascalBrain"); + this.getBrain().tick((ServerWorld) this.getWorld(), this); + this.getWorld().getProfiler().pop(); + this.getWorld().getProfiler().push("rascalActivityUpdate"); + RascalBrain.updateActivities(this); + this.getWorld().getProfiler().pop(); + + super.mobTick(); + } + + public static DefaultAttributeContainer.Builder createAttributes() { + return MobEntity.createMobAttributes() + .add(EntityAttributes.GENERIC_MAX_HEALTH, 20.0D) + .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.55D) + .add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, 1.0D); + } + + @Override + public void tick() { + if (FriendsAndFoes.getConfig().enableRascal == false) { + this.discard(); + } + + StatusEffectInstance invisibilityStatusEffect = this.getStatusEffect(StatusEffects.INVISIBILITY); + + if (this.isHidden() && invisibilityStatusEffect != null && invisibilityStatusEffect.getDuration() == 1) { + this.playReappearSound(); + } + + if (this.getWorld().isClient() == false && this.isAnyKeyframeAnimationRunning()) { + this.setKeyframeAnimationTicks(this.getKeyframeAnimationTicks() - 1); + } + + KeyframeAnimation keyframeAnimationToStart = this.getKeyframeAnimationByPose(); + + if ( + keyframeAnimationToStart != null + && this.isKeyframeAnimationRunning(keyframeAnimationToStart) == false + ) { + if (this.getWorld().isClient() == false) { + this.setKeyframeAnimationTicks(keyframeAnimationToStart.getAnimationLengthInTicks()); + } + + this.startKeyframeAnimation(keyframeAnimationToStart); + } + + super.tick(); + } + + @Nullable + private KeyframeAnimation getKeyframeAnimationByPose() { + KeyframeAnimation keyframeAnimation = null; + + if (this.isInPose(RascalEntityPose.DEFAULT)) { + keyframeAnimation = RascalAnimations.DEFAULT; + } else if (this.isInPose(RascalEntityPose.NOD)) { + keyframeAnimation = RascalAnimations.NOD; + } else if (this.isInPose(RascalEntityPose.GIVE_REWARD)) { + keyframeAnimation = RascalAnimations.GIVE_REWARD; + } + + return keyframeAnimation; + } + + private void startKeyframeAnimation(KeyframeAnimation keyframeAnimationToStart) { + for (KeyframeAnimation keyframeAnimation : RascalAnimations.ANIMATIONS) { + if (keyframeAnimation == keyframeAnimationToStart) { + continue; + } + + this.stopKeyframeAnimation(keyframeAnimation); + } + + this.startKeyframeAnimation(keyframeAnimationToStart, this.age); + } + + + @Override + public void setPose(EntityPose pose) { + if (this.getWorld().isClient()) { + return; + } + + super.setPose(pose); + } + + public void setPose(RascalEntityPose pose) { + if (this.getWorld().isClient()) { + return; + } + + super.setPose(pose.get()); + } + + public boolean isInPose(RascalEntityPose pose) { + return this.getPose() == pose.get(); + } + + public void startNodAnimation() { + if (this.isInPose(RascalEntityPose.NOD)) { + return; + } + + this.playNodSound(); + this.setPose(RascalEntityPose.NOD); + } + + public void startGiveRewardAnimation() { + if (this.isInPose(RascalEntityPose.GIVE_REWARD)) { + return; + } + + this.playRewardSound(); + this.setPose(RascalEntityPose.GIVE_REWARD); + } + + @Override + public boolean damage( + DamageSource source, float amount + ) { + Entity attacker = source.getAttacker(); + + if ( + attacker == null + || attacker instanceof PlayerEntity == false + ) { + return super.damage(source, amount); + } + + this.playHurtSound(source); + this.playDisappearSound(); + this.spawnCloudParticles(); + this.discard(); + + return false; + } + + public SoundEvent getNodSound() { + return FriendsAndFoesSoundEvents.ENTITY_RASCAL_NOD.get(); + } + + public void playNodSound() { + this.playSound(this.getNodSound(), 1.0F, RandomGenerator.generateFloat(1.15F, 1.3F)); + } + + public SoundEvent getRewardSound() { + return FriendsAndFoesSoundEvents.ENTITY_RASCAL_REWARD.get(); + } + + public void playRewardSound() { + this.playSound(this.getRewardSound(), 1.0F, RandomGenerator.generateFloat(1.15F, 1.3F)); + } + + public SoundEvent getBadRewardSound() { + return FriendsAndFoesSoundEvents.ENTITY_RASCAL_REWARD_BAD.get(); + } + + public void playBadRewardSound() { + this.playSound(this.getBadRewardSound(), 1.0F, RandomGenerator.generateFloat(1.15F, 1.3F)); + } + + @Override + protected SoundEvent getAmbientSound() { + return FriendsAndFoesSoundEvents.ENTITY_RASCAL_AMBIENT.get(); + } + + @Override + public void playAmbientSound() { + if (this.isHidden() || this.ambientSounds == false) { + return; + } + + SoundEvent soundEvent = this.getAmbientSound(); + this.playSound(soundEvent, 1.5F, RandomGenerator.generateFloat(1.15F, 1.3F)); + } + + @Override + protected SoundEvent getHurtSound(DamageSource source) { + return FriendsAndFoesSoundEvents.ENTITY_RASCAL_HURT.get(); + } + + @Override + protected void playHurtSound(DamageSource source) { + this.ambientSoundChance = -this.getMinAmbientSoundDelay(); + this.playSound(this.getHurtSound(source), 1.0F, RandomGenerator.generateFloat(1.15F, 1.3F)); + } + + public SoundEvent getDisappearSound() { + return FriendsAndFoesSoundEvents.ENTITY_RASCAL_DISAPPEAR.get(); + } + + public void playDisappearSound() { + SoundEvent soundEvent = this.getDisappearSound(); + this.playSound(soundEvent, 1.5F, RandomGenerator.generateFloat(1.5F, 1.6F)); + } + + public SoundEvent getReappearSound() { + return FriendsAndFoesSoundEvents.ENTITY_RASCAL_REAPPEAR.get(); + } + + public void playReappearSound() { + SoundEvent soundEvent = this.getReappearSound(); + this.playSound(soundEvent, 1.5F, RandomGenerator.generateFloat(1.5F, 1.6F)); + } + + @Override + protected void playStepSound( + BlockPos pos, + BlockState state + ) { + if ( + this.isHidden() + || state.isLiquid() + ) { + return; + } + + super.playStepSound(pos, state); + } + + public boolean isHidden() { + return this.getBrain().getOptionalRegisteredMemory(MemoryModuleType.AVOID_TARGET).orElse(null) instanceof PlayerEntity; + } + + public int getCaughtCount() { + return this.dataTracker.get(CAUGHT_COUNT); + } + + public void addToCaughtCount() { + this.dataTracker.set(CAUGHT_COUNT, this.getCaughtCount() + 1); + } + + public boolean shouldGiveReward() { + return this.getCaughtCount() >= 3; + } + + public boolean disableAmbientSounds() { + return this.ambientSounds = false; + } + + public boolean enableAmbientSounds() { + return this.ambientSounds = true; + } + + public void spawnCloudParticles() { + this.spawnParticles(ParticleTypes.CLOUD, 16, 0.1D); + } + + public void spawnParticles( + ParticleEffect particleEffect, + int amount, + double speed + ) { + World world = this.getWorld(); + + if (world.isClient()) { + return; + } + + for (int i = 0; i < amount; i++) { + ((ServerWorld) world).spawnParticles( + particleEffect, + this.getParticleX(1.0D), + this.getRandomBodyY() + 0.5D, + this.getParticleZ(1.0D), + 1, + this.getRandom().nextGaussian() * 0.02D, + this.getRandom().nextGaussian() * 0.02D, + this.getRandom().nextGaussian() * 0.02D, + speed + ); + } + } + + static { + POSE_TICKS = DataTracker.registerData(RascalEntity.class, TrackedDataHandlerRegistry.INTEGER); + CAUGHT_COUNT = DataTracker.registerData(RascalEntity.class, TrackedDataHandlerRegistry.INTEGER); + } +} + diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java index ca572196c..c8bf5f481 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java @@ -28,11 +28,11 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; -import net.minecraft.tag.BlockTags; import net.minecraft.util.ActionResult; import net.minecraft.util.DyeColor; import net.minecraft.util.Hand; @@ -44,6 +44,8 @@ import net.minecraft.world.event.GameEvent; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; + public final class TuffGolemEntity extends GolemEntity implements AnimatedEntity { private static final TrackedData COLOR; @@ -84,7 +86,7 @@ public AnimationContextTracker getAnimationContextTracker() { if (this.animationContextTracker == null) { this.animationContextTracker = new AnimationContextTracker(); - for (KeyframeAnimation keyframeAnimation : TuffGolemAnimations.ANIMATIONS) { + for (KeyframeAnimation keyframeAnimation : this.getAnimations()) { this.animationContextTracker.add(keyframeAnimation); } } @@ -92,6 +94,11 @@ public AnimationContextTracker getAnimationContextTracker() { return this.animationContextTracker; } + @Override + public ArrayList getAnimations() { + return TuffGolemAnimations.ANIMATIONS; + } + @Override public int getKeyframeAnimationTicks() { return this.dataTracker.get(POSE_TICKS); @@ -106,7 +113,6 @@ public TuffGolemEntity( World world ) { super(entityType, world); - this.stepHeight = 1.0F; } @Override @@ -286,7 +292,7 @@ protected void playStepSound( ) { if ( this.isInSleepingPose() - || state.getMaterial().isLiquid() + || state.isLiquid() ) { return; } @@ -701,7 +707,7 @@ public boolean damage( if ( attacker == null || attacker instanceof LightningEntity - || source == DamageSource.SWEET_BERRY_BUSH + || source == this.getDamageSources().sweetBerryBush() ) { return false; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireEntity.java index 5fbf0b8e4..54ba8e8d0 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireEntity.java @@ -18,11 +18,11 @@ import net.minecraft.entity.mob.HostileEntity; import net.minecraft.nbt.NbtCompound; import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; -import net.minecraft.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.world.LocalDifficulty; import net.minecraft.world.ServerWorldAccess; @@ -131,13 +131,15 @@ public void readCustomDataFromNbt(NbtCompound nbt) { @Override protected void playStepSound(BlockPos pos, BlockState state) { - if (state.getMaterial().isLiquid()) { + if (state.isLiquid()) { return; } BlockState blockState = this.getWorld().getBlockState(pos.up()); BlockSoundGroup blockSoundGroup = blockState.isIn(BlockTags.INSIDE_STEP_SOUND_BLOCKS) ? blockState.getSoundGroup():state.getSoundGroup(); this.playSound(FriendsAndFoesSoundEvents.ENTITY_WILDFIRE_STEP.get(), blockSoundGroup.getVolume() * 0.15F, blockSoundGroup.getPitch()); + + } public SoundEvent getShootSound() { @@ -275,7 +277,7 @@ public boolean damage( Entity attacker = source.getAttacker(); if ( - source == DamageSource.IN_FIRE + source == this.getDamageSources().inFire() || attacker == null || attacker.getType().isIn(FriendsAndFoesTags.WILDFIRE_ALLIES) ) { @@ -287,7 +289,7 @@ public boolean damage( float shieldBreakDamageThreshold = (float) this.getAttributeValue(EntityAttributes.GENERIC_MAX_HEALTH) * 0.25F; if (this.damageAmountCounter >= shieldBreakDamageThreshold) { - attacker.damage(DamageSource.mob(this), GENERIC_ATTACK_DAMAGE); + attacker.damage(this.getDamageSources().mobAttack(this), GENERIC_ATTACK_DAMAGE); this.breakShield(); this.playShieldBreakSound(); this.damageAmountCounter = 0; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireShieldDebrisEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireShieldDebrisEntity.java index 076eef104..c090cfa92 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireShieldDebrisEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/WildfireShieldDebrisEntity.java @@ -47,7 +47,7 @@ protected void onEntityHit(EntityHitResult entityHitResult) { int i = target.getFireTicks(); target.setOnFireFor(5); - if (target.damage(DamageSource.fireball(this, wildfire), 5.0F) == false) { + if (target.damage(this.getDamageSources().fireball(this, wildfire), 5.0F) == false) { target.setFireTicks(i); } else if (wildfire instanceof LivingEntity) { this.applyDamageEffects((LivingEntity) wildfire, target); @@ -100,7 +100,7 @@ private SoundEvent getImpactSound() { private void playImpactSound() { SoundEvent soundEvent = this.getImpactSound(); - this.playSound(soundEvent, 1.0F, 0.95F + RandomGenerator.generateFloat(0.95F, 1.05F)); + this.playSound(soundEvent, 1.0F, 0.95F + RandomGenerator.generateFloat(0.95F, 1.05F)); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/RascalBrain.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/RascalBrain.java new file mode 100644 index 000000000..ba6746544 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/RascalBrain.java @@ -0,0 +1,170 @@ +package com.faboslav.friendsandfoes.entity.ai.brain; + +import com.faboslav.friendsandfoes.entity.RascalEntity; +import com.faboslav.friendsandfoes.entity.ai.brain.task.rascal.RascalFindInteractionTargetTask; +import com.faboslav.friendsandfoes.entity.ai.brain.task.rascal.RascalWaitForPlayerTask; +import com.faboslav.friendsandfoes.init.FriendsAndFoesActivities; +import com.faboslav.friendsandfoes.init.FriendsAndFoesMemoryModuleTypes; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.mojang.datafixers.util.Pair; +import com.mojang.serialization.Dynamic; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ai.brain.Activity; +import net.minecraft.entity.ai.brain.Brain; +import net.minecraft.entity.ai.brain.MemoryModuleType; +import net.minecraft.entity.ai.brain.sensor.Sensor; +import net.minecraft.entity.ai.brain.sensor.SensorType; +import net.minecraft.entity.ai.brain.task.*; +import net.minecraft.util.TimeHelper; +import net.minecraft.util.math.intprovider.UniformIntProvider; + +import java.util.List; + +@SuppressWarnings({"rawtypes", "unchecked"}) +public final class RascalBrain +{ + public static final List> MEMORY_MODULES; + public static final List>> SENSORS; + public final static int NOD_COOLDOWN = 10; + private static final UniformIntProvider NOD_COOLDOWN_PROVIDER; + private static final UniformIntProvider AVOID_MEMORY_DURATION; + + public RascalBrain() { + } + + public static Brain create(Dynamic dynamic) { + Brain.Profile profile = Brain.createProfile(MEMORY_MODULES, SENSORS); + Brain brain = profile.deserialize(dynamic); + + addCoreActivities(brain); + addIdleActivities(brain); + addWaitActivities(brain); + addAvoidActivities(brain); + + brain.setCoreActivities(ImmutableSet.of(Activity.CORE)); + brain.setDefaultActivity(Activity.IDLE); + brain.resetPossibleActivities(); + + return brain; + } + + private static void addCoreActivities(Brain brain) { + brain.setTaskList(Activity.CORE, + 0, + ImmutableList.of( + new StayAboveWaterTask(0.8F), + new LookAroundTask(45, 90), + new WanderAroundTask(), + new TemptationCooldownTask(FriendsAndFoesMemoryModuleTypes.RASCAL_NOD_COOLDOWN.get()) + ) + ); + } + + private static void addIdleActivities(Brain brain) { + brain.setTaskList( + Activity.IDLE, + ImmutableList.of( + Pair.of(0, RascalFindInteractionTargetTask.create(6)), + Pair.of(0, makeRandomWanderTask()) + ) + ); + } + + private static void addWaitActivities( + Brain brain + ) { + brain.setTaskList( + FriendsAndFoesActivities.RASCAL_WAIT.get(), + 10, + ImmutableList.of( + new RascalWaitForPlayerTask() + ), MemoryModuleType.INTERACTION_TARGET + ); + } + + private static void addAvoidActivities(Brain brain) { + brain.setTaskList( + Activity.AVOID, + 10, + ImmutableList.of( + GoToRememberedPositionTask.createEntityBased(MemoryModuleType.AVOID_TARGET, 1.0F, 32, true) + ), + MemoryModuleType.AVOID_TARGET + ); + } + + public static void updateActivities(RascalEntity rascal) { + rascal.getBrain().resetPossibleActivities( + ImmutableList.of( + FriendsAndFoesActivities.RASCAL_WAIT.get(), + Activity.AVOID, + Activity.IDLE + ) + ); + } + + private static RandomTask makeRandomWanderTask() { + return new RandomTask( + ImmutableList.of( + Pair.of(StrollTask.create(0.6F), 2), + Pair.of(new WaitTask(30, 60), 1) + ) + ); + } + + public static void setNodCooldown(RascalEntity rascal) { + rascal.getBrain().remember(FriendsAndFoesMemoryModuleTypes.RASCAL_NOD_COOLDOWN.get(), NOD_COOLDOWN_PROVIDER.get(rascal.getRandom())); + onCooldown(rascal); + } + + public static boolean shouldRunAway(RascalEntity rascal) { + return rascal.getBrain().getOptionalRegisteredMemory(FriendsAndFoesMemoryModuleTypes.RASCAL_NOD_COOLDOWN.get()).isPresent(); + } + + public static void onCooldown(RascalEntity rascal) { + if (shouldRunAway(rascal) == false) { + return; + } + + if (rascal.hasCustomName()) { + return; + } + + LivingEntity nearestTarget = rascal.getBrain().getOptionalRegisteredMemory(MemoryModuleType.INTERACTION_TARGET).orElse(null); + + if (nearestTarget == null) { + return; + } + + runAwayFrom(rascal, nearestTarget); + } + + private static void runAwayFrom(RascalEntity rascal, LivingEntity target) { + rascal.getBrain().forget(MemoryModuleType.LOOK_TARGET); + rascal.getBrain().forget(MemoryModuleType.WALK_TARGET); + rascal.getBrain().forget(MemoryModuleType.INTERACTION_TARGET); + rascal.getBrain().remember(MemoryModuleType.AVOID_TARGET, target, AVOID_MEMORY_DURATION.get(rascal.getRandom())); + } + + static { + SENSORS = List.of( + SensorType.NEAREST_LIVING_ENTITIES, + SensorType.NEAREST_PLAYERS + ); + MEMORY_MODULES = List.of( + MemoryModuleType.VISIBLE_MOBS, + MemoryModuleType.PATH, + MemoryModuleType.LOOK_TARGET, + MemoryModuleType.WALK_TARGET, + MemoryModuleType.AVOID_TARGET, + MemoryModuleType.INTERACTION_TARGET, + MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, + MemoryModuleType.NEAREST_PLAYERS, + MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, + FriendsAndFoesMemoryModuleTypes.RASCAL_NOD_COOLDOWN.get() + ); + NOD_COOLDOWN_PROVIDER = TimeHelper.betweenSeconds(NOD_COOLDOWN, NOD_COOLDOWN); + AVOID_MEMORY_DURATION = TimeHelper.betweenSeconds(NOD_COOLDOWN, NOD_COOLDOWN); + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/TuffGolemBrain.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/TuffGolemBrain.java index b2fafd7a5..852f4bae5 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/TuffGolemBrain.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/TuffGolemBrain.java @@ -1,7 +1,10 @@ package com.faboslav.friendsandfoes.entity.ai.brain; import com.faboslav.friendsandfoes.entity.TuffGolemEntity; -import com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem.*; +import com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem.TuffGolemGoToHomePositionTask; +import com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem.TuffGolemLookAroundTask; +import com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem.TuffGolemSleepTask; +import com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem.TuffGolemWanderAroundTask; import com.faboslav.friendsandfoes.init.FriendsAndFoesActivities; import com.faboslav.friendsandfoes.init.FriendsAndFoesEntityTypes; import com.faboslav.friendsandfoes.init.FriendsAndFoesMemoryModuleTypes; @@ -17,10 +20,7 @@ import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.ai.brain.sensor.Sensor; import net.minecraft.entity.ai.brain.sensor.SensorType; -import net.minecraft.entity.ai.brain.task.FollowMobTask; -import net.minecraft.entity.ai.brain.task.RandomTask; -import net.minecraft.entity.ai.brain.task.TemptationCooldownTask; -import net.minecraft.entity.ai.brain.task.TimeLimitedTask; +import net.minecraft.entity.ai.brain.task.*; import net.minecraft.util.math.intprovider.UniformIntProvider; import java.util.List; @@ -82,22 +82,10 @@ private static void addIdleActivities(Brain brain) { Pair.of(0, new RandomTask( ImmutableList.of( - Pair.of(new TimeLimitedTask( - new FollowMobTask(EntityType.PLAYER, 6.0F), - UniformIntProvider.create(30, 60) - ), 3), - Pair.of(new TimeLimitedTask( - new FollowMobTask(FriendsAndFoesEntityTypes.COPPER_GOLEM.get(), 6.0F), - UniformIntProvider.create(30, 60) - ), 2), - Pair.of(new TimeLimitedTask( - new FollowMobTask(FriendsAndFoesEntityTypes.TUFF_GOLEM.get(), 6.0F), - UniformIntProvider.create(30, 60) - ), 2), - Pair.of(new TimeLimitedTask( - new FollowMobTask(EntityType.IRON_GOLEM, 12.0F), - UniformIntProvider.create(30, 60) - ), 1) + Pair.of(LookAtMobWithIntervalTask.follow(EntityType.PLAYER, 6.0F, UniformIntProvider.create(30, 60)), 3), + Pair.of(LookAtMobWithIntervalTask.follow(FriendsAndFoesEntityTypes.COPPER_GOLEM.get(), 6.0F, UniformIntProvider.create(30, 60)), 2), + Pair.of(LookAtMobWithIntervalTask.follow(FriendsAndFoesEntityTypes.TUFF_GOLEM.get(), 6.0F, UniformIntProvider.create(30, 60)), 2), + Pair.of(LookAtMobWithIntervalTask.follow(EntityType.IRON_GOLEM, 6.0F, UniformIntProvider.create(30, 60)), 1) ) ) ), @@ -107,9 +95,9 @@ private static void addIdleActivities(Brain brain) { MemoryModuleType.WALK_TARGET, MemoryModuleState.VALUE_ABSENT ), ImmutableList.of( - Pair.of(new TuffGolemWaitTask(60, 80), 2), - Pair.of(new TuffGolemStrollTask(0.6F), 1), - Pair.of(new TuffGolemGoTowardsLookTarget(0.6F, 2), 1) + Pair.of(new WaitTask(60, 80), 2), + Pair.of(TaskTriggerer.runIf(TuffGolemBrain::isNotImmobilized, StrollTask.create(0.6F)), 1), + Pair.of(TaskTriggerer.runIf(TuffGolemBrain::isNotImmobilized, GoTowardsLookTargetTask.create(0.6F, 2)), 1) ) ) ) @@ -137,6 +125,10 @@ public static void setSleepCooldown(TuffGolemEntity tuffGolem) { tuffGolem.getBrain().remember(FriendsAndFoesMemoryModuleTypes.TUFF_GOLEM_SLEEP_COOLDOWN.get(), SLEEP_COOLDOWN_PROVIDER.get(tuffGolem.getRandom())); } + private static boolean isNotImmobilized(TuffGolemEntity tuffGolem) { + return tuffGolem.isNotImmobilized(); + } + static { SENSORS = List.of( SensorType.NEAREST_LIVING_ENTITIES, diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/WildfireBrain.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/WildfireBrain.java index a666e42ba..4498c045c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/WildfireBrain.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/WildfireBrain.java @@ -63,14 +63,15 @@ private static void addCoreActivities(Brain brain) { new TemptationCooldownTask(FriendsAndFoesMemoryModuleTypes.WILDFIRE_BARRAGE_ATTACK_COOLDOWN.get()), new TemptationCooldownTask(FriendsAndFoesMemoryModuleTypes.WILDFIRE_SHOCKWAVE_ATTACK_COOLDOWN.get()), new TemptationCooldownTask(FriendsAndFoesMemoryModuleTypes.WILDFIRE_SUMMON_BLAZE_COOLDOWN.get()) - )); + ) + ); } private static void addIdleActivities(Brain brain) { brain.setTaskList( Activity.IDLE, ImmutableList.of( - Pair.of(0, new UpdateAttackTargetTask(wildfire -> getTarget((WildfireEntity) wildfire))), + Pair.of(0, UpdateAttackTargetTask.create(wildfire -> true, WildfireBrain::getTarget)), Pair.of(0, makeRandomWanderTask()) ) ); @@ -96,7 +97,7 @@ private static void addAvoidActivities(Brain brain) { Activity.AVOID, 10, ImmutableList.of( - GoToRememberedPositionTask.toEntity(MemoryModuleType.AVOID_TARGET, 1.4F, 16, true), + GoToRememberedPositionTask.createEntityBased(MemoryModuleType.AVOID_TARGET, 1.4F, 16, true), makeRandomWanderTask() ), MemoryModuleType.AVOID_TARGET @@ -106,8 +107,8 @@ private static void addAvoidActivities(Brain brain) { private static RandomTask makeRandomWanderTask() { return new RandomTask( ImmutableList.of( - Pair.of(new StrollTask(0.6F), 2), - Pair.of(new GoTowardsLookTarget(1.0F, 3), 2), + Pair.of(StrollTask.create(0.6F), 2), + Pair.of(GoTowardsLookTargetTask.create(1.0F, 3), 2), Pair.of(new WaitTask(30, 60), 1) ) ); @@ -137,10 +138,10 @@ public static void setSummonBlazeCooldown(WildfireEntity wildfire) { } public static boolean shouldRunAway(WildfireEntity wildfire) { - return wildfire.getBrain().getOptionalMemory(FriendsAndFoesMemoryModuleTypes.WILDFIRE_BARRAGE_ATTACK_COOLDOWN.get()).isPresent() - && wildfire.getBrain().getOptionalMemory(FriendsAndFoesMemoryModuleTypes.WILDFIRE_SHOCKWAVE_ATTACK_COOLDOWN.get()).isPresent() + return wildfire.getBrain().getOptionalRegisteredMemory(FriendsAndFoesMemoryModuleTypes.WILDFIRE_BARRAGE_ATTACK_COOLDOWN.get()).isPresent() + && wildfire.getBrain().getOptionalRegisteredMemory(FriendsAndFoesMemoryModuleTypes.WILDFIRE_SHOCKWAVE_ATTACK_COOLDOWN.get()).isPresent() && ( - wildfire.getBrain().getOptionalMemory(FriendsAndFoesMemoryModuleTypes.WILDFIRE_SUMMON_BLAZE_COOLDOWN.get()).isPresent() + wildfire.getBrain().getOptionalRegisteredMemory(FriendsAndFoesMemoryModuleTypes.WILDFIRE_SUMMON_BLAZE_COOLDOWN.get()).isPresent() || wildfire.getSummonedBlazesCount() == WildfireEntity.MAXIMUM_SUMMONED_BLAZES_COUNT ); } @@ -150,7 +151,7 @@ public static void onCooldown(WildfireEntity wildfire) { return; } - LivingEntity attackTarget = wildfire.getBrain().getOptionalMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); + LivingEntity attackTarget = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); if (attackTarget == null) { return; @@ -168,7 +169,7 @@ public static void onAttacked(WildfireEntity wildfire, LivingEntity attacker) { } private static Optional getTarget(WildfireEntity wildfire) { - PlayerEntity nearestVisibleTargetablePlayer = wildfire.getBrain().getOptionalMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse( + PlayerEntity nearestVisibleTargetablePlayer = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse( wildfire.getWorld().getClosestPlayer(VALID_TARGET_PLAYER_PREDICATE, wildfire, wildfire.getX(), wildfire.getEyeY(), wildfire.getZ()) ); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/beekeeper/BeekeeperWorkTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/beekeeper/BeekeeperWorkTask.java index ef035a2ca..c651a3067 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/beekeeper/BeekeeperWorkTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/beekeeper/BeekeeperWorkTask.java @@ -60,7 +60,7 @@ protected void performAdditionalWork(ServerWorld serverWorld, VillagerEntity vil @Nullable private GlobalPos getBeehiveGlobalPos(VillagerEntity entity) { - return entity.getBrain().getOptionalMemory(MemoryModuleType.JOB_SITE).orElse(null); + return entity.getBrain().getOptionalRegisteredMemory(MemoryModuleType.JOB_SITE).orElse(null); } private boolean canHarvestHoney(BlockState beehiveBlockState) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/rascal/RascalFindInteractionTargetTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/rascal/RascalFindInteractionTargetTask.java new file mode 100644 index 000000000..f06f8e2ed --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/rascal/RascalFindInteractionTargetTask.java @@ -0,0 +1,35 @@ +package com.faboslav.friendsandfoes.entity.ai.brain.task.rascal; + +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ai.brain.EntityLookTarget; +import net.minecraft.entity.ai.brain.MemoryModuleType; +import net.minecraft.entity.ai.brain.task.Task; +import net.minecraft.entity.ai.brain.task.TaskTriggerer; +import net.minecraft.entity.player.PlayerEntity; + +import java.util.Optional; + +public final class RascalFindInteractionTargetTask +{ + public static Task create(int maxDistance) { + int squaredMaxDistance = maxDistance * maxDistance; + return TaskTriggerer.task((context) -> { + return context.group(context.queryMemoryOptional(MemoryModuleType.LOOK_TARGET), context.queryMemoryAbsent(MemoryModuleType.INTERACTION_TARGET), context.queryMemoryValue(MemoryModuleType.VISIBLE_MOBS)).apply(context, (lookTarget, interactionTarget, visibleMobs) -> { + return (world, entity, time) -> { + Optional optional = context.getValue(visibleMobs).findFirst((target) -> { + return target.squaredDistanceTo(entity) <= (double) squaredMaxDistance && target instanceof PlayerEntity && !target.isSpectator() && !((PlayerEntity) target).isCreative(); + }); + + if (optional.isEmpty()) { + return false; + } else { + LivingEntity livingEntity = optional.get(); + interactionTarget.remember(livingEntity); + lookTarget.remember(new EntityLookTarget(livingEntity, true)); + return true; + } + }; + }); + }); + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/rascal/RascalWaitForPlayerTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/rascal/RascalWaitForPlayerTask.java new file mode 100644 index 000000000..a2e343527 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/rascal/RascalWaitForPlayerTask.java @@ -0,0 +1,197 @@ +package com.faboslav.friendsandfoes.entity.ai.brain.task.rascal; + +import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.entity.RascalEntity; +import com.faboslav.friendsandfoes.entity.ai.brain.RascalBrain; +import com.faboslav.friendsandfoes.entity.pose.RascalEntityPose; +import com.faboslav.friendsandfoes.init.FriendsAndFoesCriteria; +import com.faboslav.friendsandfoes.init.FriendsAndFoesMemoryModuleTypes; +import com.faboslav.friendsandfoes.mixin.BundleItemAccessor; +import com.google.common.collect.ImmutableMap; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ai.brain.MemoryModuleState; +import net.minecraft.entity.ai.brain.MemoryModuleType; +import net.minecraft.entity.ai.brain.task.LookTargetUtil; +import net.minecraft.entity.ai.brain.task.MultiTickTask; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.loot.LootManager; +import net.minecraft.loot.LootTable; +import net.minecraft.loot.context.LootContextParameterSet; +import net.minecraft.loot.context.LootContextParameters; +import net.minecraft.loot.context.LootContextTypes; +import net.minecraft.registry.tag.StructureTags; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.gen.StructureAccessor; + +public final class RascalWaitForPlayerTask extends MultiTickTask +{ + private final static int NOD_DURATION = 90; + public final static float NOD_RANGE = 4F; + + private int nodTicks; + private LivingEntity nearestTarget; + + public RascalWaitForPlayerTask() { + super(ImmutableMap.of( + MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleState.REGISTERED, + MemoryModuleType.INTERACTION_TARGET, MemoryModuleState.VALUE_PRESENT, + FriendsAndFoesMemoryModuleTypes.RASCAL_NOD_COOLDOWN.get(), MemoryModuleState.VALUE_ABSENT + ), NOD_DURATION); + } + + @Override + protected boolean shouldRun(ServerWorld world, RascalEntity rascal) { + if (rascal.hasCustomName()) { + return false; + } + + LivingEntity nearestTarget = rascal.getBrain().getOptionalRegisteredMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); + + if (nearestTarget == null) { + nearestTarget = rascal.getBrain().getOptionalRegisteredMemory(MemoryModuleType.INTERACTION_TARGET).orElse(null); + } + + if ( + nearestTarget == null + || rascal.distanceTo(nearestTarget) > NOD_RANGE + || nearestTarget.isAlive() == false + || ( + nearestTarget instanceof PlayerEntity + && ( + nearestTarget.isSpectator() + || ((PlayerEntity) nearestTarget).isCreative() + ) + ) + ) { + return false; + } + + this.nearestTarget = nearestTarget; + + return true; + } + + @Override + protected void run(ServerWorld world, RascalEntity rascal, long time) { + rascal.getBrain().forget(MemoryModuleType.WALK_TARGET); + rascal.getNavigation().setSpeed(0); + rascal.getNavigation().stop(); + rascal.getNavigation().tick(); + rascal.getMoveControl().tick(); + + rascal.setMovementSpeed(0.0F); + rascal.prevHorizontalSpeed = 0.0F; + rascal.horizontalSpeed = 0.0F; + rascal.sidewaysSpeed = 0.0F; + rascal.upwardSpeed = 0.0F; + + LookTargetUtil.lookAt(rascal, this.nearestTarget); + rascal.getLookControl().lookAt(this.nearestTarget); + rascal.getLookControl().tick(); + + this.nodTicks = 0; + rascal.addToCaughtCount(); + rascal.disableAmbientSounds(); + } + + @Override + protected boolean shouldKeepRunning(ServerWorld world, RascalEntity rascal, long time) { + return this.nodTicks <= NOD_DURATION; + } + + @Override + protected void keepRunning(ServerWorld world, RascalEntity rascal, long time) { + if (nodTicks == 20) { + rascal.startNodAnimation(); + rascal.getLookControl().lookAt(this.nearestTarget); + } + + if (nodTicks == 40 && rascal.shouldGiveReward()) { + rascal.startGiveRewardAnimation(); + } + + if (nodTicks == 62 && rascal.shouldGiveReward()) { + Vec3d targetPos = nearestTarget.getPos().add(0.0, 1.0, 0.0); + LootManager lootManager = world.getServer().getLootManager(); + + if (lootManager != null) { + LootTable rascalGoodItemsLootTable = lootManager.getLootTable( + FriendsAndFoes.makeID("rewards/rascal_good_reward") + ); + LootContextParameterSet lootContextParameterSet = new LootContextParameterSet.Builder(world) + .add(LootContextParameters.ORIGIN, targetPos) + .add(LootContextParameters.THIS_ENTITY, this.nearestTarget) + .build(LootContextTypes.GIFT); + ObjectArrayList rascalGoodRewards = rascalGoodItemsLootTable.generateLoot(lootContextParameterSet); + + for (ItemStack rascalReward : rascalGoodRewards) { + ItemStack bundleItemStack = Items.BUNDLE.getDefaultStack(); + ((BundleItemAccessor) bundleItemStack.getItem()).invokeAddToBundle(bundleItemStack, rascalReward); + LookTargetUtil.give(rascal, bundleItemStack, nearestTarget.getPos().add(0.0, 1.0, 0.0)); + } + } + + FriendsAndFoesCriteria.COMPLETE_HIDE_AND_SEEK_GAME.trigger((ServerPlayerEntity) this.nearestTarget, rascal); + } + + this.nodTicks++; + } + + @Override + protected void finishRunning(ServerWorld world, RascalEntity rascal, long time) { + if (rascal.hasCustomName()) { + RascalBrain.setNodCooldown(rascal); + return; + } + + rascal.spawnCloudParticles(); + rascal.playDisappearSound(); + + if (rascal.shouldGiveReward()) { + rascal.discard(); + return; + } + + rascal.setPose(RascalEntityPose.DEFAULT); + rascal.addStatusEffect(new StatusEffectInstance(StatusEffects.INVISIBILITY, RascalBrain.NOD_COOLDOWN * 20)); + this.tryToTeleport(world, rascal); + RascalBrain.setNodCooldown(rascal); + rascal.enableAmbientSounds(); + } + + private void tryToTeleport(ServerWorld world, RascalEntity rascal) { + StructureAccessor structureAccessor = world.getStructureAccessor(); + + for (int i = 0; i < 32; ++i) { + double x = rascal.getX() + (rascal.getRandom().nextDouble() - 0.5) * 24.0; + double y = MathHelper.clamp(rascal.getY() + (double) (rascal.getRandom().nextInt(16) - 8), world.getBottomY(), world.getBottomY() + world.getLogicalHeight() - 1); + double z = rascal.getZ() + (rascal.getRandom().nextDouble() - 0.5) * 24.0; + + if (structureAccessor.getStructureContaining( + new BlockPos((int) x, (int) y, (int) z), + StructureTags.MINESHAFT + ).hasChildren() == false) { + continue; + } + + if (rascal.hasVehicle()) { + rascal.stopRiding(); + } + + boolean teleportResult = rascal.teleport(x, y, z, false); + + if (teleportResult) { + return; + } + } + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java index eda277d24..f9d5c29c9 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java @@ -6,12 +6,12 @@ import net.minecraft.entity.ai.brain.MemoryModuleState; import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.ai.brain.task.LookTargetUtil; -import net.minecraft.entity.ai.brain.task.Task; +import net.minecraft.entity.ai.brain.task.MultiTickTask; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -public final class TuffGolemGoToHomePositionTask extends Task +public final class TuffGolemGoToHomePositionTask extends MultiTickTask { private final static int GO_TO_SLEEP_POSITION_DURATION = 2400; @@ -105,7 +105,11 @@ private void walkTowardsHomePos( ) { LookTargetUtil.walkTowards( tuffGolem, - new BlockPos(tuffGolem.getHomePos()), + new BlockPos( + (int) tuffGolem.getHomePos().getX(), + (int) tuffGolem.getHomePos().getY(), + (int) tuffGolem.getHomePos().getZ() + ), 0.6F, 0 ); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemGoTowardsLookTarget.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemGoTowardsLookTarget.java deleted file mode 100644 index e64996ebe..000000000 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemGoTowardsLookTarget.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem; - -import com.faboslav.friendsandfoes.entity.TuffGolemEntity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.ai.brain.task.GoTowardsLookTarget; -import net.minecraft.server.world.ServerWorld; - -public final class TuffGolemGoTowardsLookTarget extends GoTowardsLookTarget -{ - public TuffGolemGoTowardsLookTarget(float speed, int completionRange) { - super(speed, completionRange); - } - - @Override - protected boolean shouldRun(ServerWorld world, LivingEntity entity) { - TuffGolemEntity tuffGolem = (TuffGolemEntity) entity; - - return tuffGolem.isNotImmobilized() && super.shouldRun(world, tuffGolem); - } -} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemSleepTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemSleepTask.java index 6ac7e5c99..bdea0e87f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemSleepTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemSleepTask.java @@ -6,10 +6,10 @@ import com.faboslav.friendsandfoes.init.FriendsAndFoesMemoryModuleTypes; import com.google.common.collect.ImmutableMap; import net.minecraft.entity.ai.brain.MemoryModuleState; -import net.minecraft.entity.ai.brain.task.Task; +import net.minecraft.entity.ai.brain.task.MultiTickTask; import net.minecraft.server.world.ServerWorld; -public final class TuffGolemSleepTask extends Task +public final class TuffGolemSleepTask extends MultiTickTask { private final static int MIN_TICKS_TO_SLEEP = 2400; private final static int MAX_TICKS_TO_SLEEP = 4800; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemStrollTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemStrollTask.java deleted file mode 100644 index d285801c1..000000000 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemStrollTask.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem; - -import com.faboslav.friendsandfoes.entity.TuffGolemEntity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.ai.brain.task.StrollTask; -import net.minecraft.entity.mob.PathAwareEntity; -import net.minecraft.server.world.ServerWorld; - -public final class TuffGolemStrollTask extends StrollTask -{ - public TuffGolemStrollTask(float speed) { - super(speed); - } - - @Override - protected boolean shouldRun(ServerWorld world, PathAwareEntity entity) { - TuffGolemEntity tuffGolem = (TuffGolemEntity) entity; - - return tuffGolem.isNotImmobilized() && super.shouldRun(world, tuffGolem); - } -} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemWaitTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemWaitTask.java deleted file mode 100644 index f1992a281..000000000 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/tuffgolem/TuffGolemWaitTask.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.faboslav.friendsandfoes.entity.ai.brain.task.tuffgolem; - -import com.faboslav.friendsandfoes.entity.TuffGolemEntity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.ai.brain.task.WaitTask; -import net.minecraft.server.world.ServerWorld; - -public final class TuffGolemWaitTask extends WaitTask -{ - public TuffGolemWaitTask(int minRunTime, int maxRunTime) { - super(minRunTime, maxRunTime); - } - - @Override - protected boolean shouldRun(ServerWorld world, LivingEntity entity) { - TuffGolemEntity tuffGolem = (TuffGolemEntity) entity; - - return tuffGolem.isNotImmobilized() && super.shouldRun(world, tuffGolem); - } -} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java index cba7dd590..172579b28 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java @@ -9,12 +9,12 @@ import net.minecraft.entity.ai.brain.MemoryModuleState; import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.ai.brain.task.LookTargetUtil; -import net.minecraft.entity.ai.brain.task.Task; +import net.minecraft.entity.ai.brain.task.MultiTickTask; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.random.Random; -public final class WildfireBarrageAttackTask extends Task +public final class WildfireBarrageAttackTask extends MultiTickTask { private int shieldDebrisFired; private int shieldDebrisCooldown; @@ -34,7 +34,7 @@ public WildfireBarrageAttackTask() { @Override protected boolean shouldRun(ServerWorld world, WildfireEntity wildfire) { - var attackTarget = wildfire.getBrain().getOptionalMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); + var attackTarget = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); if ( attackTarget == null @@ -73,7 +73,7 @@ protected void run(ServerWorld world, WildfireEntity wildfire, long time) { @Override protected boolean shouldKeepRunning(ServerWorld world, WildfireEntity wildfire, long time) { if (attackTarget.isAlive() == false) { - attackTarget = wildfire.getBrain().getOptionalMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); + attackTarget = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); } if ( @@ -92,7 +92,7 @@ protected boolean shouldKeepRunning(ServerWorld world, WildfireEntity wildfire, return false; } - var nearestVisibleTargetablePlayer = wildfire.getBrain().getOptionalMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); + var nearestVisibleTargetablePlayer = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); return nearestVisibleTargetablePlayer == null || !nearestVisibleTargetablePlayer.isAlive() @@ -160,7 +160,7 @@ protected void keepRunning(ServerWorld world, WildfireEntity wildfire, long time wildfire.getBodyY(0.5) + 0.5, shieldDebris.getZ() ); - wildfire.world.spawnEntity(shieldDebris); + wildfire.getWorld().spawnEntity(shieldDebris); this.shieldDebrisFired++; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java index 709b31e3d..c2bb3df2a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java @@ -11,7 +11,7 @@ import net.minecraft.entity.ai.brain.MemoryModuleState; import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.ai.brain.task.LookTargetUtil; -import net.minecraft.entity.ai.brain.task.Task; +import net.minecraft.entity.ai.brain.task.MultiTickTask; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.ParticleTypes; import net.minecraft.predicate.entity.EntityPredicates; @@ -19,7 +19,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -public final class WildfireShockwaveAttackTask extends Task +public final class WildfireShockwaveAttackTask extends MultiTickTask { private final static int SHOCKWAVE_DURATION = 20; private final static int SHOCKWAVE_PHASE_ONE_END_TICK = 15; @@ -38,10 +38,10 @@ public WildfireShockwaveAttackTask() { @Override protected boolean shouldRun(ServerWorld world, WildfireEntity wildfire) { - LivingEntity nearestTarget = wildfire.getBrain().getOptionalMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); + LivingEntity nearestTarget = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); if (nearestTarget == null) { - nearestTarget = wildfire.getBrain().getOptionalMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); + nearestTarget = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); } if ( nearestTarget == null diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java index 466ac0cea..2349f9c3a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java @@ -11,13 +11,13 @@ import net.minecraft.entity.ai.brain.MemoryModuleState; import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.ai.brain.task.LookTargetUtil; -import net.minecraft.entity.ai.brain.task.Task; +import net.minecraft.entity.ai.brain.task.MultiTickTask; import net.minecraft.entity.mob.BlazeEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; -public final class WildfireSummonBlazeTask extends Task +public final class WildfireSummonBlazeTask extends MultiTickTask { private LivingEntity attackTarget; private int summonedBlazesCount; @@ -35,7 +35,7 @@ public WildfireSummonBlazeTask() { @Override protected boolean shouldRun(ServerWorld world, WildfireEntity wildfire) { - var attackTarget = wildfire.getBrain().getOptionalMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); + var attackTarget = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); if ( attackTarget == null diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/bee/BeePollinateMoobloomGoal.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/bee/BeePollinateMoobloomGoal.java index 710b52091..080d9d6e1 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/bee/BeePollinateMoobloomGoal.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/bee/BeePollinateMoobloomGoal.java @@ -43,7 +43,7 @@ public boolean canStart() { return false; } else if (this.beeEntity.hasNectar()) { return false; - } else if (this.beeEntity.world.isRaining()) { + } else if (this.beeEntity.getWorld().isRaining()) { return false; } else if (this.beeEntity.getRandom().nextFloat() < 0.5F) { return false; @@ -150,7 +150,7 @@ private void pollinate() { double d = this.beeEntity.getRandom().nextGaussian() * 0.02D; double e = this.beeEntity.getRandom().nextGaussian() * 0.02D; double f = this.beeEntity.getRandom().nextGaussian() * 0.02D; - ((ServerWorld) this.beeEntity.world).spawnParticles( + ((ServerWorld) this.beeEntity.getWorld()).spawnParticles( ParticleTypes.HEART, this.beeEntity.getParticleX(1.0D), this.beeEntity.getRandomBodyY() + 0.5D, @@ -166,7 +166,7 @@ private void pollinate() { @Nullable private MoobloomEntity findMoobloom() { - List moobloomEntities = this.beeEntity.world.getTargets( + List moobloomEntities = this.beeEntity.getWorld().getTargets( MoobloomEntity.class, VALID_MOOBLOOM_PREDICATE, this.beeEntity, diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemFleeEntityGoal.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemFleeEntityGoal.java index bfaecbef7..19dad72f0 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemFleeEntityGoal.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemFleeEntityGoal.java @@ -30,7 +30,7 @@ public boolean canStart() { } TargetPredicate withinRangePredicate = TargetPredicate.createNonAttackable().setBaseMaxDistance(this.fleeDistance).setPredicate(inclusionSelector.and(extraInclusionSelector)); - this.targetEntity = this.mob.world.getClosestEntity(this.mob.world.getEntitiesByClass(this.classToFleeFrom, this.mob.getBoundingBox().expand(this.fleeDistance, 3.0D, this.fleeDistance), (livingEntity) -> { + this.targetEntity = this.mob.getWorld().getClosestEntity(this.mob.getWorld().getEntitiesByClass(this.classToFleeFrom, this.mob.getBoundingBox().expand(this.fleeDistance, 3.0D, this.fleeDistance), (livingEntity) -> { return true; }), withinRangePredicate, this.mob, this.mob.getX(), this.mob.getY(), this.mob.getZ()); if (this.targetEntity == null) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemPressButtonGoal.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemPressButtonGoal.java index 67a4e156a..7891a49b4 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemPressButtonGoal.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/coppergolem/CopperGolemPressButtonGoal.java @@ -321,10 +321,6 @@ private void calculatePositionToStandOn() { } } - if (positionToStandOn != null) { - positionToStandOn = positionToStandOn.add(0.5, 0, 0.5); - } - this.positionToStandOn = positionToStandOn; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareEatGlowBerriesGoal.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareEatGlowBerriesGoal.java index b94668b64..38eaf9096 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareEatGlowBerriesGoal.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareEatGlowBerriesGoal.java @@ -114,7 +114,7 @@ public void stop() { @Nullable private ItemEntity getFoodItemToPickUp() { - List foodItemsToPickUp = this.glare.world.getEntitiesByClass( + List foodItemsToPickUp = this.glare.getWorld().getEntitiesByClass( ItemEntity.class, this.glare.getBoundingBox().expand(8.0D, 8.0D, 8.0D), IS_PICKABLE_FOOD diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareFollowOwnerGoal.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareFollowOwnerGoal.java index f7cb52160..958119f16 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareFollowOwnerGoal.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareFollowOwnerGoal.java @@ -33,7 +33,7 @@ public GlareFollowOwnerGoal( boolean leavesAllowed ) { this.glare = glare; - this.world = glare.world; + this.world = glare.getWorld(); this.speed = glare.getFastMovementSpeed(); this.navigation = glare.getNavigation(); this.minDistance = minDistance; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareShakeOffGlowBerriesGoal.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareShakeOffGlowBerriesGoal.java index bdd7f6513..ca3c9ee0d 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareShakeOffGlowBerriesGoal.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/glare/GlareShakeOffGlowBerriesGoal.java @@ -105,6 +105,7 @@ private void shakeOffGlowBerries() { } CaveVines.pickBerries( + this.glare, blockState, this.glare.getWorld(), this.targetPos diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/zombiehorse/ZombieHorseTrapTriggerGoal.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/zombiehorse/ZombieHorseTrapTriggerGoal.java index 125e79743..3fe1f4af3 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/zombiehorse/ZombieHorseTrapTriggerGoal.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/ai/goal/zombiehorse/ZombieHorseTrapTriggerGoal.java @@ -74,8 +74,8 @@ public void tick() { } private ZombieHorseEntity getHorse(LocalDifficulty localDifficulty) { - ZombieHorseEntity zombieHorse = EntityType.ZOMBIE_HORSE.create(this.zombieHorse.world); - zombieHorse.initialize((ServerWorld) this.zombieHorse.world, localDifficulty, SpawnReason.TRIGGERED, null, null); + ZombieHorseEntity zombieHorse = EntityType.ZOMBIE_HORSE.create(this.zombieHorse.getWorld()); + zombieHorse.initialize((ServerWorld) this.zombieHorse.getWorld(), localDifficulty, SpawnReason.TRIGGERED, null, null); zombieHorse.setPosition(this.zombieHorse.getX(), this.zombieHorse.getY(), this.zombieHorse.getZ()); zombieHorse.timeUntilRegen = 60; zombieHorse.setPersistent(); @@ -85,8 +85,8 @@ private ZombieHorseEntity getHorse(LocalDifficulty localDifficulty) { } private ZombieEntity getZombie(LocalDifficulty localDifficulty, AbstractHorseEntity vehicle) { - ZombieEntity zombie = EntityType.ZOMBIE.create(vehicle.world); - zombie.initialize((ServerWorld) vehicle.world, localDifficulty, SpawnReason.TRIGGERED, null, null); + ZombieEntity zombie = EntityType.ZOMBIE.create(vehicle.getWorld()); + zombie.initialize((ServerWorld) vehicle.getWorld(), localDifficulty, SpawnReason.TRIGGERED, null, null); zombie.setBaby(false); zombie.setPosition(vehicle.getX(), vehicle.getY(), vehicle.getZ()); zombie.timeUntilRegen = 60; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/AnimatedEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/AnimatedEntity.java index 28149315a..37ba3f9a8 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/AnimatedEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/AnimatedEntity.java @@ -4,10 +4,16 @@ import com.faboslav.friendsandfoes.client.render.entity.animation.animator.context.AnimationContextTracker; import com.faboslav.friendsandfoes.client.render.entity.animation.animator.context.KeyframeAnimationContext; +import java.util.ArrayList; + public interface AnimatedEntity { AnimationContextTracker getAnimationContextTracker(); + default ArrayList getAnimations() { + return new ArrayList<>(); + } + default int getKeyframeAnimationTicks() { return 0; } @@ -33,6 +39,20 @@ default void startKeyframeAnimation(KeyframeAnimation keyframeAnimation, int ini keyframeAnimationContext.getAnimationState().startIfNotRunning(initialTick); } + default void forceStartKeyframeAnimation(KeyframeAnimation keyframeAnimation, int initialTick) { + KeyframeAnimationContext keyframeAnimationContext = this.getAnimationContextTracker().get(keyframeAnimation); + keyframeAnimationContext.setInitialTick(initialTick); + keyframeAnimationContext.getAnimationState().start(initialTick); + } + + default void stopRunningKeyframeAnimations() { + for (KeyframeAnimation keyframeAnimation : this.getAnimations()) { + if (this.getAnimationContextTracker().get(keyframeAnimation).isRunning() == false) { + this.stopKeyframeAnimation(keyframeAnimation); + } + } + } + default void stopKeyframeAnimation(KeyframeAnimation keyframeAnimation) { KeyframeAnimationContext keyframeAnimationContext = this.getAnimationContextTracker().get(keyframeAnimation); keyframeAnimationContext.setInitialTick(0); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Keyframe.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Keyframe.java index 34e34f62b..288903284 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Keyframe.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Keyframe.java @@ -1,14 +1,14 @@ package com.faboslav.friendsandfoes.entity.animation; -import net.minecraft.util.math.Vec3f; +import org.joml.Vector3f; public record Keyframe( float timestamp, - Vec3f target, + Vector3f target, Transformation.Interpolation interpolation ) { - public Keyframe(float timestamp, Vec3f target, Transformation.Interpolation interpolation) { + public Keyframe(float timestamp, Vector3f target, Transformation.Interpolation interpolation) { this.timestamp = timestamp; this.target = target; this.interpolation = interpolation; @@ -18,7 +18,7 @@ public float timestamp() { return this.timestamp; } - public Vec3f target() { + public Vector3f target() { return this.target; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Transformation.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Transformation.java index ba61db205..fd178f6c7 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Transformation.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/Transformation.java @@ -1,7 +1,7 @@ package com.faboslav.friendsandfoes.entity.animation; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3f; +import org.joml.Vector3f; public record Transformation( Transformation.Type type, @@ -33,19 +33,18 @@ public enum Type public static class Interpolations { - public static final Transformation.Interpolation LINEAR = (vec3f, delta, keyframes, start, end, f) -> { - Vec3f vec3f2 = keyframes[start].target(); - Vec3f vec3f3 = keyframes[end].target(); - vec3f.set(MathHelper.lerp(delta, vec3f2.getX(), vec3f3.getX()) * f, MathHelper.lerp(delta, vec3f2.getY(), vec3f3.getY()) * f, MathHelper.lerp(delta, vec3f2.getZ(), vec3f3.getZ()) * f); - return vec3f; + public static final Interpolation LINEAR = (vector3f, delta, keyframes, start, end, g) -> { + Vector3f vector3f2 = keyframes[start].target(); + Vector3f vector3f3 = keyframes[end].target(); + return vector3f2.lerp(vector3f3, delta, vector3f).mul(g); }; - public static final Transformation.Interpolation CUBIC = (vec3f, delta, keyframes, start, end, f) -> { - Vec3f vec3f2 = keyframes[Math.max(0, start - 1)].target(); - Vec3f vec3f3 = keyframes[start].target(); - Vec3f vec3f4 = keyframes[end].target(); - Vec3f vec3f5 = keyframes[Math.min(keyframes.length - 1, end + 1)].target(); - vec3f.set(MathHelper.catmullRom(delta, vec3f2.getX(), vec3f3.getX(), vec3f4.getX(), vec3f5.getX()) * f, MathHelper.catmullRom(delta, vec3f2.getY(), vec3f3.getY(), vec3f4.getY(), vec3f5.getY()) * f, MathHelper.catmullRom(delta, vec3f2.getZ(), vec3f3.getZ(), vec3f4.getZ(), vec3f5.getZ()) * f); - return vec3f; + public static final Interpolation CUBIC = (vector3f, delta, keyframes, start, end, g) -> { + Vector3f vector3f2 = keyframes[Math.max(0, start - 1)].target(); + Vector3f vector3f3 = keyframes[start].target(); + Vector3f vector3f4 = keyframes[end].target(); + Vector3f vector3f5 = keyframes[Math.min(keyframes.length - 1, end + 1)].target(); + vector3f.set(MathHelper.catmullRom(delta, vector3f2.x(), vector3f3.x(), vector3f4.x(), vector3f5.x()) * g, MathHelper.catmullRom(delta, vector3f2.y(), vector3f3.y(), vector3f4.y(), vector3f5.y()) * g, MathHelper.catmullRom(delta, vector3f2.z(), vector3f3.z(), vector3f4.z(), vector3f5.z()) * g); + return vector3f; }; public Interpolations() { @@ -54,6 +53,6 @@ public Interpolations() { public interface Interpolation { - Vec3f apply(Vec3f vec3f, float delta, Keyframe[] keyframes, int start, int end, float f); + Vector3f apply(Vector3f vector3f, float delta, Keyframe[] keyframes, int start, int end, float g); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/VectorHelper.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/VectorHelper.java index be757ca3a..7cd272700 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/VectorHelper.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/animation/VectorHelper.java @@ -1,18 +1,18 @@ package com.faboslav.friendsandfoes.entity.animation; -import net.minecraft.util.math.Vec3f; +import org.joml.Vector3f; public final class VectorHelper { - public static Vec3f createTranslationalVector(float f, float g, float h) { - return new Vec3f(f, -g, h); + public static Vector3f createTranslationalVector(float f, float g, float h) { + return new Vector3f(f, -g, h); } - public static Vec3f createRotationalVector(float f, float g, float h) { - return new Vec3f(f * 0.017453292F, g * 0.017453292F, h * 0.017453292F); + public static Vector3f createRotationalVector(float f, float g, float h) { + return new Vector3f(f * 0.017453292F, g * 0.017453292F, h * 0.017453292F); } - public static Vec3f createScalingVector(double d, double e, double f) { - return new Vec3f((float) (d - 1.0), (float) (e - 1.0), (float) (f - 1.0)); + public static Vector3f createScalingVector(double d, double e, double f) { + return new Vector3f((float) (d - 1.0), (float) (e - 1.0), (float) (f - 1.0)); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/pose/RascalEntityPose.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/pose/RascalEntityPose.java new file mode 100644 index 000000000..fbe2ac074 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/pose/RascalEntityPose.java @@ -0,0 +1,22 @@ +package com.faboslav.friendsandfoes.entity.pose; + +import net.minecraft.entity.EntityPose; + +public enum RascalEntityPose +{ + DEFAULT, + NOD, + GIVE_REWARD; + + public String getName() { + return "RASCAL_" + this.name(); + } + + public EntityPose get() { + return EntityPose.valueOf(this.getName()); + } + + static { + EntityPose.values(); + } +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendAndFoesEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendAndFoesEntityRenderer.java index 96591ce57..58c3ae8f8 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendAndFoesEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendAndFoesEntityRenderer.java @@ -27,6 +27,7 @@ public static void postInit() { RegistryHelper.registerEntityRenderer(FriendsAndFoesEntityTypes.ICE_CHUNK, IceologerIceChunkRenderer::new); RegistryHelper.registerEntityRenderer(FriendsAndFoesEntityTypes.MAULER, MaulerEntityRenderer::new); RegistryHelper.registerEntityRenderer(FriendsAndFoesEntityTypes.MOOBLOOM, MoobloomEntityRenderer::new); + RegistryHelper.registerEntityRenderer(FriendsAndFoesEntityTypes.RASCAL, RascalEntityRenderer::new); RegistryHelper.registerEntityRenderer(FriendsAndFoesEntityTypes.TUFF_GOLEM, TuffGolemEntityRenderer::new); RegistryHelper.registerEntityRenderer(FriendsAndFoesEntityTypes.WILDFIRE, WildfireEntityRenderer::new); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesActivities.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesActivities.java index 954e0d6d8..fbeb021f1 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesActivities.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesActivities.java @@ -11,9 +11,11 @@ public final class FriendsAndFoesActivities { public final static Supplier TUFF_GOLEM_HOME; + public final static Supplier RASCAL_WAIT; static { TUFF_GOLEM_HOME = RegistryHelper.registerActivity("tuff_golem_home", () -> new Activity("tuff_golem_home")); + RASCAL_WAIT = RegistryHelper.registerActivity("rascal_wait", () -> new Activity("rascal_wait")); } public static void init() { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlockEntityTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlockEntityTypes.java index c209f084b..8a3fbd5f3 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlockEntityTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlockEntityTypes.java @@ -16,6 +16,7 @@ public final class FriendsAndFoesBlockEntityTypes private static final Set BEEHIVE_BLOCKS = ImmutableList.of( FriendsAndFoesBlocks.ACACIA_BEEHIVE.get(), FriendsAndFoesBlocks.BIRCH_BEEHIVE.get(), + FriendsAndFoesBlocks.CHERRY_BEEHIVE.get(), FriendsAndFoesBlocks.CRIMSON_BEEHIVE.get(), FriendsAndFoesBlocks.DARK_OAK_BEEHIVE.get(), FriendsAndFoesBlocks.JUNGLE_BEEHIVE.get(), diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlockSetTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlockSetTypes.java new file mode 100644 index 000000000..6f2ac968b --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlockSetTypes.java @@ -0,0 +1,36 @@ +package com.faboslav.friendsandfoes.init; + +import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.platform.RegistryHelper; +import net.minecraft.block.BlockSetType; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.sound.SoundEvents; + +import java.util.function.Supplier; + +/** + * @see net.minecraft.block.BlockSetType + */ +public final class FriendsAndFoesBlockSetTypes +{ + public static Supplier COPPER = () -> new BlockSetType( + FriendsAndFoes.makeStringID("copper"), + true, + BlockSoundGroup.COPPER, + SoundEvents.BLOCK_COPPER_PLACE, + SoundEvents.BLOCK_COPPER_PLACE, + SoundEvents.BLOCK_COPPER_PLACE, + SoundEvents.BLOCK_COPPER_PLACE, + SoundEvents.BLOCK_COPPER_PLACE, + SoundEvents.BLOCK_COPPER_PLACE, + SoundEvents.BLOCK_STONE_BUTTON_CLICK_OFF, + SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON + ); + + public static void init() { + RegistryHelper.registerBlockSetType(COPPER); + } + + private FriendsAndFoesBlockSetTypes() { + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlocks.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlocks.java index 8832f59ff..5af0e560d 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlocks.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesBlocks.java @@ -1,9 +1,13 @@ package com.faboslav.friendsandfoes.init; +import com.faboslav.friendsandfoes.block.CopperButtonBlock; import com.faboslav.friendsandfoes.block.Oxidizable; -import com.faboslav.friendsandfoes.block.*; +import com.faboslav.friendsandfoes.block.OxidizableButtonBlock; +import com.faboslav.friendsandfoes.block.OxidizableLightningRodBlock; import com.faboslav.friendsandfoes.platform.RegistryHelper; import net.minecraft.block.*; +import net.minecraft.block.enums.Instrument; +import net.minecraft.block.piston.PistonBehavior; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.sound.BlockSoundGroup; @@ -17,7 +21,9 @@ public final class FriendsAndFoesBlocks public static final Supplier BUTTERCUP; public static final Supplier POTTED_BUTTERCUP; public static final Supplier ACACIA_BEEHIVE; + public static final Supplier BAMBOO_BEEHIVE; public static final Supplier BIRCH_BEEHIVE; + public static final Supplier CHERRY_BEEHIVE; public static final Supplier CRIMSON_BEEHIVE; public static final Supplier DARK_OAK_BEEHIVE; public static final Supplier JUNGLE_BEEHIVE; @@ -41,24 +47,26 @@ public final class FriendsAndFoesBlocks public static final Supplier WAXED_OXIDIZED_LIGHTNING_ROD; static { - BUTTERCUP = RegistryHelper.registerBlock("buttercup", () -> new FlowerBlock(StatusEffects.SATURATION, 6, AbstractBlock.Settings.of(Material.PLANT).noCollision().breakInstantly().sounds(BlockSoundGroup.GRASS))); - POTTED_BUTTERCUP = RegistryHelper.registerBlock("potted_buttercup", () -> new FlowerPotBlock(BUTTERCUP.get(), AbstractBlock.Settings.of(Material.DECORATION).breakInstantly())); - ACACIA_BEEHIVE = RegistryHelper.registerBlock("acacia_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.WOOD).mapColor(MapColor.ORANGE).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - BIRCH_BEEHIVE = RegistryHelper.registerBlock("birch_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.WOOD).mapColor(MapColor.PALE_YELLOW).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - CRIMSON_BEEHIVE = RegistryHelper.registerBlock("crimson_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.NETHER_WOOD).mapColor(MapColor.DULL_PINK).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - DARK_OAK_BEEHIVE = RegistryHelper.registerBlock("dark_oak_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.WOOD).mapColor(MapColor.BROWN).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - JUNGLE_BEEHIVE = RegistryHelper.registerBlock("jungle_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.WOOD).mapColor(MapColor.DIRT_BROWN).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - MANGROVE_BEEHIVE = RegistryHelper.registerBlock("mangrove_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.WOOD).mapColor(MapColor.RED).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - SPRUCE_BEEHIVE = RegistryHelper.registerBlock("spruce_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.WOOD).mapColor(MapColor.SPRUCE_BROWN).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - WARPED_BEEHIVE = RegistryHelper.registerBlock("warped_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.of(Material.NETHER_WOOD).mapColor(MapColor.DARK_AQUA).strength(0.6F).sounds(BlockSoundGroup.WOOD))); - COPPER_BUTTON = RegistryHelper.registerBlock("copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.UNAFFECTED, AbstractBlock.Settings.of(Material.DECORATION).noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER))); - EXPOSED_COPPER_BUTTON = RegistryHelper.registerBlock("exposed_copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.EXPOSED, AbstractBlock.Settings.of(Material.DECORATION).noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER))); - WEATHERED_COPPER_BUTTON = RegistryHelper.registerBlock("weathered_copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.WEATHERED, AbstractBlock.Settings.of(Material.DECORATION).noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER))); - OXIDIZED_COPPER_BUTTON = RegistryHelper.registerBlock("oxidized_copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.OXIDIZED, AbstractBlock.Settings.of(Material.DECORATION).noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER))); - WAXED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_copper_button", () -> new CopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()))); - WAXED_EXPOSED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_exposed_copper_button", () -> new ExposedCopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()))); - WAXED_WEATHERED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_weathered_copper_button", () -> new WeatheredCopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()))); - WAXED_OXIDIZED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_oxidized_copper_button", () -> new OxidizedCopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()))); + BUTTERCUP = RegistryHelper.registerBlock("buttercup", () -> new FlowerBlock(StatusEffects.SATURATION, 6, AbstractBlock.Settings.create().mapColor(MapColor.DARK_GREEN).noCollision().breakInstantly().sounds(BlockSoundGroup.GRASS).offset(AbstractBlock.OffsetType.XZ).pistonBehavior(PistonBehavior.DESTROY))); + POTTED_BUTTERCUP = RegistryHelper.registerBlock("potted_buttercup", () -> new FlowerPotBlock(BUTTERCUP.get(), AbstractBlock.Settings.create().breakInstantly().nonOpaque().pistonBehavior(PistonBehavior.DESTROY))); + ACACIA_BEEHIVE = RegistryHelper.registerBlock("acacia_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.ORANGE).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + BAMBOO_BEEHIVE = RegistryHelper.registerBlock("bamboo_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.YELLOW).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + BIRCH_BEEHIVE = RegistryHelper.registerBlock("birch_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.PALE_YELLOW).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + CHERRY_BEEHIVE = RegistryHelper.registerBlock("cherry_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.TERRACOTTA_WHITE).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + CRIMSON_BEEHIVE = RegistryHelper.registerBlock("crimson_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.DULL_PINK).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + DARK_OAK_BEEHIVE = RegistryHelper.registerBlock("dark_oak_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.BROWN).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + JUNGLE_BEEHIVE = RegistryHelper.registerBlock("jungle_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.DIRT_BROWN).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + MANGROVE_BEEHIVE = RegistryHelper.registerBlock("mangrove_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.RED).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + SPRUCE_BEEHIVE = RegistryHelper.registerBlock("spruce_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.SPRUCE_BROWN).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + WARPED_BEEHIVE = RegistryHelper.registerBlock("warped_beehive", () -> new BeehiveBlock(AbstractBlock.Settings.create().mapColor(MapColor.DARK_AQUA).strength(0.6F).sounds(BlockSoundGroup.WOOD).instrument(Instrument.BASS).burnable())); + COPPER_BUTTON = RegistryHelper.registerBlock("copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.UNAFFECTED, AbstractBlock.Settings.create().noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER), 10)); + EXPOSED_COPPER_BUTTON = RegistryHelper.registerBlock("exposed_copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.EXPOSED, AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER), 7)); + WEATHERED_COPPER_BUTTON = RegistryHelper.registerBlock("weathered_copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.WEATHERED, AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER), 4)); + OXIDIZED_COPPER_BUTTON = RegistryHelper.registerBlock("oxidized_copper_button", () -> new OxidizableButtonBlock(Oxidizable.OxidationLevel.OXIDIZED, AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).noCollision().strength(0.5F).sounds(BlockSoundGroup.COPPER), 1)); + WAXED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_copper_button", () -> new CopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()), 10)); + WAXED_EXPOSED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_exposed_copper_button", () -> new CopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()), 7)); + WAXED_WEATHERED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_weathered_copper_button", () -> new CopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()), 4)); + WAXED_OXIDIZED_COPPER_BUTTON = RegistryHelper.registerBlock("waxed_oxidized_copper_button", () -> new CopperButtonBlock(AbstractBlock.Settings.copy(COPPER_BUTTON.get()), 1)); EXPOSED_LIGHTNING_ROD = RegistryHelper.registerBlock("exposed_lightning_rod", () -> new OxidizableLightningRodBlock(Oxidizable.OxidationLevel.EXPOSED, AbstractBlock.Settings.copy(Blocks.LIGHTNING_ROD))); WEATHERED_LIGHTNING_ROD = RegistryHelper.registerBlock("weathered_lightning_rod", () -> new OxidizableLightningRodBlock(Oxidizable.OxidationLevel.WEATHERED, AbstractBlock.Settings.copy(Blocks.LIGHTNING_ROD))); OXIDIZED_LIGHTNING_ROD = RegistryHelper.registerBlock("oxidized_lightning_rod", () -> new OxidizableLightningRodBlock(Oxidizable.OxidationLevel.OXIDIZED, AbstractBlock.Settings.copy(Blocks.LIGHTNING_ROD))); @@ -80,7 +88,9 @@ private static void registerFlammableBlocks() { int beehiveSpreadChance = 20; RegistryHelper.registerFlammableBlock(ACACIA_BEEHIVE, beehiveBurnChance, beehiveSpreadChance); + RegistryHelper.registerFlammableBlock(BAMBOO_BEEHIVE, beehiveBurnChance, beehiveSpreadChance); RegistryHelper.registerFlammableBlock(BIRCH_BEEHIVE, beehiveBurnChance, beehiveSpreadChance); + RegistryHelper.registerFlammableBlock(CHERRY_BEEHIVE, beehiveBurnChance, beehiveSpreadChance); RegistryHelper.registerFlammableBlock(CRIMSON_BEEHIVE, beehiveBurnChance, beehiveSpreadChance); RegistryHelper.registerFlammableBlock(DARK_OAK_BEEHIVE, beehiveBurnChance, beehiveSpreadChance); RegistryHelper.registerFlammableBlock(JUNGLE_BEEHIVE, beehiveBurnChance, beehiveSpreadChance); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesCriteria.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesCriteria.java index 2dbc6e032..3f1f7037e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesCriteria.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesCriteria.java @@ -1,6 +1,7 @@ package com.faboslav.friendsandfoes.init; import com.faboslav.friendsandfoes.advancements.criterion.ActivateZombieHorseTrapCriterion; +import com.faboslav.friendsandfoes.advancements.criterion.CompleteHideAndSeekGameCriterion; import com.faboslav.friendsandfoes.advancements.criterion.TameGlareCriterion; import net.minecraft.advancement.criterion.Criteria; import net.minecraft.advancement.criterion.Criterion; @@ -9,10 +10,12 @@ public final class FriendsAndFoesCriteria { public static final TameGlareCriterion TAME_GLARE; public static final ActivateZombieHorseTrapCriterion ACTIVATE_ZOMBIE_HORSE_TRAP; + public static final CompleteHideAndSeekGameCriterion COMPLETE_HIDE_AND_SEEK_GAME; static { TAME_GLARE = register(new TameGlareCriterion()); ACTIVATE_ZOMBIE_HORSE_TRAP = register(new ActivateZombieHorseTrapCriterion()); + COMPLETE_HIDE_AND_SEEK_GAME = register(new CompleteHideAndSeekGameCriterion()); } private static > T register(T criterion) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityModelLayer.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityModelLayer.java index 2a90747e7..0470802f5 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityModelLayer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityModelLayer.java @@ -22,6 +22,7 @@ public final class FriendsAndFoesEntityModelLayer public static final EntityModelLayer ICEOLOGER_ICE_CHUNK_LAYER; public static final EntityModelLayer MAULER_LAYER; public static final EntityModelLayer MOOBLOOM_LAYER; + public static final EntityModelLayer RASCAL_LAYER; public static final EntityModelLayer TUFF_GOLEM_LAYER; public static final EntityModelLayer WILDFIRE_LAYER; public static final EntityModelLayer PLAYER_ILLUSION_LAYER; @@ -33,6 +34,7 @@ public final class FriendsAndFoesEntityModelLayer ICEOLOGER_ICE_CHUNK_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("iceologer_ice_chunk"), "main"); MAULER_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("mauler"), "main"); MOOBLOOM_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("moobloom"), "main"); + RASCAL_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("rascal"), "main"); TUFF_GOLEM_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("tuff_golem"), "main"); WILDFIRE_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("wildfire"), "main"); PLAYER_ILLUSION_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("player_illusion"), "main"); @@ -45,6 +47,7 @@ public static void init() { RegistryHelper.registerEntityModelLayer(ICEOLOGER_ICE_CHUNK_LAYER, IceologerIceChunkModel::getTexturedModelData); RegistryHelper.registerEntityModelLayer(MAULER_LAYER, MaulerEntityModel::getTexturedModelData); RegistryHelper.registerEntityModelLayer(MOOBLOOM_LAYER, CowEntityModel::getTexturedModelData); + RegistryHelper.registerEntityModelLayer(RASCAL_LAYER, RascalEntityModel::getTexturedModelData); RegistryHelper.registerEntityModelLayer(TUFF_GOLEM_LAYER, TuffGolemEntityModel::getTexturedModelData); RegistryHelper.registerEntityModelLayer(WILDFIRE_LAYER, WildfireEntityModel::getTexturedModelData); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityTypes.java index 595090faf..fb9031318 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesEntityTypes.java @@ -31,6 +31,7 @@ public final class FriendsAndFoesEntityTypes public static final Supplier> ICE_CHUNK; public static final Supplier> MAULER; public static final Supplier> MOOBLOOM; + public static final Supplier> RASCAL; public static final Supplier> TUFF_GOLEM; public static final Supplier> WILDFIRE; public static final Supplier> PLAYER_ILLUSION; @@ -43,6 +44,7 @@ public final class FriendsAndFoesEntityTypes ICE_CHUNK = RegistryHelper.registerEntityType("ice_chunk", () -> EntityType.Builder.create(IceologerIceChunkEntity::new, SpawnGroup.MISC).makeFireImmune().setDimensions(2.5F, 1.0F).maxTrackingRange(6).build(FriendsAndFoes.makeStringID("ice_chunk"))); MAULER = RegistryHelper.registerEntityType("mauler", () -> EntityType.Builder.create(MaulerEntity::new, SpawnGroup.CREATURE).setDimensions(0.5625F, 0.5625F).maxTrackingRange(10).build(FriendsAndFoes.makeStringID("mauler"))); MOOBLOOM = RegistryHelper.registerEntityType("moobloom", () -> EntityType.Builder.create(MoobloomEntity::new, SpawnGroup.CREATURE).setDimensions(0.9F, 1.4F).maxTrackingRange(10).build(FriendsAndFoes.makeStringID("moobloom"))); + RASCAL = RegistryHelper.registerEntityType("rascal", () -> EntityType.Builder.create(RascalEntity::new, CustomSpawnGroup.getRascalsCategory()).setDimensions(0.9F, 1.25F).maxTrackingRange(10).build(FriendsAndFoes.makeStringID("rascal"))); TUFF_GOLEM = RegistryHelper.registerEntityType("tuff_golem", () -> EntityType.Builder.create(TuffGolemEntity::new, SpawnGroup.MISC).setDimensions(0.75F, 1.0625F).maxTrackingRange(10).build(FriendsAndFoes.makeStringID("tuff_golem"))); WILDFIRE = RegistryHelper.registerEntityType("wildfire", () -> EntityType.Builder.create(WildfireEntity::new, SpawnGroup.MONSTER).setDimensions(0.7F * WildfireEntityRenderer.SCALE, 1.875F * WildfireEntityRenderer.SCALE).maxTrackingRange(10).makeFireImmune().build(FriendsAndFoes.makeStringID("wildfire"))); PLAYER_ILLUSION = RegistryHelper.registerEntityType("player_illusion", () -> EntityType.Builder.create(PlayerIllusionEntity::new, SpawnGroup.MISC).setDimensions(0.7F, 1.875F).maxTrackingRange(10).makeFireImmune().build(FriendsAndFoes.makeStringID("player_illusion"))); @@ -65,6 +67,7 @@ public static void createMobAttributes() { RegistryHelper.registerEntityAttribute(FriendsAndFoesEntityTypes.ICEOLOGER, IceologerEntity::createAttributes); RegistryHelper.registerEntityAttribute(FriendsAndFoesEntityTypes.MAULER, MaulerEntity::createAttributes); RegistryHelper.registerEntityAttribute(FriendsAndFoesEntityTypes.MOOBLOOM, MoobloomEntity::createCowAttributes); + RegistryHelper.registerEntityAttribute(FriendsAndFoesEntityTypes.RASCAL, RascalEntity::createAttributes); RegistryHelper.registerEntityAttribute(FriendsAndFoesEntityTypes.TUFF_GOLEM, TuffGolemEntity::createAttributes); RegistryHelper.registerEntityAttribute(FriendsAndFoesEntityTypes.WILDFIRE, WildfireEntity::createAttributes); RegistryHelper.registerEntityAttribute(FriendsAndFoesEntityTypes.PLAYER_ILLUSION, PlayerIllusionEntity::createMobAttributes); @@ -75,6 +78,7 @@ public static void initSpawnRestrictions() { SpawnRestrictionAccessor.callRegister(ICEOLOGER.get(), SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, IceologerEntity::canSpawn); SpawnRestrictionAccessor.callRegister(MAULER.get(), SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, MaulerEntity::canSpawn); SpawnRestrictionAccessor.callRegister(MOOBLOOM.get(), SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, MoobloomEntity::canSpawn); + SpawnRestrictionAccessor.callRegister(RASCAL.get(), SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RascalEntity::canSpawn); } public static void addSpawns() { @@ -94,6 +98,10 @@ public static void addSpawns() { BiomeModifications.addMobSpawn(FriendsAndFoesTags.HAS_LESS_MOOBLOOMS, MOOBLOOM.get(), SpawnGroup.CREATURE, config.moobloomFlowerForestSpawnWeight, config.moobloomFlowerForestSpawnMinGroupSize, config.moobloomFlowerForestSpawnMaxGroupSize); BiomeModifications.addMobSpawn(FriendsAndFoesTags.HAS_MORE_MOOBLOOMS, MOOBLOOM.get(), SpawnGroup.CREATURE, config.moobloomMeadowSpawnWeight, config.moobloomMeadowSpawnMinGroupSize, config.moobloomMeadowSpawnMaxGroupSize); } + + if (config.enableRascal && config.enableRascalSpawn) { + BiomeModifications.addMobSpawn(FriendsAndFoesTags.HAS_RASCAL, RASCAL.get(), CustomSpawnGroup.getRascalsCategory(), 4, 1, 1); + } } public static void addMoobloomVariants() { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesItems.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesItems.java index f31a12d25..420964e4d 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesItems.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesItems.java @@ -3,7 +3,6 @@ import com.faboslav.friendsandfoes.item.FriendsAndFoesArmorMaterials; import com.faboslav.friendsandfoes.platform.RegistryHelper; import net.minecraft.entity.EntityType; -import net.minecraft.entity.EquipmentSlot; import net.minecraft.item.*; import net.minecraft.util.Rarity; @@ -20,11 +19,14 @@ public final class FriendsAndFoesItems public final static Supplier ILLUSIONER_SPAWN_EGG; public final static Supplier MAULER_SPAWN_EGG; public final static Supplier MOOBLOOM_SPAWN_EGG; + public final static Supplier RASCAL_SPAWN_EGG; public final static Supplier TUFF_GOLEM_SPAWN_EGG; public final static Supplier WILDFIRE_SPAWN_EGG; public static final Supplier BUTTERCUP; public static final Supplier ACACIA_BEEHIVE; + public static final Supplier BAMBOO_BEEHIVE; public static final Supplier BIRCH_BEEHIVE; + public static final Supplier CHERRY_BEEHIVE; public static final Supplier CRIMSON_BEEHIVE; public static final Supplier DARK_OAK_BEEHIVE; public static final Supplier JUNGLE_BEEHIVE; @@ -52,47 +54,100 @@ public final class FriendsAndFoesItems public static final Supplier TOTEM_OF_ILLUSION; static { - COPPER_GOLEM_SPAWN_EGG = RegistryHelper.registerItem("copper_golem_spawn_egg", () -> new SpawnEggItem(FriendsAndFoesEntityTypes.COPPER_GOLEM.get(), 0x9A5038, 0xE3826C, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - GLARE_SPAWN_EGG = RegistryHelper.registerItem("glare_spawn_egg", () -> new SpawnEggItem(FriendsAndFoesEntityTypes.GLARE.get(), 0x70922D, 0x6A5227, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - ICEOLOGER_SPAWN_EGG = RegistryHelper.registerItem("iceologer_spawn_egg", () -> new SpawnEggItem(FriendsAndFoesEntityTypes.ICEOLOGER.get(), 0x173873, 0x949B9B, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - ILLUSIONER_SPAWN_EGG = RegistryHelper.registerItem("illusioner_spawn_egg", () -> new SpawnEggItem(EntityType.ILLUSIONER, 0x603E5C, 0x888E8E, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - MAULER_SPAWN_EGG = RegistryHelper.registerItem("mauler_spawn_egg", () -> new SpawnEggItem(FriendsAndFoesEntityTypes.MAULER.get(), 0x534F25, 0x817B39, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - MOOBLOOM_SPAWN_EGG = RegistryHelper.registerItem("moobloom_spawn_egg", () -> new SpawnEggItem(FriendsAndFoesEntityTypes.MOOBLOOM.get(), 0xF7EDC1, 0xFACA00, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - TUFF_GOLEM_SPAWN_EGG = RegistryHelper.registerItem("tuff_golem_spawn_egg", () -> new SpawnEggItem(FriendsAndFoesEntityTypes.TUFF_GOLEM.get(), 0xA0A297, 0x5D5D52, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - WILDFIRE_SPAWN_EGG = RegistryHelper.registerItem("wildfire_spawn_egg", () -> new SpawnEggItem(FriendsAndFoesEntityTypes.WILDFIRE.get(), 0x6C3100, 0xFFD528, new Item.Settings().maxCount(64).group(ItemGroup.MISC))); - BUTTERCUP = RegistryHelper.registerItem("buttercup", () -> new BlockItem(FriendsAndFoesBlocks.BUTTERCUP.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - ACACIA_BEEHIVE = RegistryHelper.registerItem("acacia_beehive", () -> new BlockItem(FriendsAndFoesBlocks.ACACIA_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - BIRCH_BEEHIVE = RegistryHelper.registerItem("birch_beehive", () -> new BlockItem(FriendsAndFoesBlocks.BIRCH_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - CRIMSON_BEEHIVE = RegistryHelper.registerItem("crimson_beehive", () -> new BlockItem(FriendsAndFoesBlocks.CRIMSON_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - DARK_OAK_BEEHIVE = RegistryHelper.registerItem("dark_oak_beehive", () -> new BlockItem(FriendsAndFoesBlocks.DARK_OAK_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - JUNGLE_BEEHIVE = RegistryHelper.registerItem("jungle_beehive", () -> new BlockItem(FriendsAndFoesBlocks.JUNGLE_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - MANGROVE_BEEHIVE = RegistryHelper.registerItem("mangrove_beehive", () -> new BlockItem(FriendsAndFoesBlocks.MANGROVE_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - SPRUCE_BEEHIVE = RegistryHelper.registerItem("spruce_beehive", () -> new BlockItem(FriendsAndFoesBlocks.SPRUCE_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - WARPED_BEEHIVE = RegistryHelper.registerItem("warped_beehive", () -> new BlockItem(FriendsAndFoesBlocks.WARPED_BEEHIVE.get(), new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(64))); - COPPER_BUTTON = RegistryHelper.registerItem("copper_button", () -> new BlockItem(FriendsAndFoesBlocks.COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - EXPOSED_COPPER_BUTTON = RegistryHelper.registerItem("exposed_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.EXPOSED_COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WEATHERED_COPPER_BUTTON = RegistryHelper.registerItem("weathered_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WEATHERED_COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - OXIDIZED_COPPER_BUTTON = RegistryHelper.registerItem("oxidized_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.OXIDIZED_COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_EXPOSED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_exposed_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_EXPOSED_COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_WEATHERED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_weathered_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_WEATHERED_COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_OXIDIZED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_oxidized_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_OXIDIZED_COPPER_BUTTON.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - EXPOSED_LIGHTNING_ROD = RegistryHelper.registerItem("exposed_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.EXPOSED_LIGHTNING_ROD.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WEATHERED_LIGHTNING_ROD = RegistryHelper.registerItem("weathered_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WEATHERED_LIGHTNING_ROD.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - OXIDIZED_LIGHTNING_ROD = RegistryHelper.registerItem("oxidized_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.OXIDIZED_LIGHTNING_ROD.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_LIGHTNING_ROD.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_EXPOSED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_exposed_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_EXPOSED_LIGHTNING_ROD.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_WEATHERED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_weathered_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_WEATHERED_LIGHTNING_ROD.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WAXED_OXIDIZED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_oxidized_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_OXIDIZED_LIGHTNING_ROD.get(), new Item.Settings().group(ItemGroup.REDSTONE).maxCount(64))); - WILDFIRE_CROWN = RegistryHelper.registerItem("wildfire_crown", () -> new ArmorItem(FriendsAndFoesArmorMaterials.WILDFIRE, EquipmentSlot.HEAD, (new Item.Settings()).group(ItemGroup.COMBAT).fireproof())); - WILDFIRE_CROWN_FRAGMENT = RegistryHelper.registerItem("wildfire_crown_fragment", () -> new Item((new Item.Settings()).group(ItemGroup.MATERIALS))); - TOTEM_OF_FREEZING = RegistryHelper.registerItem("totem_of_freezing", () -> new Item((new Item.Settings()).maxCount(1).group(ItemGroup.COMBAT).rarity(Rarity.UNCOMMON))); - TOTEM_OF_ILLUSION = RegistryHelper.registerItem("totem_of_illusion", () -> new Item((new Item.Settings()).maxCount(1).group(ItemGroup.COMBAT).rarity(Rarity.UNCOMMON))); + COPPER_GOLEM_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("copper_golem_spawn_egg", FriendsAndFoesEntityTypes.COPPER_GOLEM, 0x9A5038, 0xE3826C, new Item.Settings().maxCount(64)); + GLARE_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("glare_spawn_egg", FriendsAndFoesEntityTypes.GLARE, 0x70922D, 0x6A5227, new Item.Settings().maxCount(64)); + ICEOLOGER_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("iceologer_spawn_egg", FriendsAndFoesEntityTypes.ICEOLOGER, 0x173873, 0x949B9B, new Item.Settings().maxCount(64)); + ILLUSIONER_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("illusioner_spawn_egg", () -> EntityType.ILLUSIONER, 0x603E5C, 0x888E8E, new Item.Settings().maxCount(64)); + MAULER_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("mauler_spawn_egg", FriendsAndFoesEntityTypes.MAULER, 0x534F25, 0x817B39, new Item.Settings().maxCount(64)); + MOOBLOOM_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("moobloom_spawn_egg", FriendsAndFoesEntityTypes.MOOBLOOM, 0xF7EDC1, 0xFACA00, new Item.Settings().maxCount(64)); + RASCAL_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("rascal_spawn_egg", FriendsAndFoesEntityTypes.RASCAL, 0x05736A, 0x8A521C, new Item.Settings().maxCount(64)); + TUFF_GOLEM_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("tuff_golem_spawn_egg", FriendsAndFoesEntityTypes.TUFF_GOLEM, 0xA0A297, 0x5D5D52, new Item.Settings().maxCount(64)); + WILDFIRE_SPAWN_EGG = RegistryHelper.registerSpawnEggItem("wildfire_spawn_egg", FriendsAndFoesEntityTypes.WILDFIRE, 0x6C3100, 0xFFD528, new Item.Settings().maxCount(64)); + BUTTERCUP = RegistryHelper.registerItem("buttercup", () -> new BlockItem(FriendsAndFoesBlocks.BUTTERCUP.get(), new Item.Settings().maxCount(64))); + ACACIA_BEEHIVE = RegistryHelper.registerItem("acacia_beehive", () -> new BlockItem(FriendsAndFoesBlocks.ACACIA_BEEHIVE.get(), new Item.Settings().maxCount(64))); + BAMBOO_BEEHIVE = RegistryHelper.registerItem("bamboo_beehive", () -> new BlockItem(FriendsAndFoesBlocks.BAMBOO_BEEHIVE.get(), new Item.Settings().maxCount(64))); + BIRCH_BEEHIVE = RegistryHelper.registerItem("birch_beehive", () -> new BlockItem(FriendsAndFoesBlocks.BIRCH_BEEHIVE.get(), new Item.Settings().maxCount(64))); + CHERRY_BEEHIVE = RegistryHelper.registerItem("cherry_beehive", () -> new BlockItem(FriendsAndFoesBlocks.CHERRY_BEEHIVE.get(), new Item.Settings().maxCount(64))); + CRIMSON_BEEHIVE = RegistryHelper.registerItem("crimson_beehive", () -> new BlockItem(FriendsAndFoesBlocks.CRIMSON_BEEHIVE.get(), new Item.Settings().maxCount(64))); + DARK_OAK_BEEHIVE = RegistryHelper.registerItem("dark_oak_beehive", () -> new BlockItem(FriendsAndFoesBlocks.DARK_OAK_BEEHIVE.get(), new Item.Settings().maxCount(64))); + JUNGLE_BEEHIVE = RegistryHelper.registerItem("jungle_beehive", () -> new BlockItem(FriendsAndFoesBlocks.JUNGLE_BEEHIVE.get(), new Item.Settings().maxCount(64))); + MANGROVE_BEEHIVE = RegistryHelper.registerItem("mangrove_beehive", () -> new BlockItem(FriendsAndFoesBlocks.MANGROVE_BEEHIVE.get(), new Item.Settings().maxCount(64))); + SPRUCE_BEEHIVE = RegistryHelper.registerItem("spruce_beehive", () -> new BlockItem(FriendsAndFoesBlocks.SPRUCE_BEEHIVE.get(), new Item.Settings().maxCount(64))); + WARPED_BEEHIVE = RegistryHelper.registerItem("warped_beehive", () -> new BlockItem(FriendsAndFoesBlocks.WARPED_BEEHIVE.get(), new Item.Settings().maxCount(64))); + COPPER_BUTTON = RegistryHelper.registerItem("copper_button", () -> new BlockItem(FriendsAndFoesBlocks.COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + EXPOSED_COPPER_BUTTON = RegistryHelper.registerItem("exposed_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.EXPOSED_COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + WEATHERED_COPPER_BUTTON = RegistryHelper.registerItem("weathered_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WEATHERED_COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + OXIDIZED_COPPER_BUTTON = RegistryHelper.registerItem("oxidized_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.OXIDIZED_COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + WAXED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + WAXED_EXPOSED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_exposed_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_EXPOSED_COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + WAXED_WEATHERED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_weathered_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_WEATHERED_COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + WAXED_OXIDIZED_COPPER_BUTTON = RegistryHelper.registerItem("waxed_oxidized_copper_button", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_OXIDIZED_COPPER_BUTTON.get(), new Item.Settings().maxCount(64))); + EXPOSED_LIGHTNING_ROD = RegistryHelper.registerItem("exposed_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.EXPOSED_LIGHTNING_ROD.get(), new Item.Settings().maxCount(64))); + WEATHERED_LIGHTNING_ROD = RegistryHelper.registerItem("weathered_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WEATHERED_LIGHTNING_ROD.get(), new Item.Settings().maxCount(64))); + OXIDIZED_LIGHTNING_ROD = RegistryHelper.registerItem("oxidized_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.OXIDIZED_LIGHTNING_ROD.get(), new Item.Settings().maxCount(64))); + WAXED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_LIGHTNING_ROD.get(), new Item.Settings().maxCount(64))); + WAXED_EXPOSED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_exposed_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_EXPOSED_LIGHTNING_ROD.get(), new Item.Settings().maxCount(64))); + WAXED_WEATHERED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_weathered_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_WEATHERED_LIGHTNING_ROD.get(), new Item.Settings().maxCount(64))); + WAXED_OXIDIZED_LIGHTNING_ROD = RegistryHelper.registerItem("waxed_oxidized_lightning_rod", () -> new BlockItem(FriendsAndFoesBlocks.WAXED_OXIDIZED_LIGHTNING_ROD.get(), new Item.Settings().maxCount(64))); + WILDFIRE_CROWN = RegistryHelper.registerItem("wildfire_crown", () -> new ArmorItem(FriendsAndFoesArmorMaterials.WILDFIRE, ArmorItem.Type.HELMET, (new Item.Settings()).fireproof())); + WILDFIRE_CROWN_FRAGMENT = RegistryHelper.registerItem("wildfire_crown_fragment", () -> new Item((new Item.Settings()))); + TOTEM_OF_FREEZING = RegistryHelper.registerItem("totem_of_freezing", () -> new Item((new Item.Settings()).maxCount(1).rarity(Rarity.UNCOMMON))); + TOTEM_OF_ILLUSION = RegistryHelper.registerItem("totem_of_illusion", () -> new Item((new Item.Settings()).maxCount(1).rarity(Rarity.UNCOMMON))); } public static void init() { } + public static void postInit() { + addToItemGroups(); + } + + private static void addToItemGroups() { + RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, COPPER_GOLEM_SPAWN_EGG.get(), Items.CAVE_SPIDER_SPAWN_EGG); + RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, GLARE_SPAWN_EGG.get(), COPPER_GOLEM_SPAWN_EGG.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, ICEOLOGER_SPAWN_EGG.get(), Items.HORSE_SPAWN_EGG); + RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, ILLUSIONER_SPAWN_EGG.get(), ICEOLOGER_SPAWN_EGG.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, MAULER_SPAWN_EGG.get(), Items.MAGMA_CUBE_SPAWN_EGG); + RegistryHelper.addToItemGroupBefore(ItemGroups.SPAWN_EGGS, MOOBLOOM_SPAWN_EGG.get(), Items.MOOSHROOM_SPAWN_EGG); + RegistryHelper.addToItemGroupBefore(ItemGroups.SPAWN_EGGS, TUFF_GOLEM_SPAWN_EGG.get(), Items.TURTLE_SPAWN_EGG); + RegistryHelper.addToItemGroupBefore(ItemGroups.SPAWN_EGGS, RASCAL_SPAWN_EGG.get(), Items.RAVAGER_SPAWN_EGG); + RegistryHelper.addToItemGroupBefore(ItemGroups.SPAWN_EGGS, WILDFIRE_SPAWN_EGG.get(), Items.WITCH_SPAWN_EGG); + RegistryHelper.addToItemGroupAfter(ItemGroups.NATURAL, BUTTERCUP.get(), Items.DANDELION); + + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, SPRUCE_BEEHIVE.get(), Items.BEEHIVE); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, BAMBOO_BEEHIVE.get(), SPRUCE_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, BIRCH_BEEHIVE.get(), BAMBOO_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, JUNGLE_BEEHIVE.get(), BIRCH_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, ACACIA_BEEHIVE.get(), JUNGLE_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, DARK_OAK_BEEHIVE.get(), ACACIA_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, MANGROVE_BEEHIVE.get(), DARK_OAK_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, CHERRY_BEEHIVE.get(), MANGROVE_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, CRIMSON_BEEHIVE.get(), CHERRY_BEEHIVE.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, WARPED_BEEHIVE.get(), CRIMSON_BEEHIVE.get()); + + + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, COPPER_BUTTON.get(), Items.STONE_BUTTON); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, EXPOSED_COPPER_BUTTON.get(), COPPER_BUTTON.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WEATHERED_COPPER_BUTTON.get(), EXPOSED_COPPER_BUTTON.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, OXIDIZED_COPPER_BUTTON.get(), WEATHERED_COPPER_BUTTON.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_COPPER_BUTTON.get(), OXIDIZED_COPPER_BUTTON.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_EXPOSED_COPPER_BUTTON.get(), WAXED_COPPER_BUTTON.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_WEATHERED_COPPER_BUTTON.get(), WAXED_EXPOSED_COPPER_BUTTON.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_OXIDIZED_COPPER_BUTTON.get(), WAXED_WEATHERED_COPPER_BUTTON.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, EXPOSED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WEATHERED_LIGHTNING_ROD.get(), EXPOSED_LIGHTNING_ROD.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, OXIDIZED_LIGHTNING_ROD.get(), WEATHERED_LIGHTNING_ROD.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_LIGHTNING_ROD.get(), WEATHERED_LIGHTNING_ROD.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_EXPOSED_LIGHTNING_ROD.get(), WAXED_LIGHTNING_ROD.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_WEATHERED_LIGHTNING_ROD.get(), WAXED_EXPOSED_LIGHTNING_ROD.get()); + RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_OXIDIZED_LIGHTNING_ROD.get(), WAXED_WEATHERED_LIGHTNING_ROD.get()); + + RegistryHelper.addToItemGroupAfter(ItemGroups.INGREDIENTS, WILDFIRE_CROWN_FRAGMENT.get(), Items.SCUTE); + RegistryHelper.addToItemGroupAfter(ItemGroups.COMBAT, WILDFIRE_CROWN.get(), Items.TURTLE_HELMET); + RegistryHelper.addToItemGroupAfter(ItemGroups.COMBAT, TOTEM_OF_FREEZING.get(), Items.TOTEM_OF_UNDYING); + RegistryHelper.addToItemGroupBefore(ItemGroups.COMBAT, TOTEM_OF_ILLUSION.get(), Items.TOTEM_OF_UNDYING); + } + private FriendsAndFoesItems() { } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesMemoryModuleTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesMemoryModuleTypes.java index 75e3f6490..433ef2263 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesMemoryModuleTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesMemoryModuleTypes.java @@ -16,12 +16,14 @@ public final class FriendsAndFoesMemoryModuleTypes public final static Supplier> WILDFIRE_SHOCKWAVE_ATTACK_COOLDOWN; public final static Supplier> WILDFIRE_SUMMON_BLAZE_COOLDOWN; public final static Supplier> TUFF_GOLEM_SLEEP_COOLDOWN; + public final static Supplier> RASCAL_NOD_COOLDOWN; static { WILDFIRE_BARRAGE_ATTACK_COOLDOWN = RegistryHelper.registerMemoryModuleType("wildfire_barrage_attack_cooldown", () -> new MemoryModuleType<>(Optional.of(Codec.INT))); WILDFIRE_SHOCKWAVE_ATTACK_COOLDOWN = RegistryHelper.registerMemoryModuleType("wildfire_shockwave_attack_cooldown", () -> new MemoryModuleType<>(Optional.of(Codec.INT))); WILDFIRE_SUMMON_BLAZE_COOLDOWN = RegistryHelper.registerMemoryModuleType("wildfire_summon_blazes_cooldown", () -> new MemoryModuleType<>(Optional.of(Codec.INT))); TUFF_GOLEM_SLEEP_COOLDOWN = RegistryHelper.registerMemoryModuleType("tuff_golem_sleep_cooldown", () -> new MemoryModuleType<>(Optional.of(Codec.INT))); + RASCAL_NOD_COOLDOWN = RegistryHelper.registerMemoryModuleType("rascal_nod_cooldown", () -> new MemoryModuleType<>(Optional.of(Codec.INT))); } public static void init() { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesPointOfInterestTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesPointOfInterestTypes.java index 5f65ac641..edf5ff606 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesPointOfInterestTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesPointOfInterestTypes.java @@ -3,8 +3,9 @@ import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.platform.RegistryHelper; import net.minecraft.block.Block; -import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryKey; +import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; import net.minecraft.world.poi.PointOfInterestType; import net.minecraft.world.poi.PointOfInterestTypes; @@ -19,7 +20,9 @@ public final class FriendsAndFoesPointOfInterestTypes private static final HashMap> REGISTERED_POINT_OF_INTEREST_TYPES; public final static Supplier ACACIA_BEEHIVE; + public final static Supplier BAMBOO_BEEHIVE; public final static Supplier BIRCH_BEEHIVE; + public final static Supplier CHERRY_BEEHIVE; public final static Supplier CRIMSON_BEEHIVE; public final static Supplier DARK_OAK_BEEHIVE; public final static Supplier JUNGLE_BEEHIVE; @@ -37,7 +40,9 @@ public final class FriendsAndFoesPointOfInterestTypes static { REGISTERED_POINT_OF_INTEREST_TYPES = new HashMap<>(); ACACIA_BEEHIVE = registerPointOfInterest("acacia_beehive", () -> new PointOfInterestType(PointOfInterestTypes.getStatesOfBlock(FriendsAndFoesBlocks.ACACIA_BEEHIVE.get()), 1, 1)); + BAMBOO_BEEHIVE = registerPointOfInterest("bamboo_beehive", () -> new PointOfInterestType(PointOfInterestTypes.getStatesOfBlock(FriendsAndFoesBlocks.BAMBOO_BEEHIVE.get()), 1, 1)); BIRCH_BEEHIVE = registerPointOfInterest("birch_beehive", () -> new PointOfInterestType(PointOfInterestTypes.getStatesOfBlock(FriendsAndFoesBlocks.BIRCH_BEEHIVE.get()), 1, 1)); + CHERRY_BEEHIVE = registerPointOfInterest("cherry_beehive", () -> new PointOfInterestType(PointOfInterestTypes.getStatesOfBlock(FriendsAndFoesBlocks.CHERRY_BEEHIVE.get()), 1, 1)); CRIMSON_BEEHIVE = registerPointOfInterest("crimson_beehive", () -> new PointOfInterestType(PointOfInterestTypes.getStatesOfBlock(FriendsAndFoesBlocks.CRIMSON_BEEHIVE.get()), 1, 1)); DARK_OAK_BEEHIVE = registerPointOfInterest("dark_oak_beehive", () -> new PointOfInterestType(PointOfInterestTypes.getStatesOfBlock(FriendsAndFoesBlocks.DARK_OAK_BEEHIVE.get()), 1, 1)); JUNGLE_BEEHIVE = registerPointOfInterest("jungle_beehive", () -> new PointOfInterestType(PointOfInterestTypes.getStatesOfBlock(FriendsAndFoesBlocks.JUNGLE_BEEHIVE.get()), 1, 1)); @@ -79,13 +84,12 @@ private static void fillMissingPointOfInterestMapValueForBlock( Block pointOfInterestBlock ) { var blockStates = PointOfInterestTypes.getStatesOfBlock(pointOfInterestBlock); - PointOfInterestTypes.POI_STATES.addAll(blockStates); blockStates.forEach((state) -> { PointOfInterestTypes.POI_STATES_TO_TYPE.put( state, - Registry.POINT_OF_INTEREST_TYPE.getEntry( + Registries.POINT_OF_INTEREST_TYPE.getEntry( RegistryKey.of( - Registry.POINT_OF_INTEREST_TYPE_KEY, FriendsAndFoes.makeID(name) + RegistryKeys.POINT_OF_INTEREST_TYPE, FriendsAndFoes.makeID(name) ) ).get() ); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java index be87fb8b1..a2e06c8eb 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java @@ -39,6 +39,13 @@ public final class FriendsAndFoesSoundEvents public static final Supplier ENTITY_MAULER_HURT; public static final Supplier ENTITY_MOOBLOOM_CONVERT; public static final Supplier ENTITY_PLAYER_MIRROR_MOVE; + public static final Supplier ENTITY_RASCAL_AMBIENT; + public static final Supplier ENTITY_RASCAL_DISAPPEAR; + public static final Supplier ENTITY_RASCAL_HURT; + public static final Supplier ENTITY_RASCAL_NOD; + public static final Supplier ENTITY_RASCAL_REAPPEAR; + public static final Supplier ENTITY_RASCAL_REWARD; + public static final Supplier ENTITY_RASCAL_REWARD_BAD; public static final Supplier ENTITY_TUFF_GOLEM_GLUE_ON; public static final Supplier ENTITY_TUFF_GOLEM_GLUE_OFF; public static final Supplier ENTITY_TUFF_GOLEM_HURT; @@ -85,6 +92,13 @@ public final class FriendsAndFoesSoundEvents ENTITY_MAULER_HURT = register("entity", "mauler.hurt"); ENTITY_MOOBLOOM_CONVERT = register("entity", "moobloom.convert"); ENTITY_PLAYER_MIRROR_MOVE = register("entity", "player.mirror_move"); + ENTITY_RASCAL_AMBIENT = register("entity", "rascal.ambient"); + ENTITY_RASCAL_DISAPPEAR = register("entity", "rascal.disappear"); + ENTITY_RASCAL_HURT = register("entity", "rascal.hurt"); + ENTITY_RASCAL_NOD = register("entity", "rascal.nod"); + ENTITY_RASCAL_REAPPEAR = register("entity", "rascal.reappear"); + ENTITY_RASCAL_REWARD = register("entity", "rascal.reward"); + ENTITY_RASCAL_REWARD_BAD = register("entity", "rascal.reward_bad"); ENTITY_TUFF_GOLEM_GLUE_ON = register("entity", "tuff_golem.glue_on"); ENTITY_TUFF_GOLEM_GLUE_OFF = register("entity", "tuff_golem.glue_off"); ENTITY_TUFF_GOLEM_HURT = register("entity", "tuff_golem.hurt"); @@ -106,7 +120,7 @@ public final class FriendsAndFoesSoundEvents private static Supplier register(String type, String name) { String id = type + "." + name; - var soundEvent = new SoundEvent(FriendsAndFoes.makeID(id)); + var soundEvent = SoundEvent.of(FriendsAndFoes.makeID(id)); return RegistryHelper.registerSoundEvent(id, () -> soundEvent); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesStructurePoolElements.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesStructurePoolElements.java new file mode 100644 index 000000000..45ddf49be --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesStructurePoolElements.java @@ -0,0 +1,45 @@ +package com.faboslav.friendsandfoes.init; + +import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.util.StructurePoolHelper; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.server.MinecraftServer; +import net.minecraft.structure.pool.StructurePool; +import net.minecraft.util.Identifier; + +/** + * @see net.minecraft.structure.pool.StructurePool + */ +public final class FriendsAndFoesStructurePoolElements +{ + public static void init(MinecraftServer server) { + Registry templatePoolRegistry = server.getRegistryManager().get(RegistryKeys.TEMPLATE_POOL); + + Identifier plainsPoolLocation = new Identifier("minecraft:village/plains/houses"); + Identifier desertPoolLocation = new Identifier("minecraft:village/desert/houses"); + Identifier savannaPoolLocation = new Identifier("minecraft:village/savanna/houses"); + Identifier taigaPoolLocation = new Identifier("minecraft:village/taiga/houses"); + Identifier ancientCityCenterPoolLocation = new Identifier("minecraft:ancient_city/city_center"); + + if (FriendsAndFoes.getConfig().generateBeekeeperAreaStructure) { + StructurePoolHelper.addElementToPool(templatePoolRegistry, plainsPoolLocation, "village/plains/houses/plains_beekeeper_area", FriendsAndFoes.getConfig().beekeeperAreaStructureWeight); + StructurePoolHelper.addElementToPool(templatePoolRegistry, savannaPoolLocation, "village/savanna/houses/savanna_beekeeper_area", FriendsAndFoes.getConfig().beekeeperAreaStructureWeight); + StructurePoolHelper.addElementToPool(templatePoolRegistry, taigaPoolLocation, "village/taiga/houses/taiga_beekeeper_area", FriendsAndFoes.getConfig().beekeeperAreaStructureWeight); + } + + if (FriendsAndFoes.getConfig().generateCopperGolemAreaStructure) { + StructurePoolHelper.addElementToPool(templatePoolRegistry, plainsPoolLocation, "village/plains/houses/plains_copper_golem_area", FriendsAndFoes.getConfig().copperGolemAreaStructureWeight); + StructurePoolHelper.addElementToPool(templatePoolRegistry, desertPoolLocation, "village/desert/houses/desert_copper_golem_area", FriendsAndFoes.getConfig().copperGolemAreaStructureWeight); + StructurePoolHelper.addElementToPool(templatePoolRegistry, savannaPoolLocation, "village/savanna/houses/savanna_copper_golem_area", FriendsAndFoes.getConfig().copperGolemAreaStructureWeight); + StructurePoolHelper.addElementToPool(templatePoolRegistry, taigaPoolLocation, "village/taiga/houses/taiga_copper_golem_area", FriendsAndFoes.getConfig().copperGolemAreaStructureWeight); + } + + if (FriendsAndFoes.getConfig().generateCopperGolemInAncientCity) { + StructurePoolHelper.addElementToPool(templatePoolRegistry, ancientCityCenterPoolLocation, "ancient_city/city_center/copper_golem_city_center_1", FriendsAndFoes.getConfig().copperGolemAncientCityCenterWeight); + } + } + + private FriendsAndFoesStructurePoolElements() { + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesStructureProcessorTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesStructureProcessorTypes.java index eca371f0c..692129369 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesStructureProcessorTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesStructureProcessorTypes.java @@ -1,6 +1,5 @@ package com.faboslav.friendsandfoes.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.platform.RegistryHelper; import com.faboslav.friendsandfoes.platform.StructureEntityProcessorTypes; import com.faboslav.friendsandfoes.world.processor.CitadelBottomProcessor; @@ -16,12 +15,9 @@ public final class FriendsAndFoesStructureProcessorTypes public static StructureProcessorType CITADEL_BOTTOM_PROCESSOR = () -> CitadelBottomProcessor.CODEC; public static void init() { - } - - public static void postInit() { - RegistryHelper.registerStructureProcessorType(FriendsAndFoes.makeID("illusioner_shack_brewing_stand_processor"), ILLUSIONER_SHACK_BREWING_STAND_PROCESSOR); - RegistryHelper.registerStructureProcessorType(FriendsAndFoes.makeID("citadel_bottom_processor"), CITADEL_BOTTOM_PROCESSOR); - StructureEntityProcessorTypes.postInit(); + RegistryHelper.registerStructureProcessorType("illusioner_shack_brewing_stand_processor", ILLUSIONER_SHACK_BREWING_STAND_PROCESSOR); + RegistryHelper.registerStructureProcessorType("citadel_bottom_processor", CITADEL_BOTTOM_PROCESSOR); + StructureEntityProcessorTypes.init(); } private FriendsAndFoesStructureProcessorTypes() { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesVillagerProfessions.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesVillagerProfessions.java index bb246c123..4dcc85b0f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesVillagerProfessions.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesVillagerProfessions.java @@ -7,8 +7,8 @@ import com.google.common.collect.ImmutableSet; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import net.minecraft.item.Items; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.sound.SoundEvents; -import net.minecraft.util.registry.RegistryEntry; import net.minecraft.village.TradeOffers; import net.minecraft.village.VillagerProfession; import net.minecraft.world.poi.PointOfInterestType; @@ -30,7 +30,9 @@ public final class FriendsAndFoesVillagerProfessions && ( registryEntry.matchesKey(PointOfInterestTypes.BEEHIVE) || registryEntry.value() == FriendsAndFoesPointOfInterestTypes.ACACIA_BEEHIVE.get() + || registryEntry.value() == FriendsAndFoesPointOfInterestTypes.BAMBOO_BEEHIVE.get() || registryEntry.value() == FriendsAndFoesPointOfInterestTypes.BIRCH_BEEHIVE.get() + || registryEntry.value() == FriendsAndFoesPointOfInterestTypes.CHERRY_BEEHIVE.get() || registryEntry.value() == FriendsAndFoesPointOfInterestTypes.CRIMSON_BEEHIVE.get() || registryEntry.value() == FriendsAndFoesPointOfInterestTypes.DARK_OAK_BEEHIVE.get() || registryEntry.value() == FriendsAndFoesPointOfInterestTypes.JUNGLE_BEEHIVE.get() diff --git a/common/src/main/java/com/faboslav/friendsandfoes/item/FriendsAndFoesArmorMaterials.java b/common/src/main/java/com/faboslav/friendsandfoes/item/FriendsAndFoesArmorMaterials.java index 5cb6e610f..df129919a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/item/FriendsAndFoesArmorMaterials.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/item/FriendsAndFoesArmorMaterials.java @@ -1,13 +1,15 @@ package com.faboslav.friendsandfoes.item; import com.faboslav.friendsandfoes.init.FriendsAndFoesItems; -import net.minecraft.entity.EquipmentSlot; +import net.minecraft.item.ArmorItem; import net.minecraft.item.ArmorMaterial; import net.minecraft.recipe.Ingredient; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Lazy; +import net.minecraft.util.Util; +import java.util.EnumMap; import java.util.function.Supplier; /** @@ -15,14 +17,32 @@ */ public enum FriendsAndFoesArmorMaterials implements ArmorMaterial { - WILDFIRE("wildfire", 35, new int[]{2, 5, 7, 2}, 12, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 2.0F, 0.1F, () -> { + WILDFIRE( + "wildfire", + 35, + Util.make(new EnumMap(ArmorItem.Type.class), (map) -> { + map.put(ArmorItem.Type.BOOTS, 2); + map.put(ArmorItem.Type.LEGGINGS, 5); + map.put(ArmorItem.Type.CHESTPLATE, 7); + map.put(ArmorItem.Type.HELMET, 2); + }), + 12, + SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, + 2.0F, + 0.1F, () -> { return Ingredient.ofItems(FriendsAndFoesItems.WILDFIRE_CROWN_FRAGMENT.get()); }); - private static final int[] BASE_DURABILITY = new int[]{13, 15, 16, 11}; + private static final EnumMap BASE_DURABILITY = (EnumMap) Util.make(new EnumMap(ArmorItem.Type.class), (map) -> { + map.put(ArmorItem.Type.BOOTS, 13); + map.put(ArmorItem.Type.LEGGINGS, 15); + map.put(ArmorItem.Type.CHESTPLATE, 16); + map.put(ArmorItem.Type.HELMET, 11); + }); + private final String name; private final int durabilityMultiplier; - private final int[] protectionAmounts; + private final EnumMap protectionAmounts; private final int enchantability; private final SoundEvent equipSound; private final float toughness; @@ -32,7 +52,7 @@ public enum FriendsAndFoesArmorMaterials implements ArmorMaterial FriendsAndFoesArmorMaterials( String name, int durabilityMultiplier, - int[] protectionAmounts, + EnumMap protectionAmounts, int enchantability, SoundEvent equipSound, float toughness, @@ -49,12 +69,12 @@ public enum FriendsAndFoesArmorMaterials implements ArmorMaterial this.repairIngredientSupplier = new Lazy(repairIngredientSupplier); } - public int getDurability(EquipmentSlot slot) { - return BASE_DURABILITY[slot.getEntitySlotId()] * this.durabilityMultiplier; + public int getDurability(ArmorItem.Type type) { + return BASE_DURABILITY.get(type) * this.durabilityMultiplier; } - public int getProtectionAmount(EquipmentSlot slot) { - return this.protectionAmounts[slot.getEntitySlotId()]; + public int getProtection(ArmorItem.Type type) { + return this.protectionAmounts.get(type); } public int getEnchantability() { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/AbstractButtonBlockMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/AbstractButtonBlockMixin.java deleted file mode 100644 index ed8d9328a..000000000 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/AbstractButtonBlockMixin.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.faboslav.friendsandfoes.mixin; - -import com.faboslav.friendsandfoes.block.*; -import net.minecraft.block.AbstractButtonBlock; -import net.minecraft.block.Oxidizable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Mixin(AbstractButtonBlock.class) -public final class AbstractButtonBlockMixin -{ - @Inject(method = "getPressTicks", at = @At("HEAD"), cancellable = true) - public void friendsandfoes_getCopperPressTicks( - CallbackInfoReturnable callbackInfo - ) { - Object buttonBlock = this; - - if (buttonBlock instanceof CopperButtonBlock) { - int pressTicks = CopperButtonBlock.PRESS_TICKS; - - if (buttonBlock instanceof OxidizableButtonBlock oxidizableButtonBlock) { - Oxidizable.OxidationLevel OxidationLevel = oxidizableButtonBlock.getDegradationLevel(); - - if (OxidationLevel == Oxidizable.OxidationLevel.EXPOSED) { - pressTicks = ExposedCopperButtonBlock.PRESS_TICKS; - } else if (OxidationLevel == Oxidizable.OxidationLevel.WEATHERED) { - pressTicks = WeatheredCopperButtonBlock.PRESS_TICKS; - } else if (OxidationLevel == Oxidizable.OxidationLevel.OXIDIZED) { - pressTicks = OxidizedCopperButtonBlock.PRESS_TICKS; - } - } else { - if (buttonBlock instanceof ExposedCopperButtonBlock) { - pressTicks = ExposedCopperButtonBlock.PRESS_TICKS; - } else if (buttonBlock instanceof WeatheredCopperButtonBlock) { - pressTicks = WeatheredCopperButtonBlock.PRESS_TICKS; - } else if (buttonBlock instanceof OxidizableButtonBlock) { - pressTicks = OxidizedCopperButtonBlock.PRESS_TICKS; - } - } - - callbackInfo.setReturnValue(pressTicks); - } - } -} diff --git a/forge/src/main/java/com/faboslav/friendsandfoes/mixin/forge/AddCustomEntityPoseMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/AddCustomEntityPoseMixin.java similarity index 65% rename from forge/src/main/java/com/faboslav/friendsandfoes/mixin/forge/AddCustomEntityPoseMixin.java rename to common/src/main/java/com/faboslav/friendsandfoes/mixin/AddCustomEntityPoseMixin.java index abcb8458b..c8986a084 100644 --- a/forge/src/main/java/com/faboslav/friendsandfoes/mixin/forge/AddCustomEntityPoseMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/AddCustomEntityPoseMixin.java @@ -1,5 +1,6 @@ -package com.faboslav.friendsandfoes.mixin.forge; +package com.faboslav.friendsandfoes.mixin; +import com.faboslav.friendsandfoes.entity.pose.RascalEntityPose; import com.faboslav.friendsandfoes.entity.pose.TuffGolemEntityPose; import net.minecraft.entity.EntityPose; import org.objectweb.asm.Opcodes; @@ -44,30 +45,25 @@ private static EntityPose newEntityPose( private static void friendsandfoes_addCustomEntityPoses(CallbackInfo ci) { var entityPoses = new ArrayList<>(Arrays.asList(field_18083)); var lastEntityPose = entityPoses.get(entityPoses.size() - 1); + var nextEntityPoseIndex = lastEntityPose.ordinal(); - var tuffGolemStanding = newEntityPose( - TuffGolemEntityPose.STANDING.getName(), - lastEntityPose.ordinal() + 1 - ); - entityPoses.add(tuffGolemStanding); + for (TuffGolemEntityPose tuffGolemEntityPose : TuffGolemEntityPose.values()) { + var newEntityPose = newEntityPose( + tuffGolemEntityPose.getName(), + nextEntityPoseIndex++ + ); - var tuffGolemStandingWithItem = newEntityPose( - TuffGolemEntityPose.STANDING_WITH_ITEM.getName(), - lastEntityPose.ordinal() + 2 - ); - entityPoses.add(tuffGolemStandingWithItem); + entityPoses.add(newEntityPose); + } - var tuffGolemSleeping = newEntityPose( - TuffGolemEntityPose.SLEEPING.getName(), - lastEntityPose.ordinal() + 3 - ); - entityPoses.add(tuffGolemSleeping); + for (RascalEntityPose rascalEntityPose : RascalEntityPose.values()) { + var newEntityPose = newEntityPose( + rascalEntityPose.getName(), + nextEntityPoseIndex++ + ); - var tuffGolemSleepingWithItem = newEntityPose( - TuffGolemEntityPose.SLEEPING_WITH_ITEM.getName(), - lastEntityPose.ordinal() + 4 - ); - entityPoses.add(tuffGolemSleepingWithItem); + entityPoses.add(newEntityPose); + } field_18083 = entityPoses.toArray(new EntityPose[0]); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/BundleItemAccessor.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/BundleItemAccessor.java new file mode 100644 index 000000000..fce9a225c --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/BundleItemAccessor.java @@ -0,0 +1,16 @@ +package com.faboslav.friendsandfoes.mixin; + +import net.minecraft.item.BundleItem; +import net.minecraft.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(BundleItem.class) +public interface BundleItemAccessor +{ + @Invoker("addToBundle") + int invokeAddToBundle( + ItemStack bundle, + ItemStack stack + ); +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/CarvedPumpkinBlockMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/CarvedPumpkinBlockMixin.java index fec1a7ce3..e5da0f888 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/CarvedPumpkinBlockMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/CarvedPumpkinBlockMixin.java @@ -10,10 +10,9 @@ import net.minecraft.block.pattern.BlockPatternBuilder; import net.minecraft.block.pattern.CachedBlockPosition; import net.minecraft.entity.SpawnReason; -import net.minecraft.item.Wearable; import net.minecraft.predicate.block.BlockStatePredicate; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.math.BlockPos; import net.minecraft.world.ServerWorldAccess; import net.minecraft.world.World; @@ -29,12 +28,11 @@ import java.util.function.Predicate; @Mixin(CarvedPumpkinBlock.class) -public abstract class CarvedPumpkinBlockMixin extends HorizontalFacingBlock implements Wearable +public abstract class CarvedPumpkinBlockMixin extends HorizontalFacingBlock { @Nullable private BlockPattern friendsandfoes_copperGolemDispenserPattern; - @Nullable private BlockPattern friendsandfoes_tuffGolemDispenserPattern; @@ -47,7 +45,7 @@ public abstract class CarvedPumpkinBlockMixin extends HorizontalFacingBlock impl ); private static final Predicate IS_TUFF_GOLEM_WOOL_PREDICATE = state -> state != null && ( - state.getMaterial() == Material.WOOL && state.getSoundGroup() == BlockSoundGroup.WOOL + state.isIn(BlockTags.WOOL) ); protected CarvedPumpkinBlockMixin(Settings settings) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/ChunkRegionAccessor.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/ChunkRegionAccessor.java new file mode 100644 index 000000000..f83bad9c4 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/ChunkRegionAccessor.java @@ -0,0 +1,13 @@ +package com.faboslav.friendsandfoes.mixin; + +import net.minecraft.world.ChunkRegion; +import net.minecraft.world.gen.StructureAccessor; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(ChunkRegion.class) +public interface ChunkRegionAccessor +{ + @Accessor("structureAccessor") + StructureAccessor getStructureAccessor(); +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/ClientPlayNetworkHandlerMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/ClientPlayNetworkHandlerMixin.java index 0212da91d..01d5d3f30 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/ClientPlayNetworkHandlerMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/ClientPlayNetworkHandlerMixin.java @@ -22,7 +22,7 @@ public abstract class ClientPlayNetworkHandlerMixin private MinecraftClient client; @Inject(method = "onGameJoin", at = @At("TAIL")) - private void friendsandfoesShowUpdateMessage(GameJoinS2CPacket arg, CallbackInfo ci) { + private void friendsandfoes_showUpdateMessage(GameJoinS2CPacket arg, CallbackInfo ci) { if (this.client.player == null) { return; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningEntityMixin.java index 25d14794e..816df3585 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningEntityMixin.java @@ -39,7 +39,7 @@ public LightningEntityMixin(EntityType type, World world) { ) private boolean friendsandfoes_expandPowerLightningRodIsLightningRodCondition(boolean original) { BlockPos blockPos = this.getAffectedBlockPos(); - BlockState blockState = this.world.getBlockState(blockPos); + BlockState blockState = this.getWorld().getBlockState(blockPos); return original || blockState.isIn(FriendsAndFoesTags.LIGHTNING_RODS); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningRodBlockMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningRodBlockMixin.java index a85c9340d..81db145c0 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningRodBlockMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/LightningRodBlockMixin.java @@ -34,7 +34,7 @@ public LightningRodBlockMixin(Settings settings) { } @Inject(method = "onBlockAdded", at = @At("HEAD")) - private void friendsandfoes_customOnBlockAdded( + private void friendsandfoes_onBlockAdded( BlockState state, World world, BlockPos pos, @@ -182,12 +182,11 @@ public void randomTick( BlockPos pos, Random random ) { - super.randomTick(state, world, pos, random); this.tickDegradation(state, world, pos, random); } @Override public boolean hasRandomTicks(BlockState state) { - return Oxidizable.getIncreasedOxidationBlock(state.getBlock()).isPresent(); + return true; } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/LimbAnimatorAccessor.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/LimbAnimatorAccessor.java new file mode 100644 index 000000000..0d6382bc6 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/LimbAnimatorAccessor.java @@ -0,0 +1,18 @@ +package com.faboslav.friendsandfoes.mixin; + +import net.minecraft.entity.LimbAnimator; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(LimbAnimator.class) +public interface LimbAnimatorAccessor +{ + @Accessor("prevSpeed") + float getPresSpeed(); + + @Accessor("prevSpeed") + void setPrevSpeed(float prevSpeed); + + @Accessor("pos") + void setPos(float pos); +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/PatrolSpawnerMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/PatrolSpawnerMixin.java index e561b0b06..3f9c0d5c1 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/PatrolSpawnerMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/PatrolSpawnerMixin.java @@ -4,10 +4,10 @@ import com.faboslav.friendsandfoes.tag.FriendsAndFoesTags; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.PatrolEntity; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.random.Random; -import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.biome.Biome; import net.minecraft.world.spawner.PatrolSpawner; import org.spongepowered.asm.mixin.Mixin; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/PlayerEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/PlayerEntityMixin.java index 55cf59776..d89b2f6c0 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/PlayerEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/PlayerEntityMixin.java @@ -20,10 +20,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.particle.DefaultParticleType; import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.stat.Stats; -import net.minecraft.tag.FluidTags; import net.minecraft.util.Hand; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -257,7 +257,7 @@ private PlayerIllusionEntity friendsandfoes_createIllusion(int x, int y, int z) boolean teleportResult = playerIllusion.tryToTeleport(x, y, z); if (teleportResult) { - world.spawnEntity(playerIllusion); + getWorld().spawnEntity(playerIllusion); playerIllusion.spawnCloudParticles(); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/PointOfInterestTypesMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/PointOfInterestTypesMixin.java index c8d99c99f..240e8a7c8 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/PointOfInterestTypesMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/PointOfInterestTypesMixin.java @@ -1,8 +1,8 @@ package com.faboslav.friendsandfoes.mixin; import net.minecraft.block.BlockState; -import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryKey; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; import net.minecraft.world.poi.PointOfInterestType; import net.minecraft.world.poi.PointOfInterestTypes; import org.spongepowered.asm.mixin.Mixin; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/ServerWorldMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/ServerWorldMixin.java index bc231f434..4b86a58d4 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/ServerWorldMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/ServerWorldMixin.java @@ -6,13 +6,14 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.LightningEntity; import net.minecraft.entity.mob.ZombieHorseEntity; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.Vec3d; import net.minecraft.util.profiler.Profiler; -import net.minecraft.util.registry.RegistryEntry; -import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.*; import net.minecraft.world.chunk.WorldChunk; import net.minecraft.world.dimension.DimensionType; @@ -30,22 +31,23 @@ @Mixin(ServerWorld.class) public abstract class ServerWorldMixin extends World implements StructureWorldAccess { - @Shadow - protected abstract BlockPos getLightningPos(BlockPos pos); - protected ServerWorldMixin( MutableWorldProperties properties, RegistryKey registryRef, - RegistryEntry dimension, + DynamicRegistryManager registryManager, + RegistryEntry dimensionEntry, Supplier profiler, boolean isClient, boolean debugWorld, - long seed, + long biomeAccess, int maxChainedNeighborUpdates ) { - super(properties, registryRef, dimension, profiler, isClient, debugWorld, seed, maxChainedNeighborUpdates); + super(properties, registryRef, registryManager, dimensionEntry, profiler, isClient, debugWorld, biomeAccess, maxChainedNeighborUpdates); } + @Shadow + protected abstract BlockPos getLightningPos(BlockPos pos); + @Inject( method = "tickChunk", at = @At("TAIL") diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/SnowballEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/SnowballEntityMixin.java index ab37bfa83..2f19f17d2 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/SnowballEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/SnowballEntityMixin.java @@ -3,7 +3,6 @@ import com.faboslav.friendsandfoes.entity.WildfireEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; -import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.projectile.thrown.SnowballEntity; import net.minecraft.entity.projectile.thrown.ThrownItemEntity; import net.minecraft.util.hit.EntityHitResult; @@ -30,6 +29,6 @@ private void friendsandfoes_isCloseEnoughForDanger( ) { Entity entity = entityHitResult.getEntity(); int i = entity instanceof WildfireEntity ? 3:0; - entity.damage(DamageSource.thrownProjectile(this, this.getOwner()), (float) i); + entity.damage(this.getDamageSources().thrown(this, this.getOwner()), (float) i); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/StrongholdGeneratorMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/StrongholdGeneratorMixin.java index cc05171e0..42e90000f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/StrongholdGeneratorMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/StrongholdGeneratorMixin.java @@ -95,7 +95,7 @@ private void friendsandfoes_generate( ItemStack enchantedItemStack = EnchantmentHelper.enchant( random, itemStack, - random.nextBetween(1, 3), + random.nextBetween(1, 30), true ); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/StructurePoolAccessor.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/StructurePoolAccessor.java new file mode 100644 index 000000000..1fd414b10 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/StructurePoolAccessor.java @@ -0,0 +1,29 @@ +package com.faboslav.friendsandfoes.mixin; + +import com.mojang.datafixers.util.Pair; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import net.minecraft.structure.pool.StructurePool; +import net.minecraft.structure.pool.StructurePoolElement; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.gen.Accessor; + +import java.util.List; + +@Mixin(StructurePool.class) +public interface StructurePoolAccessor +{ + @Accessor("elementCounts") + List> getElementCounts(); + + @Mutable + @Accessor("elementCounts") + void setElementCounts(List> elementCounts); + + @Accessor("elements") + ObjectArrayList getElements(); + + @Mutable + @Accessor("elements") + void setElements(ObjectArrayList elements); +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/StructurePoolMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/StructurePoolMixin.java deleted file mode 100644 index 7122daf39..000000000 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/StructurePoolMixin.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.faboslav.friendsandfoes.mixin; - -import com.faboslav.friendsandfoes.FriendsAndFoes; -import com.mojang.datafixers.util.Pair; -import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import net.minecraft.structure.pool.StructurePool; -import net.minecraft.structure.pool.StructurePoolElement; -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Final; -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 java.util.List; -import java.util.Objects; - -@Mixin(StructurePool.class) -public final class StructurePoolMixin -{ - @Final - @Shadow - private List> elementCounts; - - @Final - @Shadow - private ObjectArrayList elements; - - private void addElement(String element, int weight, StructurePool.Projection projection) { - StructurePoolElement e = StructurePoolElement.ofLegacySingle(element).apply(projection); - elementCounts.add(new Pair<>(e, weight)); - for (int i = 0; i < weight; i++) { - elements.add(e); - } - } - - @Inject( - at = @At("TAIL"), - method = "(Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Ljava/util/List;Lnet/minecraft/structure/pool/StructurePool$Projection;)V" - ) - private void friendsandfoes_addCustomStructures( - Identifier id, - Identifier terminatorsId, - List elementCounts, - StructurePool.Projection projection, - CallbackInfo ci - ) { - if (FriendsAndFoes.getConfig().generateBeekeeperAreaStructure) { - if (Objects.equals(id.getPath(), "village/plains/houses")) { - addElement(FriendsAndFoes.makeStringID("village/plains/houses/plains_beekeeper_area"), 2, projection); - } else if (Objects.equals(id.getPath(), "village/savanna/houses")) { - addElement(FriendsAndFoes.makeStringID("village/savanna/houses/savanna_beekeeper_area"), 2, projection); - } else if (Objects.equals(id.getPath(), "village/taiga/houses")) { - addElement(FriendsAndFoes.makeStringID("village/taiga/houses/taiga_beekeeper_area"), 2, projection); - } - } - - if (FriendsAndFoes.getConfig().generateCopperGolemAreaStructure) { - if (Objects.equals(id.getPath(), "village/desert/houses")) { - addElement(FriendsAndFoes.makeStringID("village/desert/houses/desert_copper_golem_area"), 1, projection); - } else if (Objects.equals(id.getPath(), "village/plains/houses")) { - addElement(FriendsAndFoes.makeStringID("village/plains/houses/plains_copper_golem_area"), 1, projection); - } else if (Objects.equals(id.getPath(), "village/savanna/houses")) { - addElement(FriendsAndFoes.makeStringID("village/savanna/houses/savanna_copper_golem_area"), 1, projection); - } else if (Objects.equals(id.getPath(), "village/taiga/houses")) { - addElement(FriendsAndFoes.makeStringID("village/taiga/houses/taiga_copper_golem_area"), 1, projection); - } - } - - if (FriendsAndFoes.getConfig().generateCopperGolemInAncientCity) { - if (Objects.equals(id.getPath(), "ancient_city/city_center")) { - addElement(FriendsAndFoes.makeStringID("ancient_city/city_center/copper_golem_city_center_1"), 3, projection); - } - } - } -} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/TemptGoalMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/TemptGoalMixin.java index d9828a79c..447a857f6 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/TemptGoalMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/TemptGoalMixin.java @@ -57,8 +57,8 @@ private void friendsandfoes_canStart( } private boolean friendsandfoes_canStartWithReturn() { - this.closestTuffGolem = this.mob.world.getClosestEntity( - this.mob.world.getEntitiesByClass( + this.closestTuffGolem = this.mob.getWorld().getClosestEntity( + this.mob.getWorld().getEntitiesByClass( TuffGolemEntity.class, this.mob.getBoundingBox().expand(16.0F, 3.0D, 16.0F), (livingEntity) -> { return true; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/platform/BiomeModifications.java b/common/src/main/java/com/faboslav/friendsandfoes/platform/BiomeModifications.java index f3018f3c1..b50981e86 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/platform/BiomeModifications.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/platform/BiomeModifications.java @@ -3,7 +3,7 @@ import dev.architectury.injectables.annotations.ExpectPlatform; import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnGroup; -import net.minecraft.tag.TagKey; +import net.minecraft.registry.tag.TagKey; import net.minecraft.world.biome.Biome; public final class BiomeModifications diff --git a/common/src/main/java/com/faboslav/friendsandfoes/platform/CustomSpawnGroup.java b/common/src/main/java/com/faboslav/friendsandfoes/platform/CustomSpawnGroup.java index 6d9ad33bf..2ddabcb0a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/platform/CustomSpawnGroup.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/platform/CustomSpawnGroup.java @@ -6,17 +6,29 @@ public final class CustomSpawnGroup { public static final String GLARES_INTERNAL_NAME = "GLARES"; - public static final String NAME = "glares"; - public static final int SPAWN_CAP = 15; - public static final boolean PEACEFUL = true; - public static final boolean RARE = false; - public static final int IMMEDIATE_DESPAWN_RANGE = 128; + public static final String GLARES_NAME = "glares"; + public static final int GLARES_SPAWN_CAP = 15; + public static final boolean GLARES_PEACEFUL = true; + public static final boolean GLARES_RARE = false; + public static final int GLARES_IMMEDIATE_DESPAWN_RANGE = 128; + + public static final String RASCALS_INTERNAL_NAME = "RASCALS"; + public static final String RASCALS_NAME = "rascals"; + public static final int RASCALS_SPAWN_CAP = 3; + public static final boolean RASCALS_PEACEFUL = true; + public static final boolean RASCALS_RARE = false; + public static final int RASCALS_IMMEDIATE_DESPAWN_RANGE = 128; @ExpectPlatform public static SpawnGroup getGlaresCategory() { throw new AssertionError(); } + @ExpectPlatform + public static SpawnGroup getRascalsCategory() { + throw new AssertionError(); + } + private CustomSpawnGroup() { } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/platform/RegistryHelper.java b/common/src/main/java/com/faboslav/friendsandfoes/platform/RegistryHelper.java index 304bee9db..26722b685 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/platform/RegistryHelper.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/platform/RegistryHelper.java @@ -2,6 +2,7 @@ import dev.architectury.injectables.annotations.ExpectPlatform; import net.minecraft.block.Block; +import net.minecraft.block.BlockSetType; import net.minecraft.block.Blocks; import net.minecraft.client.model.TexturedModelData; import net.minecraft.client.render.RenderLayer; @@ -13,12 +14,14 @@ import net.minecraft.entity.ai.brain.Activity; import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.mob.MobEntity; import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; import net.minecraft.particle.DefaultParticleType; +import net.minecraft.registry.RegistryKey; import net.minecraft.sound.SoundEvent; import net.minecraft.structure.processor.StructureProcessor; import net.minecraft.structure.processor.StructureProcessorType; -import net.minecraft.util.Identifier; import net.minecraft.village.VillagerProfession; import net.minecraft.world.gen.structure.Structure; import net.minecraft.world.gen.structure.StructureType; @@ -28,6 +31,16 @@ public final class RegistryHelper { + @ExpectPlatform + public static void addToItemGroupBefore(RegistryKey itemGroup, Item item, Item before) { + throw new AssertionError(); + } + + @ExpectPlatform + public static void addToItemGroupAfter(RegistryKey itemGroup, Item item, Item after) { + throw new AssertionError(); + } + @ExpectPlatform public static Supplier registerActivity(String name, Supplier activity) { throw new AssertionError(); @@ -38,6 +51,11 @@ public static Supplier registerBlock(String name, Supplier< throw new AssertionError(); } + @ExpectPlatform + public static void registerBlockSetType(Supplier blockSetType) { + throw new AssertionError(); + } + @ExpectPlatform public static void registerEntityModelLayer(EntityModelLayer location, Supplier definition) { throw new AssertionError(); @@ -72,6 +90,17 @@ public static Supplier registerItem(String name, Supplier throw new AssertionError(); } + @ExpectPlatform + public static Supplier registerSpawnEggItem( + String name, + Supplier> type, + int backgroundColor, + int highlightColor, + Item.Settings props + ) { + throw new AssertionError(); + } + @ExpectPlatform public static > Supplier registerMemoryModuleType( String name, @@ -134,9 +163,9 @@ public static void registerStructureType( } @ExpectPlatform - public static void registerStructureProcessorType( - Identifier identifier, - StructureProcessorType structureProcessorType + public static void registerStructureProcessorType( + String name, + StructureProcessorType structureProcessorType ) { throw new AssertionError(); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/platform/StructureEntityProcessorTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/platform/StructureEntityProcessorTypes.java index 14983007a..fedcba3f3 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/platform/StructureEntityProcessorTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/platform/StructureEntityProcessorTypes.java @@ -9,7 +9,7 @@ public final class StructureEntityProcessorTypes { @ExpectPlatform - public static void postInit() { + public static void init() { throw new AssertionError(); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/tag/FriendsAndFoesTags.java b/common/src/main/java/com/faboslav/friendsandfoes/tag/FriendsAndFoesTags.java index 14978d4a3..0aac20c53 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/tag/FriendsAndFoesTags.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/tag/FriendsAndFoesTags.java @@ -4,9 +4,9 @@ import net.minecraft.block.Block; import net.minecraft.entity.EntityType; import net.minecraft.item.Item; -import net.minecraft.tag.BlockTags; -import net.minecraft.tag.TagKey; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.TagKey; import net.minecraft.world.biome.Biome; import net.minecraft.world.poi.PointOfInterestType; @@ -32,25 +32,27 @@ public final class FriendsAndFoesTags public static final TagKey HAS_ILLUSIONER = biomeTag("has_illusioner"); public static final TagKey HAS_LESS_MOOBLOOMS = biomeTag("has_less_mooblooms"); public static final TagKey HAS_MORE_MOOBLOOMS = biomeTag("has_more_mooblooms"); + + public static final TagKey HAS_RASCAL = biomeTag("has_rascal"); public static final TagKey HAS_SAVANNA_MAULER = biomeTag("has_savanna_mauler"); private static TagKey blockTag(String name) { - return TagKey.of(Registry.BLOCK_KEY, FriendsAndFoes.makeID(name)); + return TagKey.of(RegistryKeys.BLOCK, FriendsAndFoes.makeID(name)); } private static TagKey itemTag(String name) { - return TagKey.of(Registry.ITEM_KEY, FriendsAndFoes.makeID(name)); + return TagKey.of(RegistryKeys.ITEM, FriendsAndFoes.makeID(name)); } private static TagKey> entityTypeTag(String name) { - return TagKey.of(Registry.ENTITY_TYPE_KEY, FriendsAndFoes.makeID(name)); + return TagKey.of(RegistryKeys.ENTITY_TYPE, FriendsAndFoes.makeID(name)); } private static TagKey biomeTag(String name) { - return TagKey.of(Registry.BIOME_KEY, FriendsAndFoes.makeID(name)); + return TagKey.of(RegistryKeys.BIOME, FriendsAndFoes.makeID(name)); } private static TagKey pointOfInterestTypeTag(String name) { - return TagKey.of(Registry.POINT_OF_INTEREST_TYPE_KEY, FriendsAndFoes.makeID(name)); + return TagKey.of(RegistryKeys.POINT_OF_INTEREST_TYPE, FriendsAndFoes.makeID(name)); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/util/StructurePoolHelper.java b/common/src/main/java/com/faboslav/friendsandfoes/util/StructurePoolHelper.java new file mode 100644 index 000000000..779d63c2f --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/util/StructurePoolHelper.java @@ -0,0 +1,38 @@ +package com.faboslav.friendsandfoes.util; + +import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.mixin.StructurePoolAccessor; +import com.mojang.datafixers.util.Pair; +import net.minecraft.registry.Registry; +import net.minecraft.structure.pool.SinglePoolElement; +import net.minecraft.structure.pool.StructurePool; +import net.minecraft.structure.pool.StructurePoolElement; +import net.minecraft.util.Identifier; + +import java.util.ArrayList; +import java.util.List; + +public class StructurePoolHelper +{ + public static void addElementToPool( + Registry templatePoolRegistry, + Identifier poolRL, + String name, + int weight + ) { + StructurePool pool = templatePoolRegistry.get(poolRL); + if (pool == null) { + return; + } + + SinglePoolElement piece = SinglePoolElement.ofLegacySingle(FriendsAndFoes.makeStringID(name)).apply(StructurePool.Projection.RIGID); + + for (int i = 0; i < weight; i++) { + ((StructurePoolAccessor) pool).getElements().add(piece); + } + + List> listOfPieceEntries = new ArrayList<>(((StructurePoolAccessor) pool).getElementCounts()); + listOfPieceEntries.add(new Pair<>(piece, weight)); + ((StructurePoolAccessor) pool).setElementCounts(listOfPieceEntries); + } +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/processor/CitadelBottomProcessor.java b/common/src/main/java/com/faboslav/friendsandfoes/world/processor/CitadelBottomProcessor.java index a910f21f7..bb740b7b7 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/processor/CitadelBottomProcessor.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/processor/CitadelBottomProcessor.java @@ -57,22 +57,22 @@ public StructureTemplate.StructureBlockInfo process( StructureTemplate.StructureBlockInfo blockInfoGlobal, StructurePlacementData structurePlacementData ) { - if (blockInfoGlobal.state.isOf(this.targetBlock.getBlock())) { + if (blockInfoGlobal.state().isOf(this.targetBlock.getBlock())) { if ( worldView instanceof ChunkRegion chunkRegion - && chunkRegion.getCenterPos().equals(new ChunkPos(blockInfoGlobal.pos)) == false + && chunkRegion.getCenterPos().equals(new ChunkPos(blockInfoGlobal.pos())) == false ) { return blockInfoGlobal; } blockInfoGlobal = new StructureTemplate.StructureBlockInfo( - blockInfoGlobal.pos, + blockInfoGlobal.pos(), targetBlockOutput, - blockInfoGlobal.nbt + blockInfoGlobal.nbt() ); - BlockPos.Mutable mutable = blockInfoGlobal.pos.mutableCopy().move(Direction.DOWN); + BlockPos.Mutable mutable = blockInfoGlobal.pos().mutableCopy().move(Direction.DOWN); BlockState currentBlockState = worldView.getBlockState(mutable); - Random random = structurePlacementData.getRandom(blockInfoGlobal.pos); + Random random = structurePlacementData.getRandom(blockInfoGlobal.pos()); while ( mutable.getY() > worldView.getBottomY() diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/processor/IllusionerShackBrewingStandProcessor.java b/common/src/main/java/com/faboslav/friendsandfoes/world/processor/IllusionerShackBrewingStandProcessor.java index ce345c029..41f12125b 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/processor/IllusionerShackBrewingStandProcessor.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/processor/IllusionerShackBrewingStandProcessor.java @@ -34,12 +34,12 @@ public StructureBlockInfo process( StructureBlockInfo currentBlockInfo, StructurePlacementData structurePlacementData ) { - if (currentBlockInfo.state.getBlock() != Blocks.BREWING_STAND) { + if (currentBlockInfo.state().getBlock() != Blocks.BREWING_STAND) { return currentBlockInfo; } - Random random = structurePlacementData.getRandom(currentBlockInfo.pos); - NbtCompound nbt = currentBlockInfo.nbt; + Random random = structurePlacementData.getRandom(currentBlockInfo.pos()); + NbtCompound nbt = currentBlockInfo.nbt(); NbtList itemsListNbt = nbt.getList("Items", 10); int randomNumber = random.nextInt(2); @@ -59,7 +59,7 @@ public StructureBlockInfo process( ); } - currentBlockInfo = new StructureBlockInfo(currentBlockInfo.pos, currentBlockInfo.state, nbt); + currentBlockInfo = new StructureBlockInfo(currentBlockInfo.pos(), currentBlockInfo.state(), nbt); return currentBlockInfo; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java b/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java index 87826b8fa..371146750 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java @@ -43,7 +43,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) if ( l < 5L || world.isDay() == false - || random.nextBetween(0, 1) != 0 + || random.nextBetween(0, 1) != 0 ) { return 0; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/CitadelStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/CitadelStructure.java index 05d6264e4..20d534f7e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/CitadelStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/CitadelStructure.java @@ -5,11 +5,11 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.block.BlockState; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.structure.pool.StructurePool; import net.minecraft.structure.pool.StructurePoolBasedGenerator; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.Heightmap; import net.minecraft.world.gen.HeightContext; import net.minecraft.world.gen.chunk.VerticalBlockSample; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IceologerCabinStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IceologerCabinStructure.java index fe564ecc0..6ac425610 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IceologerCabinStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IceologerCabinStructure.java @@ -4,11 +4,11 @@ import com.faboslav.friendsandfoes.init.FriendsAndFoesStructureTypes; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.structure.pool.StructurePool; import net.minecraft.structure.pool.StructurePoolBasedGenerator; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.Heightmap; import net.minecraft.world.gen.HeightContext; import net.minecraft.world.gen.heightprovider.HeightProvider; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerShackStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerShackStructure.java index 9d1ed0e7b..6a38821b7 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerShackStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerShackStructure.java @@ -4,11 +4,11 @@ import com.faboslav.friendsandfoes.init.FriendsAndFoesStructureTypes; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.structure.pool.StructurePool; import net.minecraft.structure.pool.StructurePoolBasedGenerator; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.Heightmap; import net.minecraft.world.gen.HeightContext; import net.minecraft.world.gen.heightprovider.HeightProvider; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerTrainingGroundsStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerTrainingGroundsStructure.java index 17797f1ca..973d28635 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerTrainingGroundsStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/structures/IllusionerTrainingGroundsStructure.java @@ -4,11 +4,11 @@ import com.faboslav.friendsandfoes.init.FriendsAndFoesStructureTypes; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.structure.pool.StructurePool; import net.minecraft.structure.pool.StructurePoolBasedGenerator; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.Heightmap; import net.minecraft.world.gen.HeightContext; import net.minecraft.world.gen.heightprovider.HeightProvider; diff --git a/common/src/main/resources/assets/friendsandfoes/blockstates/bamboo_beehive.json b/common/src/main/resources/assets/friendsandfoes/blockstates/bamboo_beehive.json new file mode 100644 index 000000000..caac4fa21 --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/blockstates/bamboo_beehive.json @@ -0,0 +1,94 @@ +{ + "variants": { + "facing=east,honey_level=0": { + "y": 90, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=east,honey_level=1": { + "y": 90, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=east,honey_level=2": { + "y": 90, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=east,honey_level=3": { + "y": 90, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=east,honey_level=4": { + "y": 90, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=east,honey_level=5": { + "y": 90, + "model": "friendsandfoes:block/bamboo_beehive_honey" + }, + "facing=north,honey_level=0": { + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=north,honey_level=1": { + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=north,honey_level=2": { + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=north,honey_level=3": { + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=north,honey_level=4": { + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=north,honey_level=5": { + "model": "friendsandfoes:block/bamboo_beehive_honey" + }, + "facing=south,honey_level=0": { + "y": 180, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=south,honey_level=1": { + "y": 180, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=south,honey_level=2": { + "y": 180, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=south,honey_level=3": { + "y": 180, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=south,honey_level=4": { + "y": 180, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=south,honey_level=5": { + "y": 180, + "model": "friendsandfoes:block/bamboo_beehive_honey" + }, + "facing=west,honey_level=0": { + "y": 270, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=west,honey_level=1": { + "y": 270, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=west,honey_level=2": { + "y": 270, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=west,honey_level=3": { + "y": 270, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=west,honey_level=4": { + "y": 270, + "model": "friendsandfoes:block/bamboo_beehive" + }, + "facing=west,honey_level=5": { + "y": 270, + "model": "friendsandfoes:block/bamboo_beehive_honey" + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/blockstates/cherry_beehive.json b/common/src/main/resources/assets/friendsandfoes/blockstates/cherry_beehive.json new file mode 100644 index 000000000..860bc83bc --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/blockstates/cherry_beehive.json @@ -0,0 +1,94 @@ +{ + "variants": { + "facing=east,honey_level=0": { + "y": 90, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=east,honey_level=1": { + "y": 90, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=east,honey_level=2": { + "y": 90, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=east,honey_level=3": { + "y": 90, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=east,honey_level=4": { + "y": 90, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=east,honey_level=5": { + "y": 90, + "model": "friendsandfoes:block/cherry_beehive_honey" + }, + "facing=north,honey_level=0": { + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=north,honey_level=1": { + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=north,honey_level=2": { + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=north,honey_level=3": { + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=north,honey_level=4": { + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=north,honey_level=5": { + "model": "friendsandfoes:block/cherry_beehive_honey" + }, + "facing=south,honey_level=0": { + "y": 180, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=south,honey_level=1": { + "y": 180, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=south,honey_level=2": { + "y": 180, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=south,honey_level=3": { + "y": 180, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=south,honey_level=4": { + "y": 180, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=south,honey_level=5": { + "y": 180, + "model": "friendsandfoes:block/cherry_beehive_honey" + }, + "facing=west,honey_level=0": { + "y": 270, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=west,honey_level=1": { + "y": 270, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=west,honey_level=2": { + "y": 270, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=west,honey_level=3": { + "y": 270, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=west,honey_level=4": { + "y": 270, + "model": "friendsandfoes:block/cherry_beehive" + }, + "facing=west,honey_level=5": { + "y": 270, + "model": "friendsandfoes:block/cherry_beehive_honey" + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json index 4bcf48be7..5e94b9d0c 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json @@ -21,12 +21,16 @@ "advancements.nether.find_citadel.description": "Enter a Nether citadel", "advancements.nether.kill_wildfire.title": "Drop it like it's hot", "advancements.nether.kill_wildfire.description": "Kill the wildfire", - "advancements.nether.obtain_wildfire_crown.title": "Who's da New King of Hell", + "advancements.nether.obtain_wildfire_crown.title": "Who's da New King of Hell?", "advancements.nether.obtain_wildfire_crown.description": "Have a wildfire crown in your inventory", + "advancements.adventure.complete_hide_and_seek_game.title": "Hide and Seek", + "advancements.adventure.complete_hide_and_seek_game.description": "Find a rascal three times in its little game", "block.friendsandfoes.buttercup": "Buttercup", "block.minecraft.beehive": "Oak Beehive", "block.friendsandfoes.acacia_beehive": "Acacia Beehive", + "block.friendsandfoes.bamboo_beehive": "Bamboo Beehive", "block.friendsandfoes.birch_beehive": "Birch Beehive", + "block.friendsandfoes.cherry_beehive": "Cherry Beehive", "block.friendsandfoes.crimson_beehive": "Crimson Beehive", "block.friendsandfoes.dark_oak_beehive": "Dark Oak Beehive", "block.friendsandfoes.jungle_beehive": "Jungle Beehive", @@ -65,6 +69,7 @@ "item.friendsandfoes.illusioner_spawn_egg": "Illusioner Spawn Egg", "item.friendsandfoes.mauler_spawn_egg": "Mauler Spawn Egg", "item.friendsandfoes.moobloom_spawn_egg": "Moobloom Spawn Egg", + "item.friendsandfoes.rascal_spawn_egg": "Rascal Spawn Egg", "item.friendsandfoes.tuff_golem_spawn_egg": "Tuff Golem Spawn Egg", "item.friendsandfoes.wildfire_spawn_egg": "Wildfire Spawn Egg", "item.friendsandfoes.totem_of_freezing": "Totem of Freezing", @@ -98,6 +103,13 @@ "subtitle.entity.friendsandfoes.mauler.hurt": "Mauler hurts", "subtitle.entity.friendsandfoes.moobloom.convert": "Moobloom transforms", "subtitle.entity.friendsandfoes.player.mirror_move": "Player displaces", + "subtitle.entity.friendsandfoes.rascal.ambient": "Rascal taunts", + "subtitle.entity.friendsandfoes.rascal.disappear": "Rascal disappears", + "subtitle.entity.friendsandfoes.rascal.nod": "Rascal nods", + "subtitle.entity.friendsandfoes.rascal.hurt": "Rascal hurts", + "subtitle.entity.friendsandfoes.rascal.reappear": "Rascal appears", + "subtitle.entity.friendsandfoes.rascal.reward": "Rascal gives reward", + "subtitle.entity.friendsandfoes.rascal.reward_bad": "Rascal gives bad reward", "subtitle.entity.friendsandfoes.shield_debris.impact": "Shield debris impacted", "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "Tuff Golem glued", "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "Tuff Golem unglued", diff --git a/common/src/main/resources/assets/friendsandfoes/lang/it_it.json b/common/src/main/resources/assets/friendsandfoes/lang/it_it.json index 7521017a6..207d1ab05 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/it_it.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/it_it.json @@ -13,6 +13,16 @@ "advancements.husbandry.tame_a_glare.description": "Addomestica un glare", "advancements.adventure.the_magicians.title": "I maghi", "advancements.adventure.the_magicians.description": "Uccidi tutti e tre i maghi illager", + "advancements.adventure.it_bites.title": "Morde", + "advancements.adventure.it_bites.description": "Uccidi un mauler", + "advancements.survival.activate_zombie_horse_trap.title": "Riders On The Storm", + "advancements.survival.activate_zombie_horse_trap.description": "Attiva una trappola per cavalli zombie", + "advancements.nether.find_citadel.title": "Una fortezza? No, una cittadella!", + "advancements.nether.find_citadel.description": "Entra in una cittadella del nether", + "advancements.nether.kill_wildfire.title": "Gettalo come se fosse caldo", + "advancements.nether.kill_wildfire.description": "Uccidi un Wildfire", + "advancements.nether.obtain_wildfire_crown.title": "Chi è il nuovo re dell'inferno?", + "advancements.nether.obtain_wildfire_crown.description": "Ottieni una corona di Wildfire", "block.friendsandfoes.buttercup": "Ranuncolo", "block.minecraft.beehive": "Alveare di quercia", "block.friendsandfoes.acacia_beehive": "Alveare di acacia", @@ -20,6 +30,7 @@ "block.friendsandfoes.crimson_beehive": "Alveare cremisi", "block.friendsandfoes.dark_oak_beehive": "Alveare di quercia scura", "block.friendsandfoes.jungle_beehive": "Alveare della giungla", + "block.friendsandfoes.mangrove_beehive": "Alveare di mangrovia", "block.friendsandfoes.spruce_beehive": "Alveare di abete", "block.friendsandfoes.warped_beehive": "Alveare distorto", "block.friendsandfoes.copper_button": "Pulsante di rame", @@ -30,17 +41,34 @@ "block.friendsandfoes.waxed_exposed_copper_button": "Pulsante di rame esposto cerato", "block.friendsandfoes.waxed_weathered_copper_button": "Pulsante di rame corroso cerato", "block.friendsandfoes.waxed_oxidized_copper_button": "Pulsante di rame ossidato cerato", + "block.friendsandfoes.exposed_lightning_rod": "Parafulmine esposto", + "block.friendsandfoes.weathered_lightning_rod": "Parafulmine corroso", + "block.friendsandfoes.oxidized_lightning_rod": "Parafulmine ossidato", + "block.friendsandfoes.waxed_lightning_rod": "Parafulmine cerato", + "block.friendsandfoes.waxed_exposed_lightning_rod": "Parafulmine cerato esposto", + "block.friendsandfoes.waxed_weathered_lightning_rod": "Parafulmine cerato corroso", + "block.friendsandfoes.waxed_oxidized_lightning_rod": "Parafulmine cerato ossidato", + "block.friendsandfoes.potted_buttercup": "Potted Buttercup", "entity.minecraft.villager.beekeeper": "Apicoltore", "entity.minecraft.villager.friendsandfoes.beekeeper": "Apicoltore", "entity.friendsandfoes.copper_golem": "Golem di rame", "entity.friendsandfoes.glare": "Glare", + "entity.friendsandfoes.iceologer": "Iceologo", "entity.friendsandfoes.moobloom": "Moobloom", + "entity.friendsandfoes.mauler": "Mauler", + "entity.friendsandfoes.tuff_golem": "Golem di tufo", + "entity.friendsandfoes.wildfire": "Wildfire", "item.friendsandfoes.buttercup": "Ranuncolo", "item.friendsandfoes.glare_spawn_egg": "Uovo generatore di glare", "item.friendsandfoes.copper_golem_spawn_egg": "Uovo generatore di golem di rame", "item.friendsandfoes.iceologer_spawn_egg": "Uovo generatore di iceologo", "item.friendsandfoes.illusioner_spawn_egg": "Uovo generatore di illusionista", + "item.friendsandfoes.mauler_spawn_egg": "Uovo generatore di mauler", "item.friendsandfoes.moobloom_spawn_egg": "Uovo generatore di moobloom", + "item.friendsandfoes.tuff_golem_spawn_egg": "Uovo generatore di golem di tufo", + "item.friendsandfoes.wildfire_spawn_egg": "Uovo generatore di Wildfire", + "item.friendsandfoes.wildfire_crown": "Corona di Wildfire", + "item.friendsandfoes.wildfire_crown_fragment": "Frammento di corona di Wildfire", "subtitle.entity.friendsandfoes.glare.ambient": "Glare vola", "subtitle.entity.friendsandfoes.glare.death": "Glare muore", "subtitle.entity.friendsandfoes.glare.eat": "Glare mangia", @@ -61,5 +89,26 @@ "subtitle.entity.friendsandfoes.iceologer.prepare_summon": "Iceologo prepara evocazione", "subtitle.entity.friendsandfoes.ice_chunk.ambient": "Pezzo di ghiaccio si crepa", "subtitle.entity.friendsandfoes.ice_chunk.hit": "Pezzo di ghiaccio cade", - "subtitle.entity.friendsandfoes.ice_chunk.summon": "Pezzo di ghiaccio si crepa" + "subtitle.entity.friendsandfoes.ice_chunk.summon": "Pezzo di ghiaccio si crepa", + "subtitle.entity.friendsandfoes.mauler.bite": "Mauler bites", + "subtitle.entity.friendsandfoes.mauler.death": "Mauler dies", + "subtitle.entity.friendsandfoes.mauler.growl": "Mauler growls", + "subtitle.entity.friendsandfoes.mauler.hurt": "Mauler hurts", + "subtitle.entity.friendsandfoes.moobloom.convert": "Moobloom transforms", + "subtitle.entity.friendsandfoes.shield_debris.impact": "Shield debris impacted", + "subtitle.entity.friendsandfoes.tuff_golem.glue": "Tuff Golem glued", + "subtitle.entity.friendsandfoes.tuff_golem.hurt": "Tuff Golem hurts", + "subtitle.entity.friendsandfoes.tuff_golem.move": "Tuff Golem moves", + "subtitle.entity.friendsandfoes.tuff_golem.repair": "Tuff Golem repaired", + "subtitle.entity.friendsandfoes.tuff_golem.wake": "Tuff Golem wakes up", + "subtitle.entity.friendsandfoes.tuff_golem.sleep": "Tuff Golem goes to sleep", + "subtitle.entity.friendsandfoes.tuff_golem.step": "Footsteps", + "subtitle.entity.friendsandfoes.wildfire.ambient": "Wildfire breathes", + "subtitle.entity.friendsandfoes.wildfire.death": "Wildfire dies", + "subtitle.entity.friendsandfoes.wildfire.hurt": "Wildfire hurts", + "subtitle.entity.friendsandfoes.wildfire.shield_break": "Wildfire's shield brokes", + "subtitle.entity.friendsandfoes.wildfire.shockwave": "Wilsfire shockwaves", + "subtitle.entity.friendsandfoes.wildfire.shoot": "Wildfire shoots", + "subtitle.entity.friendsandfoes.wildfire.step": "Footsteps", + "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Wildfire summons blazes" } diff --git a/common/src/main/resources/assets/friendsandfoes/lang/ru_ru.json b/common/src/main/resources/assets/friendsandfoes/lang/ru_ru.json index f95981f22..6df26b241 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/ru_ru.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/ru_ru.json @@ -115,4 +115,4 @@ "subtitle.entity.friendsandfoes.wildfire.shoot": "Пламенный стреляет", "subtitle.entity.friendsandfoes.wildfire.step": "Шаги", "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Пламенный призывает всполохов" -} \ No newline at end of file +} diff --git a/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json b/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json index 156c3f119..d7eb1cbac 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json @@ -27,6 +27,7 @@ "block.minecraft.beehive": "橡木蜂箱", "block.friendsandfoes.acacia_beehive": "金合欢木蜂箱", "block.friendsandfoes.birch_beehive": "白桦木蜂箱", + "block.friendsandfoes.cherry_beehive": "樱花木蜂箱", "block.friendsandfoes.crimson_beehive": "绯红木蜂箱", "block.friendsandfoes.dark_oak_beehive": "深色橡木蜂箱", "block.friendsandfoes.jungle_beehive": "从林木蜂箱", @@ -56,6 +57,7 @@ "entity.friendsandfoes.iceologer": "冰术师", "entity.friendsandfoes.moobloom": "哞花", "entity.friendsandfoes.mauler": "大胃怪", + "entity.friendsandfoes.tuff_golem": "凝灰岩傀儡", "entity.friendsandfoes.wildfire": "野火", "item.friendsandfoes.buttercup": "毛茛", "item.friendsandfoes.glare_spawn_egg": "怒目怪刷怪蛋", @@ -67,6 +69,9 @@ "item.friendsandfoes.wildfire_spawn_egg": "野火刷怪蛋", "item.friendsandfoes.wildfire_crown": "野火王冠", "item.friendsandfoes.wildfire_crown_fragment": "野火王冠碎片", + "item.friendsandfoes.totem_of_freezing": "冰冻图腾", + "item.friendsandfoes.totem_of_illusion": "幻象图腾", + "item.friendsandfoes.tuff_golem_spawn_egg": "凝灰岩傀儡刷怪蛋", "subtitle.entity.friendsandfoes.glare.ambient": "怒目怪:游荡", "subtitle.entity.friendsandfoes.glare.death": "怒目怪:死亡", "subtitle.entity.friendsandfoes.glare.eat": "怒目怪:进食", @@ -101,5 +106,13 @@ "subtitle.entity.friendsandfoes.wildfire.shockwave": "野火:冲击波", "subtitle.entity.friendsandfoes.wildfire.shoot": "野火:射击", "subtitle.entity.friendsandfoes.wildfire.step": "脚步声", - "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "野火:召唤烈焰人" -} \ No newline at end of file + "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "野火:召唤烈焰人", + "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "凝灰岩傀儡:涂胶", + "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "凝灰岩傀儡:脱胶", + "subtitle.entity.friendsandfoes.tuff_golem.hurt": "凝灰岩傀儡:受伤", + "subtitle.entity.friendsandfoes.tuff_golem.move": "凝灰岩傀儡:移动", + "subtitle.entity.friendsandfoes.tuff_golem.repair": "凝灰岩傀儡:修复", + "subtitle.entity.friendsandfoes.tuff_golem.wake": "凝灰岩傀儡:苏醒", + "subtitle.entity.friendsandfoes.tuff_golem.sleep": "凝灰岩傀儡:睡觉", + "subtitle.entity.friendsandfoes.tuff_golem.step": "脚步声" +} diff --git a/common/src/main/resources/assets/friendsandfoes/models/block/bamboo_beehive.json b/common/src/main/resources/assets/friendsandfoes/models/block/bamboo_beehive.json new file mode 100644 index 000000000..b487708fc --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/models/block/bamboo_beehive.json @@ -0,0 +1,10 @@ +{ + "parent": "minecraft:block/orientable_with_bottom", + "textures": { + "top": "friendsandfoes:block/bamboo_beehive_end", + "bottom": "friendsandfoes:block/bamboo_beehive_end", + "side": "friendsandfoes:block/bamboo_beehive_side", + "front": "friendsandfoes:block/bamboo_beehive_front", + "particle": "friendsandfoes:block/bamboo_beehive_side" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/models/block/bamboo_beehive_honey.json b/common/src/main/resources/assets/friendsandfoes/models/block/bamboo_beehive_honey.json new file mode 100644 index 000000000..4c76c9909 --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/models/block/bamboo_beehive_honey.json @@ -0,0 +1,10 @@ +{ + "parent": "minecraft:block/orientable_with_bottom", + "textures": { + "top": "friendsandfoes:block/bamboo_beehive_end", + "bottom": "friendsandfoes:block/bamboo_beehive_end", + "side": "friendsandfoes:block/bamboo_beehive_side", + "front": "friendsandfoes:block/bamboo_beehive_front_honey", + "particle": "friendsandfoes:block/bamboo_beehive_side" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/models/block/cherry_beehive.json b/common/src/main/resources/assets/friendsandfoes/models/block/cherry_beehive.json new file mode 100644 index 000000000..a7a6d0001 --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/models/block/cherry_beehive.json @@ -0,0 +1,10 @@ +{ + "parent": "minecraft:block/orientable_with_bottom", + "textures": { + "top": "friendsandfoes:block/cherry_beehive_end", + "bottom": "friendsandfoes:block/cherry_beehive_end", + "side": "friendsandfoes:block/cherry_beehive_side", + "front": "friendsandfoes:block/cherry_beehive_front", + "particle": "friendsandfoes:block/cherry_beehive_side" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/models/block/cherry_beehive_honey.json b/common/src/main/resources/assets/friendsandfoes/models/block/cherry_beehive_honey.json new file mode 100644 index 000000000..495b566a6 --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/models/block/cherry_beehive_honey.json @@ -0,0 +1,10 @@ +{ + "parent": "minecraft:block/orientable_with_bottom", + "textures": { + "top": "friendsandfoes:block/cherry_beehive_end", + "bottom": "friendsandfoes:block/cherry_beehive_end", + "side": "friendsandfoes:block/cherry_beehive_side", + "front": "friendsandfoes:block/cherry_beehive_front_honey", + "particle": "friendsandfoes:block/cherry_beehive_side" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/models/item/bamboo_beehive.json b/common/src/main/resources/assets/friendsandfoes/models/item/bamboo_beehive.json new file mode 100644 index 000000000..273a38dbd --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/models/item/bamboo_beehive.json @@ -0,0 +1,3 @@ +{ + "parent": "friendsandfoes:block/bamboo_beehive" +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/models/item/cherry_beehive.json b/common/src/main/resources/assets/friendsandfoes/models/item/cherry_beehive.json new file mode 100644 index 000000000..bc21b32ac --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/models/item/cherry_beehive.json @@ -0,0 +1,3 @@ +{ + "parent": "friendsandfoes:block/cherry_beehive" +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/models/item/rascal_spawn_egg.json b/common/src/main/resources/assets/friendsandfoes/models/item/rascal_spawn_egg.json new file mode 100644 index 000000000..9af90217d --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/models/item/rascal_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/sounds.json b/common/src/main/resources/assets/friendsandfoes/sounds.json index acbea69fd..edf849cd3 100644 --- a/common/src/main/resources/assets/friendsandfoes/sounds.json +++ b/common/src/main/resources/assets/friendsandfoes/sounds.json @@ -181,7 +181,64 @@ "friendsandfoes:entity/player/mirror_move1", "friendsandfoes:entity/player/mirror_move2" ], - "subtitle": "subtitle.entity.friendsandfoes.moobloom.convert" + "subtitle": "subtitle.entity.friendsandfoes.player.mirror_move" + }, + "entity.rascal.ambient": { + "sounds": [ + "friendsandfoes:entity/rascal/ambient1", + "friendsandfoes:entity/rascal/ambient2", + "friendsandfoes:entity/rascal/ambient3", + "friendsandfoes:entity/rascal/ambient4", + "friendsandfoes:entity/rascal/ambient5" + ], + "subtitle": "subtitle.entity.friendsandfoes.rascal.ambient" + }, + "entity.rascal.disappear": { + "sounds": [ + "friendsandfoes:entity/rascal/disappear1", + "friendsandfoes:entity/rascal/disappear2" + ], + "subtitle": "subtitle.entity.friendsandfoes.rascal.disappear" + }, + "entity.rascal.hurt": { + "sounds": [ + "friendsandfoes:entity/rascal/hurt1", + "friendsandfoes:entity/rascal/hurt2", + "friendsandfoes:entity/rascal/hurt3", + "friendsandfoes:entity/rascal/hurt4" + ], + "subtitle": "subtitle.entity.friendsandfoes.rascal.hurt" + }, + "entity.rascal.nod": { + "sounds": [ + "friendsandfoes:entity/rascal/nod1", + "friendsandfoes:entity/rascal/nod2", + "friendsandfoes:entity/rascal/nod3", + "friendsandfoes:entity/rascal/nod4" + ], + "subtitle": "subtitle.entity.friendsandfoes.rascal.nod" + }, + "entity.rascal.reappear": { + "sounds": [ + "friendsandfoes:entity/rascal/reappear1", + "friendsandfoes:entity/rascal/reappear2" + ], + "subtitle": "subtitle.entity.friendsandfoes.rascal.reappear" + }, + "entity.rascal.reward": { + "sounds": [ + "friendsandfoes:entity/rascal/reward1", + "friendsandfoes:entity/rascal/reward2" + ], + "subtitle": "subtitle.entity.friendsandfoes.rascal.reward" + }, + "entity.rascal.reward_bad": { + "sounds": [ + "friendsandfoes:entity/rascal/reward_bad1", + "friendsandfoes:entity/rascal/reward_bad2", + "friendsandfoes:entity/rascal/reward_bad3" + ], + "subtitle": "subtitle.entity.friendsandfoes.rascal.reward_bad" }, "entity.tuff_golem.glue_on": { "sounds": [ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient1.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient1.ogg new file mode 100644 index 000000000..ad2fe22d4 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient1.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient2.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient2.ogg new file mode 100644 index 000000000..c04118c54 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient2.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient3.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient3.ogg new file mode 100644 index 000000000..588afc3ee Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient3.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient4.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient4.ogg new file mode 100644 index 000000000..16d62e4eb Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient4.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient5.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient5.ogg new file mode 100644 index 000000000..e7be41501 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/ambient5.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/disappear1.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/disappear1.ogg new file mode 100644 index 000000000..23d592857 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/disappear1.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/disappear2.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/disappear2.ogg new file mode 100644 index 000000000..0491d29a8 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/disappear2.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt1.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt1.ogg new file mode 100644 index 000000000..968ee55b9 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt1.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt2.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt2.ogg new file mode 100644 index 000000000..b9fe5b44b Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt2.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt3.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt3.ogg new file mode 100644 index 000000000..92d022806 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt3.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt4.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt4.ogg new file mode 100644 index 000000000..37354c77e Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt4.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt5.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt5.ogg new file mode 100644 index 000000000..72b2c8f98 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/hurt5.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod1.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod1.ogg new file mode 100644 index 000000000..9595f8c6c Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod1.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod2.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod2.ogg new file mode 100644 index 000000000..2da81f102 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod2.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod3.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod3.ogg new file mode 100644 index 000000000..6c0812f3f Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod3.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod4.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod4.ogg new file mode 100644 index 000000000..2f8e4696c Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/nod4.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reappear1.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reappear1.ogg new file mode 100644 index 000000000..4824defb8 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reappear1.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reappear2.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reappear2.ogg new file mode 100644 index 000000000..a3a55e835 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reappear2.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward1.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward1.ogg new file mode 100644 index 000000000..d269a3600 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward1.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward2.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward2.ogg new file mode 100644 index 000000000..e63178752 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward2.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad1.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad1.ogg new file mode 100644 index 000000000..06c723c66 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad1.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad2.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad2.ogg new file mode 100644 index 000000000..4aae2bb2d Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad2.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad3.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad3.ogg new file mode 100644 index 000000000..8a5f68d0d Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/rascal/reward_bad3.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_end.png b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_end.png new file mode 100644 index 000000000..7b41564af Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_end.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_front.png b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_front.png new file mode 100644 index 000000000..f2522c9db Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_front.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_front_honey.png b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_front_honey.png new file mode 100644 index 000000000..71ef288a7 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_front_honey.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_side.png b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_side.png new file mode 100644 index 000000000..ae7c74dd7 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/bamboo_beehive_side.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_end.png b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_end.png new file mode 100644 index 000000000..b9c632127 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_end.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_front.png b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_front.png new file mode 100644 index 000000000..186595bf7 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_front.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_front_honey.png b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_front_honey.png new file mode 100644 index 000000000..1261d145d Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_front_honey.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_side.png b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_side.png new file mode 100644 index 000000000..b9c6d31d6 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/block/cherry_beehive_side.png differ diff --git a/common/src/main/resources/assets/friendsandfoes/textures/entity/rascal/rascal.png b/common/src/main/resources/assets/friendsandfoes/textures/entity/rascal/rascal.png new file mode 100644 index 000000000..b01701881 Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/textures/entity/rascal/rascal.png differ diff --git a/common/src/main/resources/data/friendsandfoes/advancements/adventure/complete_hide_and_seek_game.json b/common/src/main/resources/data/friendsandfoes/advancements/adventure/complete_hide_and_seek_game.json new file mode 100644 index 000000000..aa3803733 --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/advancements/adventure/complete_hide_and_seek_game.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:adventure/root", + "display": { + "icon": { + "item": "minecraft:bundle" + }, + "title": { + "translate": "advancements.adventure.complete_hide_and_seek_game.title" + }, + "description": { + "translate": "advancements.adventure.complete_hide_and_seek_game.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "friendsandfoes:complete_hide_and_seek_game": { + "trigger": "friendsandfoes:complete_hide_and_seek_game", + "conditions": { + "entity": { + "type": "friendsandfoes:rascal" + } + } + } + }, + "requirements": [ + [ + "friendsandfoes:complete_hide_and_seek_game" + ] + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json b/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json index 3ef0fda1b..dedbff48a 100644 --- a/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json +++ b/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json @@ -40,6 +40,30 @@ ] } }, + "cherry_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:cherry_beehive" + ] + } + ] + } + }, + "bamboo_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:bamboo_beehive" + ] + } + ] + } + }, "birch_beehive": { "trigger": "minecraft:inventory_changed", "conditions": { @@ -132,9 +156,15 @@ [ "acacia_beehive" ], + [ + "bamboo_beehive" + ], [ "birch_beehive" ], + [ + "cherry_beehive" + ], [ "crimson_beehive" ], diff --git a/common/src/main/resources/data/friendsandfoes/loot_tables/blocks/bamboo_beehive.json b/common/src/main/resources/data/friendsandfoes/loot_tables/blocks/bamboo_beehive.json new file mode 100644 index 000000000..a21d1fbea --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/loot_tables/blocks/bamboo_beehive.json @@ -0,0 +1,58 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ], + "functions": [ + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Bees", + "target": "BlockEntityTag.Bees", + "op": "replace" + } + ] + }, + { + "function": "minecraft:copy_state", + "block": "friendsandfoes:bamboo_beehive", + "properties": [ + "honey_level" + ] + } + ], + "name": "friendsandfoes:bamboo_beehive" + }, + { + "type": "minecraft:item", + "name": "friendsandfoes:bamboo_beehive" + } + ] + } + ] + } + ] +} diff --git a/common/src/main/resources/data/friendsandfoes/loot_tables/blocks/cherry_beehive.json b/common/src/main/resources/data/friendsandfoes/loot_tables/blocks/cherry_beehive.json new file mode 100644 index 000000000..a93670ce8 --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/loot_tables/blocks/cherry_beehive.json @@ -0,0 +1,58 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ], + "functions": [ + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Bees", + "target": "BlockEntityTag.Bees", + "op": "replace" + } + ] + }, + { + "function": "minecraft:copy_state", + "block": "friendsandfoes:cherry_beehive", + "properties": [ + "honey_level" + ] + } + ], + "name": "friendsandfoes:cherry_beehive" + }, + { + "type": "minecraft:item", + "name": "friendsandfoes:cherry_beehive" + } + ] + } + ] + } + ] +} diff --git a/common/src/main/resources/data/friendsandfoes/loot_tables/entities/rascal.json b/common/src/main/resources/data/friendsandfoes/loot_tables/entities/rascal.json new file mode 100644 index 000000000..605616d6d --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/loot_tables/entities/rascal.json @@ -0,0 +1,4 @@ +{ + "type": "minecraft:entity", + "pools": [] +} \ No newline at end of file diff --git a/common/src/main/resources/data/friendsandfoes/loot_tables/rewards/rascal_good_reward.json b/common/src/main/resources/data/friendsandfoes/loot_tables/rewards/rascal_good_reward.json new file mode 100644 index 000000000..4478d9479 --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/loot_tables/rewards/rascal_good_reward.json @@ -0,0 +1,55 @@ +{ + "type": "minecraft:empty", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "weight": 4, + "type": "minecraft:item", + "name": "minecraft:iron_pickaxe", + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": 18.0, + "max": 22.0, + "type": "minecraft:uniform" + } + } + ] + }, + { + "weight": 2, + "type": "minecraft:item", + "name": "minecraft:iron_ore", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 5.0, + "max": 7.0 + } + } + ] + }, + { + "weight": 1, + "type": "minecraft:item", + "name": "minecraft:gold_ore", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 3.0, + "max": 5.0 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/friendsandfoes/recipes/bamboo_beehive.json b/common/src/main/resources/data/friendsandfoes/recipes/bamboo_beehive.json new file mode 100644 index 000000000..51f54731a --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/recipes/bamboo_beehive.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "PPP", + "HHH", + "PPP" + ], + "key": { + "P": { + "item": "minecraft:bamboo_planks" + }, + "H": { + "item": "minecraft:honeycomb" + } + }, + "result": { + "item": "friendsandfoes:bamboo_beehive" + } +} \ No newline at end of file diff --git a/common/src/main/resources/data/friendsandfoes/recipes/cherry_beehive.json b/common/src/main/resources/data/friendsandfoes/recipes/cherry_beehive.json new file mode 100644 index 000000000..6802db1d2 --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/recipes/cherry_beehive.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "PPP", + "HHH", + "PPP" + ], + "key": { + "P": { + "item": "minecraft:cherry_planks" + }, + "H": { + "item": "minecraft:honeycomb" + } + }, + "result": { + "item": "friendsandfoes:cherry_beehive" + } +} \ No newline at end of file diff --git a/common/src/main/resources/data/friendsandfoes/tags/worldgen/biome/has_more_mooblooms.json b/common/src/main/resources/data/friendsandfoes/tags/worldgen/biome/has_more_mooblooms.json index 40a3ea01e..ed7566de5 100644 --- a/common/src/main/resources/data/friendsandfoes/tags/worldgen/biome/has_more_mooblooms.json +++ b/common/src/main/resources/data/friendsandfoes/tags/worldgen/biome/has_more_mooblooms.json @@ -1,6 +1,7 @@ { "values": [ "minecraft:flower_forest", + "minecraft:cherry_grove", { "id": "#c:flower_forests", "required": false diff --git a/common/src/main/resources/data/friendsandfoes/tags/worldgen/biome/has_rascal.json b/common/src/main/resources/data/friendsandfoes/tags/worldgen/biome/has_rascal.json new file mode 100644 index 000000000..466bb9d2f --- /dev/null +++ b/common/src/main/resources/data/friendsandfoes/tags/worldgen/biome/has_rascal.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#minecraft:has_structure/mineshaft", + "#minecraft:has_structure/mineshaft_mesa" + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/minecraft/advancements/husbandry/wax_off.json b/common/src/main/resources/data/minecraft/advancements/husbandry/wax_off.json index 2fe4d0d3a..d28d536f0 100644 --- a/common/src/main/resources/data/minecraft/advancements/husbandry/wax_off.json +++ b/common/src/main/resources/data/minecraft/advancements/husbandry/wax_off.json @@ -19,45 +19,46 @@ }, "criteria": { "wax_off": { - "trigger": "minecraft:item_used_on_block", "conditions": { - "location": { - "block": { - "blocks": [ - "minecraft:waxed_copper_block", - "minecraft:waxed_exposed_copper", - "minecraft:waxed_weathered_copper", - "minecraft:waxed_oxidized_copper", - "minecraft:waxed_cut_copper", - "minecraft:waxed_exposed_cut_copper", - "minecraft:waxed_weathered_cut_copper", - "minecraft:waxed_oxidized_cut_copper", - "minecraft:waxed_cut_copper_slab", - "minecraft:waxed_exposed_cut_copper_slab", - "minecraft:waxed_weathered_cut_copper_slab", - "minecraft:waxed_oxidized_cut_copper_slab", - "minecraft:waxed_cut_copper_stairs", - "minecraft:waxed_exposed_cut_copper_stairs", - "minecraft:waxed_weathered_cut_copper_stairs", - "minecraft:waxed_oxidized_cut_copper_stairs", - "friendsandfoes:waxed_copper_button", - "friendsandfoes:waxed_exposed_copper_button", - "friendsandfoes:waxed_oxidized_copper_button", - "friendsandfoes:waxed_weathered_copper_button" - ] + "location": [ + { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "blocks": [ + "minecraft:waxed_copper_block", + "minecraft:waxed_exposed_copper", + "minecraft:waxed_weathered_copper", + "minecraft:waxed_oxidized_copper", + "minecraft:waxed_cut_copper", + "minecraft:waxed_exposed_cut_copper", + "minecraft:waxed_weathered_cut_copper", + "minecraft:waxed_oxidized_cut_copper", + "minecraft:waxed_cut_copper_slab", + "minecraft:waxed_exposed_cut_copper_slab", + "minecraft:waxed_weathered_cut_copper_slab", + "minecraft:waxed_oxidized_cut_copper_slab", + "minecraft:waxed_cut_copper_stairs", + "minecraft:waxed_exposed_cut_copper_stairs", + "minecraft:waxed_weathered_cut_copper_stairs", + "minecraft:waxed_oxidized_cut_copper_stairs", + "friendsandfoes:waxed_copper_button", + "friendsandfoes:waxed_exposed_copper_button", + "friendsandfoes:waxed_oxidized_copper_button", + "friendsandfoes:waxed_weathered_copper_button" + ] + } + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "tag": "minecraft:axes" + } } - }, - "item": { - "items": [ - "minecraft:wooden_axe", - "minecraft:golden_axe", - "minecraft:stone_axe", - "minecraft:iron_axe", - "minecraft:diamond_axe", - "minecraft:netherite_axe" - ] - } - } + ] + }, + "trigger": "minecraft:item_used_on_block" } }, "requirements": [ @@ -65,4 +66,4 @@ "wax_off" ] ] -} \ No newline at end of file +} diff --git a/common/src/main/resources/data/minecraft/advancements/husbandry/wax_on.json b/common/src/main/resources/data/minecraft/advancements/husbandry/wax_on.json index 82a67d96d..a0ea0390e 100644 --- a/common/src/main/resources/data/minecraft/advancements/husbandry/wax_on.json +++ b/common/src/main/resources/data/minecraft/advancements/husbandry/wax_on.json @@ -18,40 +18,48 @@ }, "criteria": { "wax_on": { - "trigger": "minecraft:item_used_on_block", "conditions": { - "location": { - "block": { - "blocks": [ - "minecraft:copper_block", - "minecraft:exposed_copper", - "minecraft:weathered_copper", - "minecraft:oxidized_copper", - "minecraft:cut_copper", - "minecraft:exposed_cut_copper", - "minecraft:weathered_cut_copper", - "minecraft:oxidized_cut_copper", - "minecraft:cut_copper_slab", - "minecraft:exposed_cut_copper_slab", - "minecraft:weathered_cut_copper_slab", - "minecraft:oxidized_cut_copper_slab", - "minecraft:cut_copper_stairs", - "minecraft:exposed_cut_copper_stairs", - "minecraft:weathered_cut_copper_stairs", - "minecraft:oxidized_cut_copper_stairs", - "friendsandfoes:copper_button", - "friendsandfoes:exposed_copper_button", - "friendsandfoes:oxidized_copper_button", - "friendsandfoes:weathered_copper_button" - ] + "location": [ + { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "blocks": [ + "minecraft:copper_block", + "minecraft:exposed_copper", + "minecraft:weathered_copper", + "minecraft:oxidized_copper", + "minecraft:cut_copper", + "minecraft:exposed_cut_copper", + "minecraft:weathered_cut_copper", + "minecraft:oxidized_cut_copper", + "minecraft:cut_copper_slab", + "minecraft:exposed_cut_copper_slab", + "minecraft:weathered_cut_copper_slab", + "minecraft:oxidized_cut_copper_slab", + "minecraft:cut_copper_stairs", + "minecraft:exposed_cut_copper_stairs", + "minecraft:weathered_cut_copper_stairs", + "minecraft:oxidized_cut_copper_stairs", + "friendsandfoes:copper_button", + "friendsandfoes:exposed_copper_button", + "friendsandfoes:oxidized_copper_button", + "friendsandfoes:weathered_copper_button" + ] + } + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:honeycomb" + ] + } } - }, - "item": { - "items": [ - "minecraft:honeycomb" - ] - } - } + ] + }, + "trigger": "minecraft:item_used_on_block" } }, "requirements": [ @@ -59,4 +67,4 @@ "wax_on" ] ] -} \ No newline at end of file +} diff --git a/common/src/main/resources/data/minecraft/tags/blocks/beehives.json b/common/src/main/resources/data/minecraft/tags/blocks/beehives.json index 7173e3df6..3c84b6bbc 100644 --- a/common/src/main/resources/data/minecraft/tags/blocks/beehives.json +++ b/common/src/main/resources/data/minecraft/tags/blocks/beehives.json @@ -2,7 +2,9 @@ "replace": false, "values": [ "friendsandfoes:acacia_beehive", + "friendsandfoes:bamboo_beehive", "friendsandfoes:birch_beehive", + "friendsandfoes:cherry_beehive", "friendsandfoes:crimson_beehive", "friendsandfoes:dark_oak_beehive", "friendsandfoes:jungle_beehive", diff --git a/common/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/common/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json index 7173e3df6..3c84b6bbc 100644 --- a/common/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/common/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -2,7 +2,9 @@ "replace": false, "values": [ "friendsandfoes:acacia_beehive", + "friendsandfoes:bamboo_beehive", "friendsandfoes:birch_beehive", + "friendsandfoes:cherry_beehive", "friendsandfoes:crimson_beehive", "friendsandfoes:dark_oak_beehive", "friendsandfoes:jungle_beehive", diff --git a/common/src/main/resources/data/minecraft/tags/point_of_interest_type/acquirable_job_site.json b/common/src/main/resources/data/minecraft/tags/point_of_interest_type/acquirable_job_site.json index 444e159b9..227e80203 100644 --- a/common/src/main/resources/data/minecraft/tags/point_of_interest_type/acquirable_job_site.json +++ b/common/src/main/resources/data/minecraft/tags/point_of_interest_type/acquirable_job_site.json @@ -3,7 +3,9 @@ "values": [ "minecraft:beehive", "friendsandfoes:acacia_beehive", + "friendsandfoes:bamboo_beehive", "friendsandfoes:birch_beehive", + "friendsandfoes:cherry_beehive", "friendsandfoes:crimson_beehive", "friendsandfoes:dark_oak_beehive", "friendsandfoes:jungle_beehive", diff --git a/common/src/main/resources/data/minecraft/tags/point_of_interest_type/bee_home.json b/common/src/main/resources/data/minecraft/tags/point_of_interest_type/bee_home.json index 7173e3df6..3c84b6bbc 100644 --- a/common/src/main/resources/data/minecraft/tags/point_of_interest_type/bee_home.json +++ b/common/src/main/resources/data/minecraft/tags/point_of_interest_type/bee_home.json @@ -2,7 +2,9 @@ "replace": false, "values": [ "friendsandfoes:acacia_beehive", + "friendsandfoes:bamboo_beehive", "friendsandfoes:birch_beehive", + "friendsandfoes:cherry_beehive", "friendsandfoes:crimson_beehive", "friendsandfoes:dark_oak_beehive", "friendsandfoes:jungle_beehive", diff --git a/common/src/main/resources/friendsandfoes-common.mixins.json b/common/src/main/resources/friendsandfoes-common.mixins.json index 11e7bbfdc..6b83c1673 100644 --- a/common/src/main/resources/friendsandfoes-common.mixins.json +++ b/common/src/main/resources/friendsandfoes-common.mixins.json @@ -7,7 +7,7 @@ "defaultRequire": 1 }, "mixins": [ - "AbstractButtonBlockMixin", + "AddCustomEntityPoseMixin", "AxeItemMixin", "BeeEntityAccessor", "BeeEntityMixin", @@ -16,6 +16,7 @@ "BlazeEntityMixin", "BlazeLivingEntityMixin", "BlindTargetGoalFactory", + "BundleItemAccessor", "CarvedPumpkinBlockMixin", "ChickenEntityMixin", "HoneycombItemMixin", @@ -26,6 +27,7 @@ "LightningEntityMixin", "LightningRodBlockDegradableMixin", "LightningRodBlockMixin", + "LimbAnimatorAccessor", "PatrolSpawnerAccessor", "PatrolSpawnerMixin", "PlayerEntityMixin", @@ -38,7 +40,7 @@ "SnowballEntityMixin", "SpawnRestrictionAccessor", "StrongholdGeneratorMixin", - "StructurePoolMixin", + "StructurePoolAccessor", "TemptGoalMixin", "VillagerEntityMixin", "VillagerHostilesSensorMixin", diff --git a/common/src/main/resources/friendsandfoes.accesswidener b/common/src/main/resources/friendsandfoes.accesswidener index 13334d7d3..109ab5056 100644 --- a/common/src/main/resources/friendsandfoes.accesswidener +++ b/common/src/main/resources/friendsandfoes.accesswidener @@ -11,8 +11,6 @@ accessible field net/minecraft/world/poi/PointOfInterestType ticketCount I mutable field net/minecraft/world/poi/PointOfInterestType ticketCount I accessible field net/minecraft/world/poi/PointOfInterestTypes POI_STATES_TO_TYPE Ljava/util/Map; mutable field net/minecraft/world/poi/PointOfInterestTypes POI_STATES_TO_TYPE Ljava/util/Map; -accessible field net/minecraft/world/poi/PointOfInterestTypes POI_STATES Ljava/util/Set; -mutable field net/minecraft/world/poi/PointOfInterestTypes POI_STATES Ljava/util/Set; accessible field net/minecraft/block/entity/BlockEntityType blocks Ljava/util/Set; mutable field net/minecraft/block/entity/BlockEntityType blocks Ljava/util/Set; accessible method net/minecraft/world/poi/PointOfInterestTypes getStatesOfBlock (Lnet/minecraft/block/Block;)Ljava/util/Set; @@ -22,4 +20,12 @@ accessible method net/minecraft/entity/passive/BeeEntity$PollinateGoal isRunning accessible field net/minecraft/world/gen/structure/JigsawStructure startHeight Lnet/minecraft/world/gen/heightprovider/HeightProvider; accessible method net/minecraft/entity/ai/brain/MemoryModuleType (Ljava/util/Optional;)V accessible method net/minecraft/entity/ai/brain/Activity (Ljava/lang/String;)V +accessible field net/minecraft/item/ItemGroups SPAWN_EGGS Lnet/minecraft/registry/RegistryKey; +accessible field net/minecraft/item/ItemGroups NATURAL Lnet/minecraft/registry/RegistryKey; +accessible field net/minecraft/item/ItemGroups FUNCTIONAL Lnet/minecraft/registry/RegistryKey; +accessible field net/minecraft/item/ItemGroups REDSTONE Lnet/minecraft/registry/RegistryKey; +accessible field net/minecraft/item/ItemGroups INGREDIENTS Lnet/minecraft/registry/RegistryKey; +accessible field net/minecraft/item/ItemGroups COMBAT Lnet/minecraft/registry/RegistryKey; +accessible method net/minecraft/sound/SoundEvent of (Lnet/minecraft/util/Identifier;)Lnet/minecraft/sound/SoundEvent; +accessible method net/minecraft/block/BlockSetType register (Lnet/minecraft/block/BlockSetType;)Lnet/minecraft/block/BlockSetType; accessible method net/minecraft/particle/DefaultParticleType (Z)V \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 80e87f5be..4d917f260 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -147,4 +147,4 @@ publishing { repositories { } -} +} \ No newline at end of file diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java index 27921ff23..b8f9b32c7 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java @@ -2,11 +2,13 @@ import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.init.FriendsAndFoesPointOfInterestTypes; +import com.faboslav.friendsandfoes.init.FriendsAndFoesStructurePoolElements; import com.faboslav.friendsandfoes.util.ServerWorldSpawnersUtil; import com.faboslav.friendsandfoes.util.UpdateChecker; import com.faboslav.friendsandfoes.world.spawner.IceologerSpawner; import com.faboslav.friendsandfoes.world.spawner.IllusionerSpawner; import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents; import net.minecraft.util.Util; @@ -25,6 +27,7 @@ public void onInitialize() { initSpawners(); initTickDeltaCounter(); + addCustomStructurePoolElements(); } private static void initSpawners() { @@ -43,4 +46,8 @@ private static void initTickDeltaCounter() { serverTickDeltaCounter.beginRenderTick(Util.getMeasuringTimeMs()); }); } + + private static void addCustomStructurePoolElements() { + ServerLifecycleEvents.SERVER_STARTING.register(FriendsAndFoesStructurePoolElements::init); + } } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomEntityPoseMixin.java b/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomEntityPoseMixin.java deleted file mode 100644 index 77511df9c..000000000 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomEntityPoseMixin.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.faboslav.friendsandfoes.mixin.fabric; - -import com.faboslav.friendsandfoes.entity.pose.TuffGolemEntityPose; -import net.minecraft.entity.EntityPose; -import org.objectweb.asm.Opcodes; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.gen.Invoker; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.ArrayList; -import java.util.Arrays; - -@Mixin(EntityPose.class) -@SuppressWarnings({"ShadowTarget", "InvokerTarget"}) -public final class AddCustomEntityPoseMixin -{ - @Invoker("") - private static EntityPose newEntityPose( - String internalName, - int internalId - ) { - throw new AssertionError(); - } - - @Shadow - private static @Final - @Mutable - EntityPose[] field_18083; - - @Inject( - method = "", - at = @At( - value = "FIELD", - opcode = Opcodes.PUTSTATIC, - target = "Lnet/minecraft/entity/EntityPose;field_18083:[Lnet/minecraft/entity/EntityPose;", - shift = At.Shift.AFTER - ) - ) - private static void friendsandfoes_addCustomEntityPoses(CallbackInfo ci) { - var entityPoses = new ArrayList<>(Arrays.asList(field_18083)); - var lastEntityPose = entityPoses.get(entityPoses.size() - 1); - - var tuffGolemStanding = newEntityPose( - TuffGolemEntityPose.STANDING.getName(), - lastEntityPose.ordinal() + 1 - ); - entityPoses.add(tuffGolemStanding); - - var tuffGolemStandingWithItem = newEntityPose( - TuffGolemEntityPose.STANDING_WITH_ITEM.getName(), - lastEntityPose.ordinal() + 2 - ); - entityPoses.add(tuffGolemStandingWithItem); - - var tuffGolemSleeping = newEntityPose( - TuffGolemEntityPose.SLEEPING.getName(), - lastEntityPose.ordinal() + 3 - ); - entityPoses.add(tuffGolemSleeping); - - var tuffGolemSleepingWithItem = newEntityPose( - TuffGolemEntityPose.SLEEPING_WITH_ITEM.getName(), - lastEntityPose.ordinal() + 4 - ); - entityPoses.add(tuffGolemSleepingWithItem); - - field_18083 = entityPoses.toArray(new EntityPose[0]); - } -} diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomSpawnGroupMixin.java b/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomSpawnGroupMixin.java index 282f4185d..a91182f95 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomSpawnGroupMixin.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomSpawnGroupMixin.java @@ -54,15 +54,27 @@ private static void friendsandfoes_addCustomSpawnGroup(CallbackInfo ci) { var glaresSpawnGroup = newSpawnGroup( CustomSpawnGroup.GLARES_INTERNAL_NAME, lastSpawnGroup.ordinal() + 1, - CustomSpawnGroup.NAME, - CustomSpawnGroup.SPAWN_CAP, - CustomSpawnGroup.PEACEFUL, - CustomSpawnGroup.RARE, - CustomSpawnGroup.IMMEDIATE_DESPAWN_RANGE + CustomSpawnGroup.GLARES_NAME, + CustomSpawnGroup.GLARES_SPAWN_CAP, + CustomSpawnGroup.GLARES_PEACEFUL, + CustomSpawnGroup.GLARES_RARE, + CustomSpawnGroup.GLARES_IMMEDIATE_DESPAWN_RANGE ); CustomSpawnGroupImpl.GLARES = glaresSpawnGroup; spawnGroups.add(glaresSpawnGroup); + var rascalsSpawnGroup = newSpawnGroup( + CustomSpawnGroup.RASCALS_INTERNAL_NAME, + lastSpawnGroup.ordinal() + 2, + CustomSpawnGroup.RASCALS_NAME, + CustomSpawnGroup.RASCALS_SPAWN_CAP, + CustomSpawnGroup.RASCALS_PEACEFUL, + CustomSpawnGroup.RASCALS_RARE, + CustomSpawnGroup.RASCALS_IMMEDIATE_DESPAWN_RANGE + ); + CustomSpawnGroupImpl.RASCALS = rascalsSpawnGroup; + spawnGroups.add(rascalsSpawnGroup); + field_6301 = spawnGroups.toArray(new SpawnGroup[0]); } } \ No newline at end of file diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/StructureEntityProcessorMixin.java b/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/StructureEntityProcessorMixin.java index fb242900c..d332677d5 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/StructureEntityProcessorMixin.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/StructureEntityProcessorMixin.java @@ -106,7 +106,11 @@ private void friendsandfoes_processEntities( ((MobEntity) entity).initialize( serverWorldAccess, serverWorldAccess.getLocalDifficulty( - new BlockPos(vec3d) + new BlockPos( + (int) vec3d.getX(), + (int) vec3d.getY(), + (int) vec3d.getZ() + ) ), SpawnReason.STRUCTURE, null, diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/BiomeModificationsImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/BiomeModificationsImpl.java index 07d06db53..3ca4d32d7 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/BiomeModificationsImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/BiomeModificationsImpl.java @@ -5,10 +5,10 @@ import net.fabricmc.fabric.api.biome.v1.ModificationPhase; import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnGroup; -import net.minecraft.tag.BiomeTags; -import net.minecraft.tag.TagKey; -import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryKey; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.BiomeTags; +import net.minecraft.registry.tag.TagKey; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStep; @@ -26,14 +26,14 @@ public static void addMobSpawn( } public static void addButtercupFeature() { - TagKey flowerForestTag = TagKey.of(Registry.BIOME_KEY, FriendsAndFoes.makeID("has_buttercup_patch")); + TagKey flowerForestTag = TagKey.of(RegistryKeys.BIOME, FriendsAndFoes.makeID("has_buttercup_patch")); BiomeModifications.create(FriendsAndFoes.makeID("add_buttercup_patch")) .add(ModificationPhase.ADDITIONS, (context) -> context.hasTag(flowerForestTag), context -> context.getGenerationSettings().addFeature( GenerationStep.Feature.VEGETAL_DECORATION, RegistryKey.of( - Registry.PLACED_FEATURE_KEY, + RegistryKeys.PLACED_FEATURE, FriendsAndFoes.makeID("buttercup_patch") ) ) diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/CustomSpawnGroupImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/CustomSpawnGroupImpl.java index d4c8f74f8..3c73af815 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/CustomSpawnGroupImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/CustomSpawnGroupImpl.java @@ -11,10 +11,19 @@ public final class CustomSpawnGroupImpl public static SpawnGroup GLARES; + public static SpawnGroup RASCALS; + /** * @see CustomSpawnGroup#getGlaresCategory() */ public static SpawnGroup getGlaresCategory() { return GLARES; } + + /** + * @see CustomSpawnGroup#getRascalsCategory() + */ + public static SpawnGroup getRascalsCategory() { + return RASCALS; + } } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/RegistryHelperImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/RegistryHelperImpl.java index d456f6ceb..655371121 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/RegistryHelperImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/RegistryHelperImpl.java @@ -4,9 +4,11 @@ import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry; import net.fabricmc.fabric.api.registry.FlammableBlockRegistry; import net.minecraft.block.Block; +import net.minecraft.block.BlockSetType; import net.minecraft.client.model.TexturedModelData; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.entity.EntityRendererFactory; @@ -17,13 +19,17 @@ import net.minecraft.entity.ai.brain.Activity; import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.mob.MobEntity; import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.SpawnEggItem; import net.minecraft.particle.DefaultParticleType; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; import net.minecraft.sound.SoundEvent; import net.minecraft.structure.processor.StructureProcessor; import net.minecraft.structure.processor.StructureProcessorType; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import net.minecraft.village.VillagerProfession; import net.minecraft.world.gen.structure.Structure; import net.minecraft.world.gen.structure.StructureType; @@ -33,16 +39,32 @@ public final class RegistryHelperImpl { + public static void addToItemGroupBefore(RegistryKey itemGroup, Item item, Item before) { + ItemGroupEvents.modifyEntriesEvent(itemGroup).register((content) -> { + content.addBefore(before, item.getDefaultStack()); + }); + } + + public static void addToItemGroupAfter(RegistryKey itemGroup, Item item, Item after) { + ItemGroupEvents.modifyEntriesEvent(itemGroup).register((content) -> { + content.addAfter(after, item.getDefaultStack()); + }); + } + public static Supplier registerActivity(String name, Supplier activity) { - var registry = Registry.register(Registry.ACTIVITY, FriendsAndFoes.makeID(name), activity.get()); + var registry = Registry.register(Registries.ACTIVITY, FriendsAndFoes.makeID(name), activity.get()); return () -> registry; } public static Supplier registerBlock(String name, Supplier block) { - var registry = Registry.register(Registry.BLOCK, FriendsAndFoes.makeID(name), block.get()); + var registry = Registry.register(Registries.BLOCK, FriendsAndFoes.makeID(name), block.get()); return () -> registry; } + public static void registerBlockSetType(Supplier blockSetType) { + BlockSetType.register(blockSetType.get()); + } + public static void registerEntityModelLayer(EntityModelLayer location, Supplier definition) { EntityModelLayerRegistry.registerModelLayer(location, definition::get); } @@ -58,7 +80,7 @@ public static Supplier> registerEntityType( String name, Supplier> entityType ) { - var registry = Registry.register(Registry.ENTITY_TYPE, FriendsAndFoes.makeID(name), entityType.get()); + var registry = Registry.register(Registries.ENTITY_TYPE, FriendsAndFoes.makeID(name), entityType.get()); return () -> registry; } @@ -70,19 +92,29 @@ public static void registerEntityAttribute( } public static Supplier registerItem(String name, Supplier item) { - var registry = Registry.register(Registry.ITEM, FriendsAndFoes.makeID(name), item.get()); + var registry = Registry.register(Registries.ITEM, FriendsAndFoes.makeID(name), item.get()); return () -> registry; } + public static Supplier registerSpawnEggItem( + String name, + Supplier> type, + int backgroundColor, + int highlightColor, + Item.Settings props + ) { + return (Supplier) registerItem(name, () -> new SpawnEggItem(type.get(), backgroundColor, highlightColor, props)); + } + public static void registerParticleType(String name, DefaultParticleType particleType) { - Registry.register(Registry.PARTICLE_TYPE, FriendsAndFoes.makeStringID(name), particleType); + Registry.register(Registries.PARTICLE_TYPE, FriendsAndFoes.makeStringID(name), particleType); } public static > Supplier registerMemoryModuleType( String name, Supplier memoryModuleType ) { - var registry = Registry.register(Registry.MEMORY_MODULE_TYPE, FriendsAndFoes.makeID(name), memoryModuleType.get()); + var registry = Registry.register(Registries.MEMORY_MODULE_TYPE, FriendsAndFoes.makeID(name), memoryModuleType.get()); return () -> registry; } @@ -90,7 +122,7 @@ public static Supplier registerPointOfInteres String name, Supplier pointOfInterestType ) { - var registry = Registry.register(Registry.POINT_OF_INTEREST_TYPE, FriendsAndFoes.makeID(name), pointOfInterestType.get()); + var registry = Registry.register(Registries.POINT_OF_INTEREST_TYPE, FriendsAndFoes.makeID(name), pointOfInterestType.get()); return () -> registry; } @@ -99,7 +131,7 @@ public static void registerRenderType(RenderLayer type, Block... blocks) { } public static Supplier registerSoundEvent(String name, Supplier soundEvent) { - var registry = Registry.register(Registry.SOUND_EVENT, FriendsAndFoes.makeID(name), soundEvent.get()); + var registry = Registry.register(Registries.SOUND_EVENT, FriendsAndFoes.makeID(name), soundEvent.get()); return () -> registry; } @@ -107,7 +139,7 @@ public static Supplier registerVillagerProfess String name, Supplier villagerProfession ) { - var registry = Registry.register(Registry.VILLAGER_PROFESSION, FriendsAndFoes.makeID(name), villagerProfession.get()); + var registry = Registry.register(Registries.VILLAGER_PROFESSION, FriendsAndFoes.makeID(name), villagerProfession.get()); return () -> registry; } @@ -120,17 +152,17 @@ public static void registerFlammableBlock( FlammableBlockRegistry.getInstance(fireBlock).add(block.get(), burnChance, spreadChance); } - public static void registerStructureProcessorType( - Identifier identifier, - StructureProcessorType structureProcessorType + public static void registerStructureType( + String name, + StructureType structureType ) { - Registry.register(Registry.STRUCTURE_PROCESSOR, identifier, structureProcessorType); + Registry.register(Registries.STRUCTURE_TYPE, FriendsAndFoes.makeID(name), structureType); } - public static void registerStructureType( + public static void registerStructureProcessorType( String name, - StructureType structureType + StructureProcessorType structureProcessorType ) { - Registry.register(Registry.STRUCTURE_TYPE, FriendsAndFoes.makeID(name), structureType); + Registry.register(Registries.STRUCTURE_PROCESSOR, FriendsAndFoes.makeID(name), structureProcessorType); } } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/StructureEntityProcessorTypesImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/StructureEntityProcessorTypesImpl.java index 40e6d54f4..24aef33ca 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/StructureEntityProcessorTypesImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/platform/fabric/StructureEntityProcessorTypesImpl.java @@ -1,6 +1,5 @@ package com.faboslav.friendsandfoes.platform.fabric; -import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.platform.RegistryHelper; import com.faboslav.friendsandfoes.world.processor.fabric.IceologerCabinArmorStandProcessor; import com.faboslav.friendsandfoes.world.processor.fabric.IllusionerShackItemFrameProcessor; @@ -11,8 +10,8 @@ public final class StructureEntityProcessorTypesImpl public static StructureProcessorType ICEOLOGER_CABIN_ARMOR_STAND_PROCESSOR = () -> IceologerCabinArmorStandProcessor.CODEC; public static StructureProcessorType ILLUSIONER_SHACK_ITEM_FRAME_PROCESSOR = () -> IllusionerShackItemFrameProcessor.CODEC; - public static void postInit() { - RegistryHelper.registerStructureProcessorType(FriendsAndFoes.makeID("iceologer_cabin_armor_stand_processor"), ICEOLOGER_CABIN_ARMOR_STAND_PROCESSOR); - RegistryHelper.registerStructureProcessorType(FriendsAndFoes.makeID("illusioner_shack_item_frame_processor"), ILLUSIONER_SHACK_ITEM_FRAME_PROCESSOR); + public static void init() { + RegistryHelper.registerStructureProcessorType("iceologer_cabin_armor_stand_processor", ICEOLOGER_CABIN_ARMOR_STAND_PROCESSOR); + RegistryHelper.registerStructureProcessorType("illusioner_shack_item_frame_processor", ILLUSIONER_SHACK_ITEM_FRAME_PROCESSOR); } } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index f33e052d9..53d06d5f2 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -11,7 +11,8 @@ "homepage": "https://github.com/Faboslav/friends-and-foes", "sources": "https://github.com/Faboslav/friends-and-foes", "issues": "https://github.com/Faboslav/friends-and-foes/issues", - "wiki": "https://github.com/Faboslav/friends-and-foes/wiki" + "wiki": "https://github.com/Faboslav/friends-and-foes/wiki", + "discord": "https://discord.com/invite/QGwFvvMQCn" }, "license": "CC-BY-NC-ND-4.0", "icon": "icon.jpg", @@ -39,7 +40,7 @@ ], "depends": { "java": ">=17", - "minecraft": ">=1.19", + "minecraft": ">=1.20", "fabric": "*", "fabricloader": "*" }, diff --git a/fabric/src/main/resources/friendsandfoes.mixins.json b/fabric/src/main/resources/friendsandfoes.mixins.json index b3da463ee..9b19e2178 100644 --- a/fabric/src/main/resources/friendsandfoes.mixins.json +++ b/fabric/src/main/resources/friendsandfoes.mixins.json @@ -7,7 +7,6 @@ "defaultRequire": 1 }, "mixins": [ - "AddCustomEntityPoseMixin", "AddCustomRaidMemberMixin", "AddCustomSpawnGroupMixin", "StructureEntityProcessorMixin" diff --git a/forge/build.gradle b/forge/build.gradle index 77932a605..13c013bb4 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -107,4 +107,4 @@ publishing { repositories { } -} +} \ No newline at end of file diff --git a/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForge.java b/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForge.java index 8d720a738..b5fa56294 100644 --- a/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForge.java +++ b/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForge.java @@ -3,6 +3,7 @@ import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.FriendsAndFoesClient; import com.faboslav.friendsandfoes.init.FriendsAndFoesEntityTypes; +import com.faboslav.friendsandfoes.init.FriendsAndFoesStructurePoolElements; import com.faboslav.friendsandfoes.network.PacketHandler; import com.faboslav.friendsandfoes.platform.forge.RegistryHelperImpl; import com.faboslav.friendsandfoes.util.CustomRaidMember; @@ -14,16 +15,19 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.item.ItemGroup; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.Util; import net.minecraft.village.raid.Raid; import net.minecraft.world.dimension.DimensionTypes; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.BuildCreativeModeTabContentsEvent; import net.minecraftforge.event.TickEvent; import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.event.entity.EntityAttributeCreationEvent; import net.minecraftforge.event.level.LevelEvent; +import net.minecraftforge.event.server.ServerAboutToStartEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; @@ -61,14 +65,17 @@ public FriendsAndFoesForge() { RegistryHelperImpl.POINT_OF_INTEREST_TYPES.register(bus); RegistryHelperImpl.SOUND_EVENTS.register(bus); RegistryHelperImpl.STRUCTURE_TYPES.register(bus); + RegistryHelperImpl.STRUCTURE_PROCESSOR_TYPES.register(bus); RegistryHelperImpl.VILLAGER_PROFESSIONS.register(bus); bus.addListener(FriendsAndFoesForge::init); bus.addListener(FriendsAndFoesForge::registerEntityAttributes); + bus.addListener(FriendsAndFoesForge::addItemsToTabs); var forgeBus = MinecraftForge.EVENT_BUS; forgeBus.addListener(FriendsAndFoesForge::initSpawners); forgeBus.addListener(FriendsAndFoesForge::initTickDeltaCounter); + forgeBus.addListener(FriendsAndFoesForge::onServerAboutToStartEvent); MinecraftForge.EVENT_BUS.register(this); } @@ -101,6 +108,24 @@ private static void registerEntityAttributes(EntityAttributeCreationEvent event) } } + private static void addItemsToTabs(BuildCreativeModeTabContentsEvent event) { + RegistryHelperImpl.ITEMS_TO_ADD_BEFORE.forEach((itemGroup, itemPairs) -> { + if (event.getTabKey() == itemGroup) { + itemPairs.forEach((item, before) -> { + event.getEntries().putBefore(before.getDefaultStack(), item.getDefaultStack(), ItemGroup.StackVisibility.PARENT_AND_SEARCH_TABS); + }); + } + }); + + RegistryHelperImpl.ITEMS_TO_ADD_AFTER.forEach((itemGroup, itemPairs) -> { + if (event.getTabKey() == itemGroup) { + itemPairs.forEach((item, after) -> { + event.getEntries().putAfter(after.getDefaultStack(), item.getDefaultStack(), ItemGroup.StackVisibility.PARENT_AND_SEARCH_TABS); + }); + } + }); + } + private static void initSpawners(final LevelEvent.Load event) { if ( event.getLevel().isClient() @@ -131,4 +156,8 @@ private static void initTickDeltaCounter(final ServerTickEvent event) { serverTickDeltaCounter.beginRenderTick(Util.getMeasuringTimeMs()); } + + public static void onServerAboutToStartEvent(ServerAboutToStartEvent event) { + FriendsAndFoesStructurePoolElements.init(event.getServer()); + } } diff --git a/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForgeClient.java b/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForgeClient.java index d8fe358d3..52d872c5c 100644 --- a/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForgeClient.java +++ b/forge/src/main/java/com/faboslav/friendsandfoes/forge/FriendsAndFoesForgeClient.java @@ -49,7 +49,7 @@ public static void registerLayerDefinitions(RegisterLayerDefinitions event) { @SubscribeEvent public static void registerParticleFactory(RegisterParticleProvidersEvent event) { - event.register(FriendsAndFoesParticleTypes.TOTEM_OF_FREEZING, FreezingTotemParticle.Factory::new); - event.register(FriendsAndFoesParticleTypes.TOTEM_OF_ILLUSION, IllusionTotemParticle.Factory::new); + event.registerSpriteSet(FriendsAndFoesParticleTypes.TOTEM_OF_FREEZING, FreezingTotemParticle.Factory::new); + event.registerSpriteSet(FriendsAndFoesParticleTypes.TOTEM_OF_ILLUSION, IllusionTotemParticle.Factory::new); } } diff --git a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/BiomeModificationsImpl.java b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/BiomeModificationsImpl.java index fa4001e5e..5aeffd3b3 100644 --- a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/BiomeModificationsImpl.java +++ b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/BiomeModificationsImpl.java @@ -2,7 +2,7 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnGroup; -import net.minecraft.tag.TagKey; +import net.minecraft.registry.tag.TagKey; import net.minecraft.world.biome.Biome; public final class BiomeModificationsImpl diff --git a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/CustomSpawnGroupImpl.java b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/CustomSpawnGroupImpl.java index 637dd83fa..34a34c2f7 100644 --- a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/CustomSpawnGroupImpl.java +++ b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/CustomSpawnGroupImpl.java @@ -7,20 +7,42 @@ public final class CustomSpawnGroupImpl { public static SpawnGroup GLARES; + public static SpawnGroup RASCALS; + /** * @see CustomSpawnGroup#getGlaresCategory() */ public static SpawnGroup getGlaresCategory() { - var spawnGroup = SpawnGroup.byName(CustomSpawnGroup.NAME); + var spawnGroup = SpawnGroup.byName(CustomSpawnGroup.GLARES_NAME); + + if (spawnGroup == null) { + spawnGroup = SpawnGroup.create( + CustomSpawnGroup.GLARES_NAME, + CustomSpawnGroup.GLARES_NAME, + CustomSpawnGroup.GLARES_SPAWN_CAP, + CustomSpawnGroup.GLARES_PEACEFUL, + CustomSpawnGroup.GLARES_RARE, + CustomSpawnGroup.GLARES_IMMEDIATE_DESPAWN_RANGE + ); + } + + return spawnGroup; + } + + /** + * @see CustomSpawnGroup#getRascalsCategory() + */ + public static SpawnGroup getRascalsCategory() { + var spawnGroup = SpawnGroup.byName(CustomSpawnGroup.RASCALS_NAME); if (spawnGroup == null) { spawnGroup = SpawnGroup.create( - CustomSpawnGroup.NAME, - CustomSpawnGroup.NAME, - CustomSpawnGroup.SPAWN_CAP, - CustomSpawnGroup.PEACEFUL, - CustomSpawnGroup.RARE, - CustomSpawnGroup.IMMEDIATE_DESPAWN_RANGE + CustomSpawnGroup.RASCALS_NAME, + CustomSpawnGroup.RASCALS_NAME, + CustomSpawnGroup.RASCALS_SPAWN_CAP, + CustomSpawnGroup.RASCALS_PEACEFUL, + CustomSpawnGroup.RASCALS_RARE, + CustomSpawnGroup.RASCALS_IMMEDIATE_DESPAWN_RANGE ); } diff --git a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/RegistryHelperImpl.java b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/RegistryHelperImpl.java index 69cf535b7..54a574a6a 100644 --- a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/RegistryHelperImpl.java +++ b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/RegistryHelperImpl.java @@ -3,6 +3,7 @@ import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.mixin.forge.FireBlockAccessor; import net.minecraft.block.Block; +import net.minecraft.block.BlockSetType; import net.minecraft.client.model.TexturedModelData; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderLayers; @@ -15,21 +16,25 @@ import net.minecraft.entity.ai.brain.Activity; import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.mob.MobEntity; import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; import net.minecraft.particle.DefaultParticleType; import net.minecraft.particle.ParticleType; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; import net.minecraft.sound.SoundEvent; import net.minecraft.structure.processor.StructureProcessor; import net.minecraft.structure.processor.StructureProcessorType; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import net.minecraft.village.VillagerProfession; import net.minecraft.world.gen.structure.Structure; import net.minecraft.world.gen.structure.StructureType; import net.minecraft.world.poi.PointOfInterestType; +import net.minecraftforge.common.ForgeSpawnEggItem; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; +import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; @@ -46,9 +51,33 @@ public final class RegistryHelperImpl public static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, FriendsAndFoes.MOD_ID); public static final DeferredRegister POINT_OF_INTEREST_TYPES = DeferredRegister.create(ForgeRegistries.POI_TYPES, FriendsAndFoes.MOD_ID); public static final DeferredRegister SOUND_EVENTS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, FriendsAndFoes.MOD_ID); - public static final DeferredRegister> STRUCTURE_TYPES = DeferredRegister.create(Registry.STRUCTURE_TYPE_KEY, FriendsAndFoes.MOD_ID); + public static final DeferredRegister> STRUCTURE_TYPES = DeferredRegister.create(RegistryKeys.STRUCTURE_TYPE, FriendsAndFoes.MOD_ID); + public static final DeferredRegister> STRUCTURE_PROCESSOR_TYPES = DeferredRegister.create(RegistryKeys.STRUCTURE_PROCESSOR, FriendsAndFoes.MOD_ID); public static final DeferredRegister VILLAGER_PROFESSIONS = DeferredRegister.create(ForgeRegistries.VILLAGER_PROFESSIONS, FriendsAndFoes.MOD_ID); + public static final HashMap, HashMap> ITEMS_TO_ADD_BEFORE = new HashMap<>(); + public static final HashMap, HashMap> ITEMS_TO_ADD_AFTER = new HashMap<>(); + + public static void addToItemGroupBefore(RegistryKey itemGroup, Item item, Item before) { + if (ITEMS_TO_ADD_BEFORE.containsKey(itemGroup)) { + ITEMS_TO_ADD_BEFORE.get(itemGroup).put(item, before); + } else { + HashMap items = new HashMap<>(); + items.put(item, before); + ITEMS_TO_ADD_BEFORE.put(itemGroup, items); + } + } + + public static void addToItemGroupAfter(RegistryKey itemGroup, Item item, Item after) { + if (ITEMS_TO_ADD_AFTER.containsKey(itemGroup)) { + ITEMS_TO_ADD_AFTER.get(itemGroup).put(item, after); + } else { + HashMap items = new HashMap<>(); + items.put(item, after); + ITEMS_TO_ADD_AFTER.put(itemGroup, items); + } + } + public static Supplier registerActivity(String name, Supplier activity) { return ACTIVITIES.register(name, activity); } @@ -57,6 +86,10 @@ public static Supplier registerBlock(String name, Supplier< return BLOCKS.register(name, block); } + public static void registerBlockSetType(Supplier blockSetType) { + BlockSetType.register(blockSetType.get()); + } + public static void registerEntityModelLayer(EntityModelLayer location, Supplier definition) { ENTITY_MODEL_LAYERS.put(location, definition); } @@ -86,6 +119,16 @@ public static Supplier registerItem(String name, Supplier return ITEMS.register(name, item); } + public static Supplier registerSpawnEggItem( + String name, + Supplier> type, + int backgroundColor, + int highlightColor, + Item.Settings props + ) { + return (Supplier) registerItem(name, () -> new ForgeSpawnEggItem(type, backgroundColor, highlightColor, props)); + } + public static > Supplier registerMemoryModuleType( String name, Supplier memoryModuleType @@ -130,11 +173,11 @@ public static void registerFlammableBlock( ((FireBlockAccessor) fireBlock).invokeRegisterFlammableBlock(block.get(), burnChance, spreadChance); } - public static void registerStructureProcessorType( - Identifier identifier, - StructureProcessorType structureProcessorType + public static void registerStructureProcessorType( + String name, + StructureProcessorType structureProcessorType ) { - Registry.register(Registry.STRUCTURE_PROCESSOR, identifier, structureProcessorType); + STRUCTURE_PROCESSOR_TYPES.register(name, () -> structureProcessorType); } public static void registerStructureType( diff --git a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/StructureEntityProcessorTypesImpl.java b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/StructureEntityProcessorTypesImpl.java index dc0ccf934..d971d3457 100644 --- a/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/StructureEntityProcessorTypesImpl.java +++ b/forge/src/main/java/com/faboslav/friendsandfoes/platform/forge/StructureEntityProcessorTypesImpl.java @@ -1,6 +1,5 @@ package com.faboslav.friendsandfoes.platform.forge; -import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.platform.RegistryHelper; import com.faboslav.friendsandfoes.world.processor.forge.IceologerCabinArmorStandProcessor; import com.faboslav.friendsandfoes.world.processor.forge.IllusionerShackItemFrameProcessor; @@ -11,8 +10,8 @@ public final class StructureEntityProcessorTypesImpl public static StructureProcessorType ICEOLOGER_CABIN_ARMOR_STAND_PROCESSOR = () -> IceologerCabinArmorStandProcessor.CODEC; public static StructureProcessorType ILLUSIONER_SHACK_ITEM_FRAME_PROCESSOR = () -> IllusionerShackItemFrameProcessor.CODEC; - public static void postInit() { - RegistryHelper.registerStructureProcessorType(FriendsAndFoes.makeID("iceologer_cabin_armor_stand_processor"), ICEOLOGER_CABIN_ARMOR_STAND_PROCESSOR); - RegistryHelper.registerStructureProcessorType(FriendsAndFoes.makeID("illusioner_shack_item_frame_processor"), ILLUSIONER_SHACK_ITEM_FRAME_PROCESSOR); + public static void init() { + RegistryHelper.registerStructureProcessorType("iceologer_cabin_armor_stand_processor", ICEOLOGER_CABIN_ARMOR_STAND_PROCESSOR); + RegistryHelper.registerStructureProcessorType("illusioner_shack_item_frame_processor", ILLUSIONER_SHACK_ITEM_FRAME_PROCESSOR); } } diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 0832425c1..0c9dab6c6 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -14,20 +14,20 @@ logoFile = "icon.jpg" [[dependencies.friendsandfoes]] modId = "forge" mandatory = true -versionRange = "[43.1.0,)" +versionRange = "[46.0.1,)" ordering = "NONE" side = "BOTH" [[dependencies.friendsandfoes]] modId = "minecraft" mandatory = true -versionRange = "[1.19,)" +versionRange = "[1.20,)" ordering = "NONE" side = "BOTH" [[dependencies.friendsandfoes]] modId = "cloth_config" mandatory = false -versionRange = "[7,)" +versionRange = "[11,)" ordering = "NONE" side = "CLIENT" diff --git a/forge/src/main/resources/data/friendsandfoes/forge/biome_modifier/rascal.json b/forge/src/main/resources/data/friendsandfoes/forge/biome_modifier/rascal.json new file mode 100644 index 000000000..09db614fa --- /dev/null +++ b/forge/src/main/resources/data/friendsandfoes/forge/biome_modifier/rascal.json @@ -0,0 +1,11 @@ +{ + "type": "forge:add_spawns", + "biomes": "#friendsandfoes:has_rascal", + "spawners": { + "type": "friendsandfoes:rascal", + "minCount": 1, + "maxCount": 1, + "weight": 4 + }, + "category": "rascals" +} \ No newline at end of file diff --git a/forge/src/main/resources/friendsandfoes.mixins.json b/forge/src/main/resources/friendsandfoes.mixins.json index 147f95e2b..d26448435 100644 --- a/forge/src/main/resources/friendsandfoes.mixins.json +++ b/forge/src/main/resources/friendsandfoes.mixins.json @@ -7,7 +7,6 @@ "defaultRequire": 1 }, "mixins": [ - "AddCustomEntityPoseMixin", "FireBlockAccessor" ], "plugin": "com.faboslav.friendsandfoes.util.plugin.MixinExtrasPlugin" diff --git a/gradle.properties b/gradle.properties index 3d75049f5..d02a87e08 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,4 +33,4 @@ fabric_loader_version=0.14.22 fabric_api_version=0.76.1+1.19.2 # Forge https://files.minecraftforge.net/net/minecraftforge/forge/index_1.19.2.html -forge_version=1.19.2-43.2.21 +forge_version=1.19.2-43.2.21 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c02..c1962a79e 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/script/beehive/beehive.php b/script/beehive/beehive.php index 6c79c3d1e..0c6d75573 100644 --- a/script/beehive/beehive.php +++ b/script/beehive/beehive.php @@ -2,6 +2,7 @@ $types = [ 'birch', + 'bamboo', 'spruce', 'jungle', 'acacia', @@ -9,6 +10,7 @@ 'crimson', 'warped', 'mangrove', + 'cherry', ]; $blocks = [ @@ -31,6 +33,15 @@ '8a6938', '987e47', ], + 'bamboo' => [ + '907e3a', + '998741', + 'bba84c', + 'b7ab49', + 'c8b14d', + 'c2b54e', + 'd3bb50', + ], 'birch' => [ '9e8b61', 'a59467', @@ -103,6 +114,15 @@ '7f4234', '8b4d3a', ], + 'cherry' => [ + 'cd8580', + 'dd9d97', + 'e1a8a1', + 'e6b3ad', + 'e7bab4', + 'e7c2bb', + 'e7cac5' + ] ]; foreach ( $types as $type ) {