Compare commits

...

14 Commits

Author SHA1 Message Date
Kaupenjoe
54fbc3c9b8 ore generation 2023-11-03 15:01:30 +01:00
Kaupenjoe
c8c818e3a6 custom throwable projectile 2023-11-03 14:06:00 +01:00
Kaupenjoe
1953584c1d custom boats 2023-10-27 15:34:50 +02:00
Kaupenjoe
6cf30919c9 custom signs 2023-10-26 21:00:13 +02:00
Kaupenjoe
1913df4cc4 custom wood 2023-10-09 09:15:29 +02:00
Kaupenjoe
31150720f8 block entity renderer 2023-10-09 08:18:17 +02:00
Kaupenjoe
ebe192ee05 jei comapt 2023-10-08 15:44:56 +02:00
Kaupenjoe
cca4154b93 recipe types 2023-10-06 17:15:56 +02:00
Kaupenjoe
8c989e0174 block entity 2023-10-06 16:03:58 +02:00
Kaupenjoe
3a6aa1140d attack animation 2023-09-30 15:47:50 +02:00
Kaupenjoe
bfd445c5a2 custom entity 2023-09-30 15:12:27 +02:00
Kaupenjoe
3df4bc942e custom music disc 2023-08-28 16:16:51 +02:00
Kaupenjoe
23db75e368 custom sounds 2023-08-28 14:06:56 +02:00
Kaupenjoe
d59ec7e69b custom villagers 2023-08-28 12:35:56 +02:00
173 changed files with 4150 additions and 12 deletions

View File

@@ -153,6 +153,11 @@ repositories {
// flatDir {
// dir 'libs'
// }
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
}
dependencies {
@@ -169,6 +174,12 @@ dependencies {
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
// compile against the JEI API but do not include it at runtime
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}"))
// at runtime, use the full JEI jar for Forge
runtimeOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}"))
// Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
// The group id is ignored when searching -- in this case, it is "blank"

View File

@@ -38,6 +38,10 @@ mapping_channel=parchment
mapping_version=2023.06.26-1.20.1
## Dependency Properties
jei_version=15.2.0.27
## Mod Properties
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}

View File

@@ -0,0 +1,10 @@
// 1.20.1 2023-11-03T14:54:34.2017346 Registries
51c9eccab97082d42b64f544d2177b5d81ad7822 data/tutorialmod/forge/biome_modifier/add_end_sapphire_ore.json
64776d3eaf666ec57a7e039d2d4b5801202f71c5 data/tutorialmod/forge/biome_modifier/add_nether_sapphire_ore.json
6e10223d8ca98f02feea2da07585014b7a38b1e4 data/tutorialmod/forge/biome_modifier/add_sapphire_ore.json
71c606e75851b75cbba5b8f0682fcf5b5af6df8e data/tutorialmod/worldgen/configured_feature/end_sapphire_ore.json
5ad8ebc3f43d28d4e7f41e38e69091f380cde75b data/tutorialmod/worldgen/configured_feature/nether_sapphire_ore.json
3140610638959ece0452c2a069c9fa692a226df7 data/tutorialmod/worldgen/configured_feature/sapphire_ore.json
ed1b40ecc19f0d412a0e946711f16b3dd96c6c57 data/tutorialmod/worldgen/placed_feature/end_sapphire_ore_placed.json
b70fdacdec25aaea052275a8a7f26ad1ceace755 data/tutorialmod/worldgen/placed_feature/nether_sapphire_ore_placed.json
4f295d3438c738394526d339a5e7bb87f509e53c data/tutorialmod/worldgen/placed_feature/sapphire_ore_placed.json

View File

@@ -1,10 +1,17 @@
// 1.20.1 2023-08-25T20:00:29.1439601 Item Models: tutorialmod
// 1.20.1 2023-11-03T14:02:05.8529024 Item Models: tutorialmod
f746b64540daf2ab6302b3ec01a78490c48fc10b assets/tutorialmod/models/item/bar_brawl_music_disc.json
d3e9cad00ae44c9319dfbb411667eb4a09a63e57 assets/tutorialmod/models/item/catmint.json
6126e26da373f9113d9e9be875b14a0d13857444 assets/tutorialmod/models/item/corn.json
4c5c277fa6360b149d6c3ab20584fcc4450cda27 assets/tutorialmod/models/item/corn_seeds.json
798aa8856a8439e5ead445b62c2c79a11612c545 assets/tutorialmod/models/item/dice.json
93719e53df04c62d91023fe733206eb93b7aac86 assets/tutorialmod/models/item/metal_detector.json
d07710d2ac53c1f602f0c1f40f9a7d42bdb1092b assets/tutorialmod/models/item/pine_boat.json
0e6c1cfbeb70a4ffd5b097ec1a6562763b8aa577 assets/tutorialmod/models/item/pine_chest_boat.json
d56de8e6898d1c12a15eca045badafe1947aa387 assets/tutorialmod/models/item/pine_cone.json
cc52097289735fa3c312f004171f0d07f77ba56d assets/tutorialmod/models/item/pine_hanging_sign.json
b564249959d6cdff702afd910fd5e76553f9fc06 assets/tutorialmod/models/item/pine_sign.json
d24305376f58c1ef118279a5c8f5b087a07b1d47 assets/tutorialmod/models/item/raw_sapphire.json
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/tutorialmod/models/item/rhino_spawn_egg.json
0a16bffc527696b64e4304b7efccfda93e2b9422 assets/tutorialmod/models/item/sapphire.json
72e891dd0d4eeff5cd14ecf7f4740f6ba5e7017b assets/tutorialmod/models/item/sapphire_axe.json
4c7ede3e69b2d6ae39f0373cb461b96f53f14b41 assets/tutorialmod/models/item/sapphire_boots.json

View File

@@ -1,2 +1,6 @@
// 1.20.1 2023-08-07T09:00:54.5654219 Tags for minecraft:item mod id tutorialmod
// 1.20.1 2023-10-09T09:11:10.9792109 Tags for minecraft:item mod id tutorialmod
526ec127a145db02975e7ec564384fa0a5389523 data/minecraft/tags/items/creeper_drop_music_discs.json
c2b83641ed55fb63151b60b22efaa8a05b24629b data/minecraft/tags/items/logs_that_burn.json
526ec127a145db02975e7ec564384fa0a5389523 data/minecraft/tags/items/music_discs.json
6d2298526792ca18d84ed50a4b4d452e95f613e4 data/minecraft/tags/items/planks.json
2514998bb25494de346fa0d088b7e216d8165efd data/minecraft/tags/items/trimmable_armor.json

View File

@@ -1,9 +1,18 @@
// 1.20.1 2023-08-25T20:00:29.1439601 Block States: tutorialmod
// 1.20.1 2023-10-26T18:19:04.2322986 Block States: tutorialmod
4f6f6f43eb03fe4d9e5ce223f245812e0d7eae93 assets/tutorialmod/blockstates/catmint.json
d537bf85846bd7eeffa314408c867cc1a7d531d5 assets/tutorialmod/blockstates/corn_crop.json
a3ad172be3e203ff6840db063558f809a86ca15a assets/tutorialmod/blockstates/deepslate_sapphire_ore.json
890efea75d7398469e0d7d5704472303c35fae62 assets/tutorialmod/blockstates/end_stone_sapphire_ore.json
ff720ea0aea021144b8557786f6e7f9dead2fd78 assets/tutorialmod/blockstates/gem_polishing_station.json
0198f629d0db6eb40ebd91067bbe631626116b54 assets/tutorialmod/blockstates/nether_sapphire_ore.json
f948710d8934e2dc304504a928d05dd957567e3c assets/tutorialmod/blockstates/pine_hanging_sign.json
b56d75abb778cdd35622d3977f825c2693e38777 assets/tutorialmod/blockstates/pine_leaves.json
5615a2f4b8decb7e8e2bfef02d2e10cf95182e57 assets/tutorialmod/blockstates/pine_log.json
5a66e6c840d559e83f821cae22a3e48dd3785af1 assets/tutorialmod/blockstates/pine_planks.json
d0a7ce9a217fbb7bc2987645c5f4898c8d93258e assets/tutorialmod/blockstates/pine_sign.json
f948710d8934e2dc304504a928d05dd957567e3c assets/tutorialmod/blockstates/pine_wall_hanging_sign.json
d0a7ce9a217fbb7bc2987645c5f4898c8d93258e assets/tutorialmod/blockstates/pine_wall_sign.json
7f5690b866f0d2eec4954f4df7f48d210216227e assets/tutorialmod/blockstates/pine_wood.json
55ae2b8c248ffe83a87a26b6c0f87c784f9049db assets/tutorialmod/blockstates/potted_catmint.json
2f46112fe9e6610ea4c37e87e511da1849b54274 assets/tutorialmod/blockstates/raw_sapphire_block.json
d02d1f6c412fc7b220ed18e30956d68f9a29bbb3 assets/tutorialmod/blockstates/sapphire_block.json
@@ -19,6 +28,8 @@ f0189f740d5f66bdbf03bf833b7f89a0439615f8 assets/tutorialmod/blockstates/sapphire
2af36ae7d141d045a91f520bcc8da0c216bf2ccb assets/tutorialmod/blockstates/sapphire_wall.json
7e439f9c39ea91be588ddc78cf4cd903b5b9cb70 assets/tutorialmod/blockstates/sound_block.json
e7f53e64f659401806aad6003e5356aac69c0a08 assets/tutorialmod/blockstates/strawberry_crop.json
f6cd970826455b9f20c34835c56579f2cde3f2f8 assets/tutorialmod/blockstates/stripped_pine_log.json
c127412131c229accf94ac23dc4565b5039f7cf6 assets/tutorialmod/blockstates/stripped_pine_wood.json
20a742ea61b61bfcdcce006fd7b87dd9ad257a2f assets/tutorialmod/models/block/catmint.json
1052548f03dcd89a42fba5f0b6255dbb94ccc937 assets/tutorialmod/models/block/corn_stage_0.json
2c3b6838a486dcc1685dc9909d0bd7dbcdadd587 assets/tutorialmod/models/block/corn_stage_1.json
@@ -32,6 +43,14 @@ cf760df02741eab6d508ac36d3ffecdef636ce0a assets/tutorialmod/models/block/corn_st
f98cb6175399c28ce46a77b4e68664303bc2c3d3 assets/tutorialmod/models/block/deepslate_sapphire_ore.json
0c40efccb23d85e5bdf98a041a64a110359aed7c assets/tutorialmod/models/block/end_stone_sapphire_ore.json
5df59719eaf8bf42bcfeee7e2154e96a044c2703 assets/tutorialmod/models/block/nether_sapphire_ore.json
16d5376450465fabb63cdad8d3bd11bb9d9a9ce9 assets/tutorialmod/models/block/pine_hanging_sign.json
fe5a2155456cabb8f67e4afcb4a55b01fec6e87e assets/tutorialmod/models/block/pine_leaves.json
834bd48f42f632324bbdd52d47b17f5bf5bda70e assets/tutorialmod/models/block/pine_log.json
5f3487986c44906dbe95e549af4c31671a506916 assets/tutorialmod/models/block/pine_log_horizontal.json
dad917938a34a1cfbf24dedfb00622a33fe0ca39 assets/tutorialmod/models/block/pine_planks.json
16d5376450465fabb63cdad8d3bd11bb9d9a9ce9 assets/tutorialmod/models/block/pine_sign.json
429f7ef8fd5aa8b440239307ad7228404a709630 assets/tutorialmod/models/block/pine_wood.json
204ad0bc802884ab0b9a7e7c4ecbd9b87b15aaea assets/tutorialmod/models/block/pine_wood_horizontal.json
9c70f1f42c44d3c9344dfa19467f7131bc66610b assets/tutorialmod/models/block/potted_catmint.json
44cf187b6c956a3e79927dd84615b47b1bfe4ff0 assets/tutorialmod/models/block/raw_sapphire_block.json
7fbf9623622901217c1f548068b550115551eb45 assets/tutorialmod/models/block/sapphire_block.json
@@ -72,12 +91,23 @@ b6bd6b99d1b444b7f23c3ff006f58fe5db405ca1 assets/tutorialmod/models/block/strawbe
4bea81641ddb82a0a78e324c05ddb794ffcd8cb4 assets/tutorialmod/models/block/strawberry_stage3.json
d980ad62eb5f6b15090ea6557bc28483ad68f0ff assets/tutorialmod/models/block/strawberry_stage4.json
b14b9dd2aa2d96cbbb4d20f9d0741c1bf4476786 assets/tutorialmod/models/block/strawberry_stage5.json
d9f1262cb586a131f4ef9e6b15e1d052f934349c assets/tutorialmod/models/block/stripped_pine_log.json
2b4f1f0bdcad4f90690d4971294b54c6873de8c0 assets/tutorialmod/models/block/stripped_pine_log_horizontal.json
5c07883b8c76ffc56a4fde9747936c0098866c0c assets/tutorialmod/models/block/stripped_pine_wood.json
04534c445561ed2adeed241368439b9951780a3b assets/tutorialmod/models/block/stripped_pine_wood_horizontal.json
71616f74a5e0922f50c9869941f63040b82c0499 assets/tutorialmod/models/item/catmint.json
251495c94fbf35dd43cd773e6cf31533a8b72f09 assets/tutorialmod/models/item/deepslate_sapphire_ore.json
bf5cdde3dfa3effdde9c4358ecb01c39922d7945 assets/tutorialmod/models/item/end_stone_sapphire_ore.json
c6fe90ee84600fb9c1f42a398459a0d8b38fe198 assets/tutorialmod/models/item/gem_polishing_station.json
81ecae58cc575e9ce9d7f21881bbccb6bbfb4432 assets/tutorialmod/models/item/nether_sapphire_ore.json
2edec443a236a702d91b370bfa43f0dd789c7a6e assets/tutorialmod/models/item/pine_leaves.json
f8a200f45709b5a3e854d5d6885a848e58c7a355 assets/tutorialmod/models/item/pine_log.json
85005a9e827addf56424def15ec7987b034d7bf6 assets/tutorialmod/models/item/pine_planks.json
674ee7daf5f3e9a4d0fb1f75f819615a90fa1378 assets/tutorialmod/models/item/pine_wood.json
1a7f76b967a6270a0443871f08ca1a655740a97d assets/tutorialmod/models/item/potted_catmint.json
a7f864f8f8c67b25b34627c0dd8357e96b5d5c79 assets/tutorialmod/models/item/raw_sapphire_block.json
2bf7f614770184be679bb0313dc04832b7fdd577 assets/tutorialmod/models/item/sapphire_block.json
9607e08401cad098096f2d09cf41f23d6af6217a assets/tutorialmod/models/item/sapphire_ore.json
e1bcffd5dcbfb758a3668455d04d23c6efda02cf assets/tutorialmod/models/item/sound_block.json
ca27487cce3f5da1b4ea2be229b9505558ddedb1 assets/tutorialmod/models/item/stripped_pine_log.json
56b45a746bbd034511b81ff2691de0ac85a842e7 assets/tutorialmod/models/item/stripped_pine_wood.json

View File

@@ -1,9 +1,18 @@
// 1.20.1 2023-08-25T20:00:29.1418946 Loot Tables
// 1.20.1 2023-10-26T18:19:04.2302995 Loot Tables
a5308914890f4fbc6d39248caa834f368767be60 data/tutorialmod/loot_tables/blocks/catmint.json
6c9ebf0160580ee21535fe3b1a2a5cd808cacb89 data/tutorialmod/loot_tables/blocks/corn_crop.json
3655045aeb4e2ae62e9069b0db07927965a12389 data/tutorialmod/loot_tables/blocks/deepslate_sapphire_ore.json
629bc7af98fd6a08d902f9c3e46896fc09101f43 data/tutorialmod/loot_tables/blocks/end_stone_sapphire_ore.json
ae181fa3b2781be60d3127b43d33111085e53d7d data/tutorialmod/loot_tables/blocks/gem_polishing_station.json
c615daffa6bb4a20fd0f4d36534331bdbeff2746 data/tutorialmod/loot_tables/blocks/nether_sapphire_ore.json
5f94b65dcbf37334c21f047aeb09ef79fec31527 data/tutorialmod/loot_tables/blocks/pine_hanging_sign.json
abec125a87dc8cb635c88e4de835279131a17269 data/tutorialmod/loot_tables/blocks/pine_leaves.json
57ab8e1b21c0ed7823cb47210e9090f0e37ffd1a data/tutorialmod/loot_tables/blocks/pine_log.json
5e3fbaa8cb61660404a2a4449ab965d1c7940aa2 data/tutorialmod/loot_tables/blocks/pine_planks.json
77451c5f7832bb7f84de7dde5c63e7b12166b7ee data/tutorialmod/loot_tables/blocks/pine_sign.json
fb237c9790deb10ab0a5451a29e59a845a03cc05 data/tutorialmod/loot_tables/blocks/pine_wall_hanging_sign.json
c4b29231ba536f986ca20b0258504d012b6be167 data/tutorialmod/loot_tables/blocks/pine_wall_sign.json
0203579282aad7eb6c08abcf49145eec1bc33914 data/tutorialmod/loot_tables/blocks/pine_wood.json
64ba5568715cb39bbac17bf9a847cf65f79bec13 data/tutorialmod/loot_tables/blocks/potted_catmint.json
81e9322ae4c5141fd110a8f87cc92d7af008fd1e data/tutorialmod/loot_tables/blocks/raw_sapphire_block.json
d844cbb192590a5e4278fd1a5c5906e40c594e24 data/tutorialmod/loot_tables/blocks/sapphire_block.json
@@ -19,3 +28,5 @@ b28a6c67228e945ebc84f0e867152b34facd8b16 data/tutorialmod/loot_tables/blocks/sap
900d403a6e84cc3d247e16f5dcb1fcf8802436a8 data/tutorialmod/loot_tables/blocks/sapphire_wall.json
4a8cfacccc2c162b32d7ced097c65185c5c5bc88 data/tutorialmod/loot_tables/blocks/sound_block.json
1f5745e65cfe5db7b41fcdf352e1a9f3378f9874 data/tutorialmod/loot_tables/blocks/strawberry_crop.json
8f124ad7aafb89b6a6bac5f235a72348c85ef7f5 data/tutorialmod/loot_tables/blocks/stripped_pine_log.json
c8e86fd6e644f2c0abfad143c43bbc294422c416 data/tutorialmod/loot_tables/blocks/stripped_pine_wood.json

View File

@@ -1,11 +1,13 @@
// 1.20.1 2023-08-07T08:23:43.2856618 Tags for minecraft:block mod id tutorialmod
// 1.20.1 2023-10-09T09:11:10.9781945 Tags for minecraft:block mod id tutorialmod
f7d4d746a89ba9704d89651d20d3b89098acdabd data/forge/tags/blocks/needs_netherite_tool.json
eb9c3bd4f434cd2ee198618689887868a03fc824 data/minecraft/tags/blocks/fences.json
0f23036eb868569b86c1fbde92de4c816b9df411 data/minecraft/tags/blocks/fence_gates.json
c2b83641ed55fb63151b60b22efaa8a05b24629b data/minecraft/tags/blocks/logs_that_burn.json
2c39ba5cecb79889f7925f62f972246a014552c8 data/minecraft/tags/blocks/mineable/pickaxe.json
b3dcb63d0640cd401308394400173ca7cb485665 data/minecraft/tags/blocks/needs_diamond_tool.json
025f458e5a24d4a0256cb9712e83d703d819dfdb data/minecraft/tags/blocks/needs_iron_tool.json
3a36f7f5f9de0d3325f1f444b84aa41eedfac5fc data/minecraft/tags/blocks/needs_stone_tool.json
6d2298526792ca18d84ed50a4b4d452e95f613e4 data/minecraft/tags/blocks/planks.json
39afac99ef2666de5a9686ccfc15e6f7611922c8 data/minecraft/tags/blocks/walls.json
031ec7111c8b7c57f798acd0b3605ceb1912498b data/tutorialmod/tags/blocks/metal_detector_valuables.json
047901bdc4a4ba4a4f71e4ed5689a158c75088e3 data/tutorialmod/tags/blocks/needs_sapphire_tool.json

View File

@@ -0,0 +1,2 @@
// 1.20.1 2023-08-28T12:32:21.1985044 Tags for minecraft:point_of_interest_type mod id tutorialmod
83f1c4f1a14965cf8c4c3a99edb0f816c3115ee6 data/minecraft/tags/point_of_interest_type/acquirable_job_site.json

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/gem_polishing_station"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/pine_hanging_sign"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/pine_leaves"
}
}
}

View File

@@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "tutorialmod:block/pine_log_horizontal",
"x": 90,
"y": 90
},
"axis=y": {
"model": "tutorialmod:block/pine_log"
},
"axis=z": {
"model": "tutorialmod:block/pine_log_horizontal",
"x": 90
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/pine_planks"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/pine_sign"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/pine_hanging_sign"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/pine_sign"
}
}
}

View File

@@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "tutorialmod:block/pine_wood_horizontal",
"x": 90,
"y": 90
},
"axis=y": {
"model": "tutorialmod:block/pine_wood"
},
"axis=z": {
"model": "tutorialmod:block/pine_wood_horizontal",
"x": 90
}
}
}

View File

@@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "tutorialmod:block/stripped_pine_log_horizontal",
"x": 90,
"y": 90
},
"axis=y": {
"model": "tutorialmod:block/stripped_pine_log"
},
"axis=z": {
"model": "tutorialmod:block/stripped_pine_log_horizontal",
"x": 90
}
}
}

View File

@@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "tutorialmod:block/stripped_pine_wood_horizontal",
"x": 90,
"y": 90
},
"axis=y": {
"model": "tutorialmod:block/stripped_pine_wood"
},
"axis=z": {
"model": "tutorialmod:block/stripped_pine_wood_horizontal",
"x": 90
}
}
}

View File

@@ -0,0 +1,5 @@
{
"textures": {
"particle": "tutorialmod:block/pine_planks"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/leaves",
"render_type": "minecraft:cutout",
"textures": {
"all": "tutorialmod:block/pine_leaves"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "tutorialmod:block/pine_log_top",
"side": "tutorialmod:block/pine_log"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column_horizontal",
"textures": {
"end": "tutorialmod:block/pine_log_top",
"side": "tutorialmod:block/pine_log"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "tutorialmod:block/pine_planks"
}
}

View File

@@ -0,0 +1,5 @@
{
"textures": {
"particle": "tutorialmod:block/pine_planks"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "tutorialmod:block/pine_log",
"side": "tutorialmod:block/pine_log"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column_horizontal",
"textures": {
"end": "tutorialmod:block/pine_log",
"side": "tutorialmod:block/pine_log"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "tutorialmod:block/stripped_pine_log_top",
"side": "tutorialmod:block/stripped_pine_log"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column_horizontal",
"textures": {
"end": "tutorialmod:block/stripped_pine_log_top",
"side": "tutorialmod:block/stripped_pine_log"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "tutorialmod:block/stripped_pine_log",
"side": "tutorialmod:block/stripped_pine_log"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column_horizontal",
"textures": {
"end": "tutorialmod:block/stripped_pine_log",
"side": "tutorialmod:block/stripped_pine_log"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tutorialmod:item/bar_brawl_music_disc"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tutorialmod:item/dice"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/gem_polishing_station"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tutorialmod:item/pine_boat"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tutorialmod:item/pine_chest_boat"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tutorialmod:item/pine_hanging_sign"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/pine_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/pine_log"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/pine_planks"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tutorialmod:item/pine_sign"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/pine_wood"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/template_spawn_egg"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/stripped_pine_log"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/stripped_pine_wood"
}

View File

@@ -0,0 +1,8 @@
{
"values": [
"tutorialmod:pine_log",
"tutorialmod:pine_wood",
"tutorialmod:stripped_pine_log",
"tutorialmod:stripped_pine_wood"
]
}

View File

@@ -0,0 +1,5 @@
{
"values": [
"tutorialmod:pine_planks"
]
}

View File

@@ -0,0 +1,5 @@
{
"values": [
"tutorialmod:bar_brawl_music_disc"
]
}

View File

@@ -0,0 +1,8 @@
{
"values": [
"tutorialmod:pine_log",
"tutorialmod:pine_wood",
"tutorialmod:stripped_pine_log",
"tutorialmod:stripped_pine_wood"
]
}

View File

@@ -0,0 +1,5 @@
{
"values": [
"tutorialmod:bar_brawl_music_disc"
]
}

View File

@@ -0,0 +1,5 @@
{
"values": [
"tutorialmod:pine_planks"
]
}

View File

@@ -0,0 +1,8 @@
{
"values": [
{
"id": "tutorialmod:sound_poi",
"required": false
}
]
}

View File

@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_end",
"features": "tutorialmod:end_sapphire_ore_placed",
"step": "underground_ores"
}

View File

@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_nether",
"features": "tutorialmod:nether_sapphire_ore_placed",
"step": "underground_ores"
}

View File

@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "tutorialmod:sapphire_ore_placed",
"step": "underground_ores"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:gem_polishing_station"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/gem_polishing_station"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:pine_hanging_sign"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_hanging_sign"
}

View File

@@ -0,0 +1,136 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
],
"name": "tutorialmod:pine_leaves"
},
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:survives_explosion"
},
{
"chances": [
0.05,
0.0625,
0.083333336,
0.1
],
"condition": "minecraft:table_bonus",
"enchantment": "minecraft:fortune"
}
],
"name": "tutorialmod:sapphire_block"
}
]
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"chances": [
0.02,
0.022222223,
0.025,
0.033333335,
0.1
],
"condition": "minecraft:table_bonus",
"enchantment": "minecraft:fortune"
}
],
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 2.0,
"min": 1.0
},
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minecraft:stick"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_leaves"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:pine_log"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_log"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:pine_planks"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_planks"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:pine_sign"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_sign"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:pine_hanging_sign"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_wall_hanging_sign"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:pine_sign"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_wall_sign"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:pine_wood"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/pine_wood"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:stripped_pine_log"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/stripped_pine_log"
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:stripped_pine_wood"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/stripped_pine_wood"
}

View File

@@ -0,0 +1,18 @@
{
"type": "minecraft:ore",
"config": {
"discard_chance_on_air_exposure": 0.0,
"size": 9,
"targets": [
{
"state": {
"Name": "tutorialmod:end_stone_sapphire_ore"
},
"target": {
"block": "minecraft:end_stone",
"predicate_type": "minecraft:block_match"
}
}
]
}
}

View File

@@ -0,0 +1,18 @@
{
"type": "minecraft:ore",
"config": {
"discard_chance_on_air_exposure": 0.0,
"size": 9,
"targets": [
{
"state": {
"Name": "tutorialmod:nether_sapphire_ore"
},
"target": {
"block": "minecraft:netherrack",
"predicate_type": "minecraft:block_match"
}
}
]
}
}

View File

@@ -0,0 +1,27 @@
{
"type": "minecraft:ore",
"config": {
"discard_chance_on_air_exposure": 0.0,
"size": 9,
"targets": [
{
"state": {
"Name": "tutorialmod:sapphire_ore"
},
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:stone_ore_replaceables"
}
},
{
"state": {
"Name": "tutorialmod:deepslate_sapphire_ore"
},
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:deepslate_ore_replaceables"
}
}
]
}
}

View File

@@ -0,0 +1,27 @@
{
"feature": "tutorialmod:end_sapphire_ore",
"placement": [
{
"type": "minecraft:count",
"count": 12
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:uniform",
"max_inclusive": {
"absolute": 80
},
"min_inclusive": {
"absolute": -64
}
}
},
{
"type": "minecraft:biome"
}
]
}

View File

@@ -0,0 +1,27 @@
{
"feature": "tutorialmod:nether_sapphire_ore",
"placement": [
{
"type": "minecraft:count",
"count": 12
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:uniform",
"max_inclusive": {
"absolute": 80
},
"min_inclusive": {
"absolute": -64
}
}
},
{
"type": "minecraft:biome"
}
]
}

View File

@@ -0,0 +1,27 @@
{
"feature": "tutorialmod:sapphire_ore",
"placement": [
{
"type": "minecraft:count",
"count": 12
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:uniform",
"max_inclusive": {
"absolute": 80
},
"min_inclusive": {
"absolute": -64
}
}
},
{
"type": "minecraft:biome"
}
]
}

View File

@@ -2,9 +2,25 @@ package net.kaupenjoe.tutorialmod;
import com.mojang.logging.LogUtils;
import net.kaupenjoe.tutorialmod.block.ModBlocks;
import net.kaupenjoe.tutorialmod.block.entity.ModBlockEntities;
import net.kaupenjoe.tutorialmod.entity.ModEntities;
import net.kaupenjoe.tutorialmod.entity.client.ModBoatRenderer;
import net.kaupenjoe.tutorialmod.entity.client.RhinoRenderer;
import net.kaupenjoe.tutorialmod.item.ModCreativeModTabs;
import net.kaupenjoe.tutorialmod.item.ModItems;
import net.kaupenjoe.tutorialmod.loot.ModLootModifiers;
import net.kaupenjoe.tutorialmod.recipe.ModRecipes;
import net.kaupenjoe.tutorialmod.screen.GemPolishingStationScreen;
import net.kaupenjoe.tutorialmod.screen.ModMenuTypes;
import net.kaupenjoe.tutorialmod.sound.ModSounds;
import net.kaupenjoe.tutorialmod.util.ModWoodTypes;
import net.kaupenjoe.tutorialmod.villager.ModVillagers;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.renderer.Sheets;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraft.client.renderer.entity.ThrownItemRenderer;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.FlowerPotBlock;
@@ -35,6 +51,15 @@ public class TutorialMod {
ModBlocks.register(modEventBus);
ModLootModifiers.register(modEventBus);
ModVillagers.register(modEventBus);
ModSounds.register(modEventBus);
ModEntities.register(modEventBus);
ModBlockEntities.register(modEventBus);
ModMenuTypes.register(modEventBus);
ModRecipes.register(modEventBus);
modEventBus.addListener(this::commonSetup);
@@ -66,7 +91,15 @@ public class TutorialMod {
public static class ClientModEvents {
@SubscribeEvent
public static void onClientSetup(FMLClientSetupEvent event) {
Sheets.addWoodType(ModWoodTypes.PINE);
EntityRenderers.register(ModEntities.RHINO.get(), RhinoRenderer::new);
EntityRenderers.register(ModEntities.MOD_BOAT.get(), pContext -> new ModBoatRenderer(pContext, false));
EntityRenderers.register(ModEntities.MOD_CHEST_BOAT.get(), pContext -> new ModBoatRenderer(pContext, true));
EntityRenderers.register(ModEntities.DICE_PROJECTILE.get(), ThrownItemRenderer::new);
MenuScreens.register(ModMenuTypes.GEM_POLISHING_MENU.get(), GemPolishingStationScreen::new);
}
}
}

View File

@@ -1,17 +1,21 @@
package net.kaupenjoe.tutorialmod.block;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.block.custom.CornCropBlock;
import net.kaupenjoe.tutorialmod.block.custom.SoundBlock;
import net.kaupenjoe.tutorialmod.block.custom.StrawberryCropBlock;
import net.kaupenjoe.tutorialmod.block.custom.*;
import net.kaupenjoe.tutorialmod.item.ModItems;
import net.kaupenjoe.tutorialmod.sound.ModSounds;
import net.kaupenjoe.tutorialmod.util.ModWoodTypes;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockSetType;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
@@ -43,7 +47,7 @@ public class ModBlocks {
.strength(5f).requiresCorrectToolForDrops(), UniformInt.of(3, 7)));
public static final RegistryObject<Block> SOUND_BLOCK = registerBlock("sound_block",
() -> new SoundBlock(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK)));
() -> new SoundBlock(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK).sound(ModSounds.SOUND_BLOCK_SOUNDS)));
public static final RegistryObject<Block> SAPPHIRE_STAIRS = registerBlock("sapphire_stairs",
() -> new StairBlock(() -> ModBlocks.SAPPHIRE_BLOCK.get().defaultBlockState(),
@@ -86,6 +90,69 @@ public class ModBlocks {
BlockBehaviour.Properties.copy(Blocks.POTTED_ALLIUM).noOcclusion()));
public static final RegistryObject<Block> GEM_POLISHING_STATION = registerBlock("gem_polishing_station",
() -> new GemPolishingStationBlock(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK).noOcclusion()));
public static final RegistryObject<Block> PINE_LOG = registerBlock("pine_log",
() -> new ModFlammableRotatedPillarBlock(BlockBehaviour.Properties.copy(Blocks.OAK_LOG).strength(3f)));
public static final RegistryObject<Block> PINE_WOOD = registerBlock("pine_wood",
() -> new ModFlammableRotatedPillarBlock(BlockBehaviour.Properties.copy(Blocks.OAK_WOOD).strength(3f)));
public static final RegistryObject<Block> STRIPPED_PINE_LOG = registerBlock("stripped_pine_log",
() -> new ModFlammableRotatedPillarBlock(BlockBehaviour.Properties.copy(Blocks.STRIPPED_OAK_LOG).strength(3f)));
public static final RegistryObject<Block> STRIPPED_PINE_WOOD = registerBlock("stripped_pine_wood",
() -> new ModFlammableRotatedPillarBlock(BlockBehaviour.Properties.copy(Blocks.STRIPPED_OAK_WOOD).strength(3f)));
public static final RegistryObject<Block> PINE_PLANKS = registerBlock("pine_planks",
() -> new Block(BlockBehaviour.Properties.copy(Blocks.OAK_PLANKS)) {
@Override
public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return true;
}
@Override
public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return 20;
}
@Override
public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return 5;
}
});
public static final RegistryObject<Block> PINE_LEAVES = registerBlock("pine_leaves",
() -> new LeavesBlock(BlockBehaviour.Properties.copy(Blocks.OAK_LEAVES)){
@Override
public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return true;
}
@Override
public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return 60;
}
@Override
public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return 30;
}
});
public static final RegistryObject<Block> PINE_SIGN = BLOCKS.register("pine_sign",
() -> new ModStandingSignBlock(BlockBehaviour.Properties.copy(Blocks.OAK_SIGN), ModWoodTypes.PINE));
public static final RegistryObject<Block> PINE_WALL_SIGN = BLOCKS.register("pine_wall_sign",
() -> new ModWallSignBlock(BlockBehaviour.Properties.copy(Blocks.OAK_WALL_SIGN), ModWoodTypes.PINE));
public static final RegistryObject<Block> PINE_HANGING_SIGN = BLOCKS.register("pine_hanging_sign",
() -> new ModHangingSignBlock(BlockBehaviour.Properties.copy(Blocks.OAK_HANGING_SIGN), ModWoodTypes.PINE));
public static final RegistryObject<Block> PINE_WALL_HANGING_SIGN = BLOCKS.register("pine_wall_hanging_sign",
() -> new ModWallHangingSignBlock(BlockBehaviour.Properties.copy(Blocks.OAK_WALL_HANGING_SIGN), ModWoodTypes.PINE));
public static final RegistryObject<Block> DICE_BLOCK = BLOCKS.register("dice_block",
() -> new DiceBlock(BlockBehaviour.Properties.copy(Blocks.STONE).noLootTable()));
private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) {
RegistryObject<T> toReturn = BLOCKS.register(name, block);
registerBlockItem(name, toReturn);

View File

@@ -0,0 +1,52 @@
package net.kaupenjoe.tutorialmod.block.custom;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import org.jetbrains.annotations.Nullable;
public class DiceBlock extends Block {
public static DirectionProperty FACING = DirectionProperty.create("number",
Direction.UP,
Direction.NORTH,
Direction.EAST,
Direction.SOUTH,
Direction.WEST,
Direction.DOWN);
public DiceBlock(Properties properties) {
super(properties);
}
@Nullable
@Override
public BlockState getStateForPlacement(BlockPlaceContext placeContext) {
return this.defaultBlockState().setValue(FACING, getRandomDirection());
}
public BlockState getRandomBlockState() {
return this.defaultBlockState().setValue(FACING, getRandomDirection());
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
private Direction getRandomDirection() {
Direction[] dirs = new Direction[] {
Direction.UP,
Direction.NORTH,
Direction.EAST,
Direction.SOUTH,
Direction.WEST,
Direction.DOWN
};
return dirs[RandomSource.create().nextIntBetweenInclusive(0, dirs.length-1)];
}
}

View File

@@ -0,0 +1,84 @@
package net.kaupenjoe.tutorialmod.block.custom;
import net.kaupenjoe.tutorialmod.block.entity.GemPolishingStationBlockEntity;
import net.kaupenjoe.tutorialmod.block.entity.ModBlockEntities;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.network.NetworkHooks;
import org.jetbrains.annotations.Nullable;
public class GemPolishingStationBlock extends BaseEntityBlock {
public static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 12, 16);
public GemPolishingStationBlock(Properties pProperties) {
super(pProperties);
}
@Override
public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) {
return SHAPE;
}
@Override
public RenderShape getRenderShape(BlockState pState) {
return RenderShape.MODEL;
}
@Override
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) {
if (pState.getBlock() != pNewState.getBlock()) {
BlockEntity blockEntity = pLevel.getBlockEntity(pPos);
if (blockEntity instanceof GemPolishingStationBlockEntity) {
((GemPolishingStationBlockEntity) blockEntity).drops();
}
}
super.onRemove(pState, pLevel, pPos, pNewState, pIsMoving);
}
@Override
public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHit) {
if (!pLevel.isClientSide()) {
BlockEntity entity = pLevel.getBlockEntity(pPos);
if(entity instanceof GemPolishingStationBlockEntity) {
NetworkHooks.openScreen(((ServerPlayer)pPlayer), (GemPolishingStationBlockEntity)entity, pPos);
} else {
throw new IllegalStateException("Our Container provider is missing!");
}
}
return InteractionResult.sidedSuccess(pLevel.isClientSide());
}
@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return new GemPolishingStationBlockEntity(pPos, pState);
}
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level pLevel, BlockState pState, BlockEntityType<T> pBlockEntityType) {
if(pLevel.isClientSide()) {
return null;
}
return createTickerHelper(pBlockEntityType, ModBlockEntities.GEM_POLISHING_BE.get(),
(pLevel1, pPos, pState1, pBlockEntity) -> pBlockEntity.tick(pLevel1, pPos, pState1));
}
}

View File

@@ -0,0 +1,49 @@
package net.kaupenjoe.tutorialmod.block.custom;
import net.kaupenjoe.tutorialmod.block.ModBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.RotatedPillarBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.ToolAction;
import org.checkerframework.checker.units.qual.A;
import org.jetbrains.annotations.Nullable;
public class ModFlammableRotatedPillarBlock extends RotatedPillarBlock {
public ModFlammableRotatedPillarBlock(Properties pProperties) {
super(pProperties);
}
@Override
public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return true;
}
@Override
public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return 5;
}
@Override
public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return 5;
}
@Override
public @Nullable BlockState getToolModifiedState(BlockState state, UseOnContext context, ToolAction toolAction, boolean simulate) {
if(context.getItemInHand().getItem() instanceof AxeItem) {
if(state.is(ModBlocks.PINE_LOG.get())) {
return ModBlocks.STRIPPED_PINE_LOG.get().defaultBlockState().setValue(AXIS, state.getValue(AXIS));
}
if(state.is(ModBlocks.PINE_WOOD.get())) {
return ModBlocks.STRIPPED_PINE_WOOD.get().defaultBlockState().setValue(AXIS, state.getValue(AXIS));
}
}
return super.getToolModifiedState(state, context, toolAction, simulate);
}
}

View File

@@ -0,0 +1,19 @@
package net.kaupenjoe.tutorialmod.block.custom;
import net.kaupenjoe.tutorialmod.block.entity.ModHangingSignBlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.CeilingHangingSignBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.WoodType;
public class ModHangingSignBlock extends CeilingHangingSignBlock {
public ModHangingSignBlock(Properties pProperties, WoodType pType) {
super(pProperties, pType);
}
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return new ModHangingSignBlockEntity(pPos, pState);
}
}

View File

@@ -0,0 +1,19 @@
package net.kaupenjoe.tutorialmod.block.custom;
import net.kaupenjoe.tutorialmod.block.entity.ModSignBlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.StandingSignBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.WoodType;
public class ModStandingSignBlock extends StandingSignBlock {
public ModStandingSignBlock(Properties pProperties, WoodType pType) {
super(pProperties, pType);
}
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return new ModSignBlockEntity(pPos, pState);
}
}

View File

@@ -0,0 +1,19 @@
package net.kaupenjoe.tutorialmod.block.custom;
import net.kaupenjoe.tutorialmod.block.entity.ModHangingSignBlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.WallHangingSignBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.WoodType;
public class ModWallHangingSignBlock extends WallHangingSignBlock {
public ModWallHangingSignBlock(Properties pProperties, WoodType pType) {
super(pProperties, pType);
}
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return new ModHangingSignBlockEntity(pPos, pState);
}
}

View File

@@ -0,0 +1,19 @@
package net.kaupenjoe.tutorialmod.block.custom;
import net.kaupenjoe.tutorialmod.block.entity.ModSignBlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.WallSignBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.WoodType;
public class ModWallSignBlock extends WallSignBlock {
public ModWallSignBlock(Properties pProperties, WoodType pType) {
super(pProperties, pType);
}
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return new ModSignBlockEntity(pPos, pState);
}
}

View File

@@ -0,0 +1,221 @@
package net.kaupenjoe.tutorialmod.block.entity;
import net.kaupenjoe.tutorialmod.item.ModItems;
import net.kaupenjoe.tutorialmod.recipe.GemPolishingRecipe;
import net.kaupenjoe.tutorialmod.screen.GemPolishingStationMenu;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
import net.minecraft.world.Container;
import net.minecraft.world.Containers;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.ContainerData;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
public class GemPolishingStationBlockEntity extends BlockEntity implements MenuProvider {
private final ItemStackHandler itemHandler = new ItemStackHandler(2) {
@Override
protected void onContentsChanged(int slot) {
setChanged();
if(!level.isClientSide()) {
level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), 3);
}
}
};
private static final int INPUT_SLOT = 0;
private static final int OUTPUT_SLOT = 1;
private LazyOptional<IItemHandler> lazyItemHandler = LazyOptional.empty();
protected final ContainerData data;
private int progress = 0;
private int maxProgress = 78;
public GemPolishingStationBlockEntity(BlockPos pPos, BlockState pBlockState) {
super(ModBlockEntities.GEM_POLISHING_BE.get(), pPos, pBlockState);
this.data = new ContainerData() {
@Override
public int get(int pIndex) {
return switch (pIndex) {
case 0 -> GemPolishingStationBlockEntity.this.progress;
case 1 -> GemPolishingStationBlockEntity.this.maxProgress;
default -> 0;
};
}
@Override
public void set(int pIndex, int pValue) {
switch (pIndex) {
case 0 -> GemPolishingStationBlockEntity.this.progress = pValue;
case 1 -> GemPolishingStationBlockEntity.this.maxProgress = pValue;
}
}
@Override
public int getCount() {
return 2;
}
};
}
public ItemStack getRenderStack() {
if(itemHandler.getStackInSlot(OUTPUT_SLOT).isEmpty()) {
return itemHandler.getStackInSlot(INPUT_SLOT);
} else {
return itemHandler.getStackInSlot(OUTPUT_SLOT);
}
}
@Override
public @NotNull <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) {
if(cap == ForgeCapabilities.ITEM_HANDLER) {
return lazyItemHandler.cast();
}
return super.getCapability(cap, side);
}
@Override
public void onLoad() {
super.onLoad();
lazyItemHandler = LazyOptional.of(() -> itemHandler);
}
@Override
public void invalidateCaps() {
super.invalidateCaps();
lazyItemHandler.invalidate();
}
public void drops() {
SimpleContainer inventory = new SimpleContainer(itemHandler.getSlots());
for(int i = 0; i < itemHandler.getSlots(); i++) {
inventory.setItem(i, itemHandler.getStackInSlot(i));
}
Containers.dropContents(this.level, this.worldPosition, inventory);
}
@Override
public Component getDisplayName() {
return Component.translatable("block.tutorialmod.gem_polishing_station");
}
@Nullable
@Override
public AbstractContainerMenu createMenu(int pContainerId, Inventory pPlayerInventory, Player pPlayer) {
return new GemPolishingStationMenu(pContainerId, pPlayerInventory, this, this.data);
}
@Override
protected void saveAdditional(CompoundTag pTag) {
pTag.put("inventory", itemHandler.serializeNBT());
pTag.putInt("gem_polishing_station.progress", progress);
super.saveAdditional(pTag);
}
@Override
public void load(CompoundTag pTag) {
super.load(pTag);
itemHandler.deserializeNBT(pTag.getCompound("inventory"));
progress = pTag.getInt("gem_polishing_station.progress");
}
public void tick(Level pLevel, BlockPos pPos, BlockState pState) {
if(hasRecipe()) {
increaseCraftingProgress();
setChanged(pLevel, pPos, pState);
if(hasProgressFinished()) {
craftItem();
resetProgress();
}
} else {
resetProgress();
}
}
private void resetProgress() {
progress = 0;
}
private void craftItem() {
Optional<GemPolishingRecipe> recipe = getCurrentRecipe();
ItemStack result = recipe.get().getResultItem(null);
this.itemHandler.extractItem(INPUT_SLOT, 1, false);
this.itemHandler.setStackInSlot(OUTPUT_SLOT, new ItemStack(result.getItem(),
this.itemHandler.getStackInSlot(OUTPUT_SLOT).getCount() + result.getCount()));
}
private boolean hasRecipe() {
Optional<GemPolishingRecipe> recipe = getCurrentRecipe();
if(recipe.isEmpty()) {
return false;
}
ItemStack result = recipe.get().getResultItem(getLevel().registryAccess());
return canInsertAmountIntoOutputSlot(result.getCount()) && canInsertItemIntoOutputSlot(result.getItem());
}
private Optional<GemPolishingRecipe> getCurrentRecipe() {
SimpleContainer inventory = new SimpleContainer(this.itemHandler.getSlots());
for(int i = 0; i < itemHandler.getSlots(); i++) {
inventory.setItem(i, this.itemHandler.getStackInSlot(i));
}
return this.level.getRecipeManager().getRecipeFor(GemPolishingRecipe.Type.INSTANCE, inventory, level);
}
private boolean canInsertItemIntoOutputSlot(Item item) {
return this.itemHandler.getStackInSlot(OUTPUT_SLOT).isEmpty() || this.itemHandler.getStackInSlot(OUTPUT_SLOT).is(item);
}
private boolean canInsertAmountIntoOutputSlot(int count) {
return this.itemHandler.getStackInSlot(OUTPUT_SLOT).getCount() + count <= this.itemHandler.getStackInSlot(OUTPUT_SLOT).getMaxStackSize();
}
private boolean hasProgressFinished() {
return progress >= maxProgress;
}
private void increaseCraftingProgress() {
progress++;
}
@Nullable
@Override
public Packet<ClientGamePacketListener> getUpdatePacket() {
return ClientboundBlockEntityDataPacket.create(this);
}
@Override
public CompoundTag getUpdateTag() {
return saveWithoutMetadata();
}
}

View File

@@ -0,0 +1,35 @@
package net.kaupenjoe.tutorialmod.block.entity;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.block.ModBlocks;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class ModBlockEntities {
public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITIES =
DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, TutorialMod.MOD_ID);
public static final RegistryObject<BlockEntityType<GemPolishingStationBlockEntity>> GEM_POLISHING_BE =
BLOCK_ENTITIES.register("gem_polishing_be", () ->
BlockEntityType.Builder.of(GemPolishingStationBlockEntity::new,
ModBlocks.GEM_POLISHING_STATION.get()).build(null));
public static final RegistryObject<BlockEntityType<ModSignBlockEntity>> MOD_SIGN =
BLOCK_ENTITIES.register("mod_sign", () ->
BlockEntityType.Builder.of(ModSignBlockEntity::new,
ModBlocks.PINE_SIGN.get(), ModBlocks.PINE_WALL_SIGN.get()).build(null));
public static final RegistryObject<BlockEntityType<ModHangingSignBlockEntity>> MOD_HANGING_SIGN =
BLOCK_ENTITIES.register("mod_hanging_sign", () ->
BlockEntityType.Builder.of(ModHangingSignBlockEntity::new,
ModBlocks.PINE_HANGING_SIGN.get(), ModBlocks.PINE_WALL_HANGING_SIGN.get()).build(null));
public static void register(IEventBus eventBus) {
BLOCK_ENTITIES.register(eventBus);
}
}

View File

@@ -0,0 +1,17 @@
package net.kaupenjoe.tutorialmod.block.entity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
public class ModHangingSignBlockEntity extends SignBlockEntity {
public ModHangingSignBlockEntity(BlockPos pPos, BlockState pBlockState) {
super(ModBlockEntities.MOD_HANGING_SIGN.get(), pPos, pBlockState);
}
@Override
public BlockEntityType<?> getType() {
return ModBlockEntities.MOD_HANGING_SIGN.get();
}
}

View File

@@ -0,0 +1,17 @@
package net.kaupenjoe.tutorialmod.block.entity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
public class ModSignBlockEntity extends SignBlockEntity {
public ModSignBlockEntity(BlockPos pPos, BlockState pBlockState) {
super(ModBlockEntities.MOD_SIGN.get(), pPos, pBlockState);
}
@Override
public BlockEntityType<?> getType() {
return ModBlockEntities.MOD_SIGN.get();
}
}

View File

@@ -0,0 +1,45 @@
package net.kaupenjoe.tutorialmod.block.entity.renderer;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.kaupenjoe.tutorialmod.block.entity.GemPolishingStationBlockEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LightLayer;
public class GemPolishingBlockEntityRenderer implements BlockEntityRenderer<GemPolishingStationBlockEntity> {
public GemPolishingBlockEntityRenderer(BlockEntityRendererProvider.Context context) {
}
@Override
public void render(GemPolishingStationBlockEntity pBlockEntity, float pPartialTick, PoseStack pPoseStack,
MultiBufferSource pBuffer, int pPackedLight, int pPackedOverlay) {
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
ItemStack itemStack = pBlockEntity.getRenderStack();
pPoseStack.pushPose();
pPoseStack.translate(0.5f, 0.75f, 0.5f);
pPoseStack.scale(0.35f, 0.35f, 0.35f);
pPoseStack.mulPose(Axis.XP.rotationDegrees(270));
itemRenderer.renderStatic(itemStack, ItemDisplayContext.FIXED, getLightLevel(pBlockEntity.getLevel(), pBlockEntity.getBlockPos()),
OverlayTexture.NO_OVERLAY, pPoseStack, pBuffer, pBlockEntity.getLevel(), 1);
pPoseStack.popPose();
}
private int getLightLevel(Level level, BlockPos pos) {
int bLight = level.getBrightness(LightLayer.BLOCK, pos);
int sLight = level.getBrightness(LightLayer.SKY, pos);
return LightTexture.pack(bLight, sLight);
}
}

View File

@@ -0,0 +1,60 @@
package net.kaupenjoe.tutorialmod.compat;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.recipe.IFocusGroup;
import mezz.jei.api.recipe.RecipeIngredientRole;
import mezz.jei.api.recipe.RecipeType;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.block.ModBlocks;
import net.kaupenjoe.tutorialmod.recipe.GemPolishingRecipe;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
public class GemPolishingCategory implements IRecipeCategory<GemPolishingRecipe> {
public static final ResourceLocation UID = new ResourceLocation(TutorialMod.MOD_ID, "gem_polishing");
public static final ResourceLocation TEXTURE = new ResourceLocation(TutorialMod.MOD_ID,
"textures/gui/gem_polishing_station_gui.png");
public static final RecipeType<GemPolishingRecipe> GEM_POLISHING_TYPE =
new RecipeType<>(UID, GemPolishingRecipe.class);
private final IDrawable background;
private final IDrawable icon;
public GemPolishingCategory(IGuiHelper helper) {
this.background = helper.createDrawable(TEXTURE, 0, 0, 176, 85);
this.icon = helper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(ModBlocks.GEM_POLISHING_STATION.get()));
}
@Override
public RecipeType<GemPolishingRecipe> getRecipeType() {
return GEM_POLISHING_TYPE;
}
@Override
public Component getTitle() {
return Component.translatable("block.tutorialmod.gem_polishing_station");
}
@Override
public IDrawable getBackground() {
return this.background;
}
@Override
public IDrawable getIcon() {
return this.icon;
}
@Override
public void setRecipe(IRecipeLayoutBuilder builder, GemPolishingRecipe recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.INPUT, 80, 11).addIngredients(recipe.getIngredients().get(0));
builder.addSlot(RecipeIngredientRole.OUTPUT, 80, 59).addItemStack(recipe.getResultItem(null));
}
}

View File

@@ -0,0 +1,42 @@
package net.kaupenjoe.tutorialmod.compat;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.IRecipeCategoryRegistration;
import mezz.jei.api.registration.IRecipeRegistration;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.recipe.GemPolishingRecipe;
import net.kaupenjoe.tutorialmod.screen.GemPolishingStationScreen;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeManager;
import java.util.List;
@JeiPlugin
public class JEITutorialModPlugin implements IModPlugin {
@Override
public ResourceLocation getPluginUid() {
return new ResourceLocation(TutorialMod.MOD_ID, "jei_plugin");
}
@Override
public void registerCategories(IRecipeCategoryRegistration registration) {
registration.addRecipeCategories(new GemPolishingCategory(registration.getJeiHelpers().getGuiHelper()));
}
@Override
public void registerRecipes(IRecipeRegistration registration) {
RecipeManager recipeManager = Minecraft.getInstance().level.getRecipeManager();
List<GemPolishingRecipe> polishingRecipes = recipeManager.getAllRecipesFor(GemPolishingRecipe.Type.INSTANCE);
registration.addRecipes(GemPolishingCategory.GEM_POLISHING_TYPE, polishingRecipes);
}
@Override
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
registration.addRecipeClickArea(GemPolishingStationScreen.class, 60, 30, 20, 30,
GemPolishingCategory.GEM_POLISHING_TYPE);
}
}

View File

@@ -31,5 +31,8 @@ public class DataGenerators {
generator.addProvider(event.includeServer(), new ModItemTagGenerator(packOutput, lookupProvider, blockTagGenerator.contentsGetter(), existingFileHelper));
generator.addProvider(event.includeServer(), new ModGlobalLootModifiersProvider(packOutput));
generator.addProvider(event.includeServer(), new ModPoiTypeTagsProvider(packOutput, lookupProvider, existingFileHelper));
generator.addProvider(event.includeServer(), new ModWorldGenProvider(packOutput, lookupProvider));
}
}

View File

@@ -4,13 +4,16 @@ import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.block.ModBlocks;
import net.kaupenjoe.tutorialmod.block.custom.CornCropBlock;
import net.kaupenjoe.tutorialmod.block.custom.StrawberryCropBlock;
import net.minecraft.client.model.Model;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.generators.BlockStateProvider;
import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import java.util.function.Function;
@@ -52,8 +55,61 @@ public class ModBlockStateProvider extends BlockStateProvider {
blockTexture(ModBlocks.CATMINT.get())).renderType("cutout"));
simpleBlockWithItem(ModBlocks.POTTED_CATMINT.get(), models().singleTexture("potted_catmint", new ResourceLocation("flower_pot_cross"), "plant",
blockTexture(ModBlocks.CATMINT.get())).renderType("cutout"));
simpleBlockWithItem(ModBlocks.GEM_POLISHING_STATION.get(),
new ModelFile.UncheckedModelFile(modLoc("block/gem_polishing_station")));
logBlock(((RotatedPillarBlock) ModBlocks.PINE_LOG.get()));
axisBlock(((RotatedPillarBlock) ModBlocks.PINE_WOOD.get()), blockTexture(ModBlocks.PINE_LOG.get()), blockTexture(ModBlocks.PINE_LOG.get()));
axisBlock(((RotatedPillarBlock) ModBlocks.STRIPPED_PINE_LOG.get()), blockTexture(ModBlocks.STRIPPED_PINE_LOG.get()),
new ResourceLocation(TutorialMod.MOD_ID, "block/stripped_pine_log_top"));
axisBlock(((RotatedPillarBlock) ModBlocks.STRIPPED_PINE_WOOD.get()), blockTexture(ModBlocks.STRIPPED_PINE_LOG.get()),
blockTexture(ModBlocks.STRIPPED_PINE_LOG.get()));
blockItem(ModBlocks.PINE_LOG);
blockItem(ModBlocks.PINE_WOOD);
blockItem(ModBlocks.STRIPPED_PINE_LOG);
blockItem(ModBlocks.STRIPPED_PINE_WOOD);
blockWithItem(ModBlocks.PINE_PLANKS);
leavesBlock(ModBlocks.PINE_LEAVES);
signBlock(((StandingSignBlock) ModBlocks.PINE_SIGN.get()), ((WallSignBlock) ModBlocks.PINE_WALL_SIGN.get()),
blockTexture(ModBlocks.PINE_PLANKS.get()));
hangingSignBlock(ModBlocks.PINE_HANGING_SIGN.get(), ModBlocks.PINE_WALL_HANGING_SIGN.get(), blockTexture(ModBlocks.PINE_PLANKS.get()));
}
public void hangingSignBlock(Block signBlock, Block wallSignBlock, ResourceLocation texture) {
ModelFile sign = models().sign(name(signBlock), texture);
hangingSignBlock(signBlock, wallSignBlock, sign);
}
public void hangingSignBlock(Block signBlock, Block wallSignBlock, ModelFile sign) {
simpleBlock(signBlock, sign);
simpleBlock(wallSignBlock, sign);
}
private String name(Block block) {
return key(block).getPath();
}
private ResourceLocation key(Block block) {
return ForgeRegistries.BLOCKS.getKey(block);
}
private void leavesBlock(RegistryObject<Block> blockRegistryObject) {
simpleBlockWithItem(blockRegistryObject.get(),
models().singleTexture(ForgeRegistries.BLOCKS.getKey(blockRegistryObject.get()).getPath(), new ResourceLocation("minecraft:block/leaves"),
"all", blockTexture(blockRegistryObject.get())).renderType("cutout"));
}
private void blockItem(RegistryObject<Block> blockRegistryObject) {
simpleBlockItem(blockRegistryObject.get(), new ModelFile.UncheckedModelFile(TutorialMod.MOD_ID +
":block/" + ForgeRegistries.BLOCKS.getKey(blockRegistryObject.get()).getPath()));
}
public void makeStrawberryCrop(CropBlock block, String modelName, String textureName) {
Function<BlockState, ConfiguredModel[]> function = state -> strawberryStates(state, block, modelName, textureName);

View File

@@ -55,6 +55,13 @@ public class ModBlockTagGenerator extends BlockTagsProvider {
this.tag(BlockTags.WALLS)
.add(ModBlocks.SAPPHIRE_WALL.get());
this.tag(BlockTags.LOGS_THAT_BURN)
.add(ModBlocks.PINE_LOG.get())
.add(ModBlocks.PINE_WOOD.get())
.add(ModBlocks.STRIPPED_PINE_LOG.get())
.add(ModBlocks.STRIPPED_PINE_WOOD.get());
this.tag(BlockTags.PLANKS)
.add(ModBlocks.PINE_PLANKS.get());
}
}

View File

@@ -53,6 +53,8 @@ public class ModItemModelProvider extends ItemModelProvider {
simpleItem(ModItems.CORN);
simpleItem(ModItems.CORN_SEEDS);
simpleItem(ModItems.BAR_BRAWL_MUSIC_DISC);
simpleBlockItem(ModBlocks.SAPPHIRE_DOOR);
fenceItem(ModBlocks.SAPPHIRE_FENCE, ModBlocks.SAPPHIRE_BLOCK);
@@ -78,6 +80,16 @@ public class ModItemModelProvider extends ItemModelProvider {
trimmedArmorItem(ModItems.SAPPHIRE_BOOTS);
simpleBlockItemBlockTexture(ModBlocks.CATMINT);
withExistingParent(ModItems.RHINO_SPANW_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
simpleItem(ModItems.PINE_SIGN);
simpleItem(ModItems.PINE_HANGING_SIGN);
simpleItem(ModItems.PINE_BOAT);
simpleItem(ModItems.PINE_CHEST_BOAT);
simpleItem(ModItems.DICE);
}
// Shoutout to El_Redstoniano for making this

View File

@@ -1,6 +1,7 @@
package net.kaupenjoe.tutorialmod.datagen;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.block.ModBlocks;
import net.kaupenjoe.tutorialmod.item.ModItems;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
@@ -25,5 +26,20 @@ public class ModItemTagGenerator extends ItemTagsProvider {
ModItems.SAPPHIRE_CHESTPLATE.get(),
ModItems.SAPPHIRE_LEGGINGS.get(),
ModItems.SAPPHIRE_BOOTS.get());
this.tag(ItemTags.MUSIC_DISCS)
.add(ModItems.BAR_BRAWL_MUSIC_DISC.get());
this.tag(ItemTags.CREEPER_DROP_MUSIC_DISCS)
.add(ModItems.BAR_BRAWL_MUSIC_DISC.get());
this.tag(ItemTags.LOGS_THAT_BURN)
.add(ModBlocks.PINE_LOG.get().asItem())
.add(ModBlocks.PINE_WOOD.get().asItem())
.add(ModBlocks.STRIPPED_PINE_LOG.get().asItem())
.add(ModBlocks.STRIPPED_PINE_WOOD.get().asItem());
this.tag(ItemTags.PLANKS)
.add(ModBlocks.PINE_PLANKS.get().asItem());
}
}

View File

@@ -0,0 +1,24 @@
package net.kaupenjoe.tutorialmod.datagen;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.PoiTypeTagsProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.PoiTypeTags;
import net.minecraftforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable;
import java.util.concurrent.CompletableFuture;
public class ModPoiTypeTagsProvider extends PoiTypeTagsProvider {
public ModPoiTypeTagsProvider(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pProvider, @Nullable ExistingFileHelper existingFileHelper) {
super(pOutput, pProvider, TutorialMod.MOD_ID, existingFileHelper);
}
@Override
protected void addTags(HolderLookup.Provider pProvider) {
tag(PoiTypeTags.ACQUIRABLE_JOB_SITE)
.addOptional(new ResourceLocation(TutorialMod.MOD_ID, "sound_poi"));
}
}

View File

@@ -0,0 +1,26 @@
package net.kaupenjoe.tutorialmod.datagen;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.worldgen.ModBiomeModifiers;
import net.kaupenjoe.tutorialmod.worldgen.ModConfiguredFeatures;
import net.kaupenjoe.tutorialmod.worldgen.ModPlacedFeatures;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.PackOutput;
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
public class ModWorldGenProvider extends DatapackBuiltinEntriesProvider {
public static final RegistrySetBuilder BUILDER = new RegistrySetBuilder()
.add(Registries.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap)
.add(Registries.PLACED_FEATURE, ModPlacedFeatures::bootstrap)
.add(ForgeRegistries.Keys.BIOME_MODIFIERS, ModBiomeModifiers::bootstrap);
public ModWorldGenProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> registries) {
super(output, registries, BUILDER, Set.of(TutorialMod.MOD_ID));
}
}

View File

@@ -80,6 +80,27 @@ public class ModBlockLootTables extends BlockLootSubProvider {
this.dropSelf(ModBlocks.CATMINT.get());
this.add(ModBlocks.POTTED_CATMINT.get(), createPotFlowerItemTable(ModBlocks.CATMINT.get()));
this.dropSelf(ModBlocks.GEM_POLISHING_STATION.get());
this.dropSelf(ModBlocks.PINE_LOG.get());
this.dropSelf(ModBlocks.PINE_WOOD.get());
this.dropSelf(ModBlocks.STRIPPED_PINE_LOG.get());
this.dropSelf(ModBlocks.STRIPPED_PINE_WOOD.get());
this.dropSelf(ModBlocks.PINE_PLANKS.get());
this.add(ModBlocks.PINE_LEAVES.get(), block ->
createLeavesDrops(block, ModBlocks.SAPPHIRE_BLOCK.get(), NORMAL_LEAVES_SAPLING_CHANCES)); // TODO: Change to Sapling!
this.add(ModBlocks.PINE_SIGN.get(), block ->
createSingleItemTable(ModItems.PINE_SIGN.get()));
this.add(ModBlocks.PINE_WALL_SIGN.get(), block ->
createSingleItemTable(ModItems.PINE_SIGN.get()));
this.add(ModBlocks.PINE_HANGING_SIGN.get(), block ->
createSingleItemTable(ModItems.PINE_HANGING_SIGN.get()));
this.add(ModBlocks.PINE_WALL_HANGING_SIGN.get(), block ->
createSingleItemTable(ModItems.PINE_HANGING_SIGN.get()));
}
protected LootTable.Builder createCopperLikeOreDrops(Block pBlock, Item item) {

View File

@@ -0,0 +1,42 @@
package net.kaupenjoe.tutorialmod.entity;
import net.kaupenjoe.tutorialmod.TutorialMod;
import net.kaupenjoe.tutorialmod.entity.custom.DiceProjectileEntity;
import net.kaupenjoe.tutorialmod.entity.custom.ModBoatEntity;
import net.kaupenjoe.tutorialmod.entity.custom.ModChestBoatEntity;
import net.kaupenjoe.tutorialmod.entity.custom.RhinoEntity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class ModEntities {
public static final DeferredRegister<EntityType<?>> ENTITY_TYPES =
DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, TutorialMod.MOD_ID);
public static final RegistryObject<EntityType<RhinoEntity>> RHINO =
ENTITY_TYPES.register("rhino", () -> EntityType.Builder.of(RhinoEntity::new, MobCategory.CREATURE)
.sized(2.5f, 2.5f).build("rhino"));
public static final RegistryObject<EntityType<ModBoatEntity>> MOD_BOAT =
ENTITY_TYPES.register("mod_boat", () -> EntityType.Builder.<ModBoatEntity>of(ModBoatEntity::new, MobCategory.MISC)
.sized(1.375f, 0.5625f).build("mod_boat"));
public static final RegistryObject<EntityType<ModChestBoatEntity>> MOD_CHEST_BOAT =
ENTITY_TYPES.register("mod_chest_boat", () -> EntityType.Builder.<ModChestBoatEntity>of(ModChestBoatEntity::new, MobCategory.MISC)
.sized(1.375f, 0.5625f).build("mod_chest_boat"));
public static final RegistryObject<EntityType<DiceProjectileEntity>> DICE_PROJECTILE =
ENTITY_TYPES.register("dice_projectile", () -> EntityType.Builder.<DiceProjectileEntity>of(DiceProjectileEntity::new, MobCategory.MISC)
.sized(0.5f, 0.5f).build("dice_projectile"));
public static void register(IEventBus eventBus) {
ENTITY_TYPES.register(eventBus);
}
}

View File

@@ -0,0 +1,88 @@
package net.kaupenjoe.tutorialmod.entity.ai;
import net.kaupenjoe.tutorialmod.entity.custom.RhinoEntity;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.PathfinderMob;
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
public class RhinoAttackGoal extends MeleeAttackGoal {
private final RhinoEntity entity;
private int attackDelay = 40;
private int ticksUntilNextAttack = 40;
private boolean shouldCountTillNextAttack = false;
public RhinoAttackGoal(PathfinderMob pMob, double pSpeedModifier, boolean pFollowingTargetEvenIfNotSeen) {
super(pMob, pSpeedModifier, pFollowingTargetEvenIfNotSeen);
entity = ((RhinoEntity) pMob);
}
@Override
public void start() {
super.start();
attackDelay = 40;
ticksUntilNextAttack = 40;
}
@Override
protected void checkAndPerformAttack(LivingEntity pEnemy, double pDistToEnemySqr) {
if (isEnemyWithinAttackDistance(pEnemy, pDistToEnemySqr)) {
shouldCountTillNextAttack = true;
if(isTimeToStartAttackAnimation()) {
entity.setAttacking(true);
}
if(isTimeToAttack()) {
this.mob.getLookControl().setLookAt(pEnemy.getX(), pEnemy.getEyeY(), pEnemy.getZ());
performAttack(pEnemy);
}
} else {
resetAttackCooldown();
shouldCountTillNextAttack = false;
entity.setAttacking(false);
entity.attackAnimationTimeout = 0;
}
}
private boolean isEnemyWithinAttackDistance(LivingEntity pEnemy, double pDistToEnemySqr) {
return pDistToEnemySqr <= this.getAttackReachSqr(pEnemy);
}
protected void resetAttackCooldown() {
this.ticksUntilNextAttack = this.adjustedTickDelay(attackDelay * 2);
}
protected boolean isTimeToAttack() {
return this.ticksUntilNextAttack <= 0;
}
protected boolean isTimeToStartAttackAnimation() {
return this.ticksUntilNextAttack <= attackDelay;
}
protected int getTicksUntilNextAttack() {
return this.ticksUntilNextAttack;
}
protected void performAttack(LivingEntity pEnemy) {
this.resetAttackCooldown();
this.mob.swing(InteractionHand.MAIN_HAND);
this.mob.doHurtTarget(pEnemy);
}
@Override
public void tick() {
super.tick();
if(shouldCountTillNextAttack) {
this.ticksUntilNextAttack = Math.max(this.ticksUntilNextAttack - 1, 0);
}
}
@Override
public void stop() {
entity.setAttacking(false);
super.stop();
}
}

View File

@@ -0,0 +1,369 @@
package net.kaupenjoe.tutorialmod.entity.animations;
import net.minecraft.client.animation.AnimationChannel;
import net.minecraft.client.animation.AnimationDefinition;
import net.minecraft.client.animation.Keyframe;
import net.minecraft.client.animation.KeyframeAnimations;
public class ModAnimationDefinitions {
public static final AnimationDefinition RHINO_IDLE = AnimationDefinition.Builder.withLength(2f).looping()
.addAnimation("rhino",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.posVec(0f, 1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("body",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5f, KeyframeAnimations.posVec(0f, -0.5f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.4583433f, KeyframeAnimations.posVec(0f, -0.5f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.9583433f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("torso",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("torso",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5f, KeyframeAnimations.degreeVec(1f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.4583433f, KeyframeAnimations.degreeVec(-1f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.9583433f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR))).build();
public static final AnimationDefinition RHINO_WALK = AnimationDefinition.Builder.withLength(2f).looping()
.addAnimation("torso",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.125f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.75f, KeyframeAnimations.posVec(0f, 1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.posVec(0f, 1.5f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.9167666f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.25f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.6766667f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_leg",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.9167666f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.25f, KeyframeAnimations.degreeVec(2.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.6766667f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_knee",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.9167666f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.25f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.6766667f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_knee",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.9167666f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.25f, KeyframeAnimations.degreeVec(7.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.6766667f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_heel",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.9167666f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.25f, KeyframeAnimations.posVec(0f, 1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.6766667f, KeyframeAnimations.posVec(0f, 1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_heel",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.9167666f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.25f, KeyframeAnimations.degreeVec(-7.16f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.6766667f, KeyframeAnimations.degreeVec(-2.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.375f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.7083434f, KeyframeAnimations.posVec(0f, -1.25f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.125f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_leg",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.375f, KeyframeAnimations.degreeVec(5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.7083434f, KeyframeAnimations.degreeVec(2.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.125f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_knee",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.375f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.7083434f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.125f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_knee",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.375f, KeyframeAnimations.degreeVec(7.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.7083434f, KeyframeAnimations.degreeVec(5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.125f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_heel",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.2916767f, KeyframeAnimations.posVec(0f, 1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5834334f, KeyframeAnimations.posVec(0f, 1.5f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_heel",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.2916767f, KeyframeAnimations.degreeVec(-10f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5834334f, KeyframeAnimations.degreeVec(-7.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_front_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(1f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.2916767f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.625f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_front_leg",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(1f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.2916767f, KeyframeAnimations.degreeVec(-7.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.625f, KeyframeAnimations.degreeVec(-2.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_front_knee",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(1f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.2916767f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.625f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_front_knee",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(1f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.2916767f, KeyframeAnimations.degreeVec(10f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.625f, KeyframeAnimations.degreeVec(2.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_front_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.25f, KeyframeAnimations.posVec(0f, -1f, -1f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6766666f, KeyframeAnimations.posVec(0f, -1f, 1f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_front_leg",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.25f, KeyframeAnimations.degreeVec(-5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6766666f, KeyframeAnimations.degreeVec(-2.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_front_knee",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.25f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6766666f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_front_knee",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.25f, KeyframeAnimations.degreeVec(10f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6766666f, KeyframeAnimations.degreeVec(17.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR))).build();
public static final AnimationDefinition RHINO_ATTACK = AnimationDefinition.Builder.withLength(4f).looping()
.addAnimation("skull",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.5f, KeyframeAnimations.degreeVec(22.5f, 0f, -45f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(22.5f, 0f, -45f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2.5f, KeyframeAnimations.degreeVec(-60.03f, 17.68f, -19.21f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(3.5f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(4f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR))).build();
public static final AnimationDefinition RHINO_SIT = AnimationDefinition.Builder.withLength(2f).looping()
.addAnimation("rhino",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("body",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, -4f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5f, KeyframeAnimations.posVec(0f, -4.5f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.4583433f, KeyframeAnimations.posVec(0f, -4.5f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.9583433f, KeyframeAnimations.posVec(0f, -4f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, -4f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("body",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("torso",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5f, KeyframeAnimations.posVec(0f, -1f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.posVec(0f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("torso",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(-7.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.5f, KeyframeAnimations.degreeVec(-10f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.4583433f, KeyframeAnimations.degreeVec(-10f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.9583433f, KeyframeAnimations.degreeVec(-10f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR),
new Keyframe(2f, KeyframeAnimations.degreeVec(-10f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, -11f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_knee",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 3f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_knee",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(-25f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_heel",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 2f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_back_heel",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(27.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, -11f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_knee",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 4f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_knee",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(-22.5f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_heel",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 1f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_back_heel",
new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0f, KeyframeAnimations.degreeVec(25f, 0f, 0f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("right_front_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 2f),
AnimationChannel.Interpolations.LINEAR)))
.addAnimation("left_front_leg",
new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0f, KeyframeAnimations.posVec(0f, 0f, 2f),
AnimationChannel.Interpolations.LINEAR))).build();
}

Some files were not shown because too many files have changed in this diff Show More