[add] Beaver
[add] Deer [add] Falcon [add] Heron [add] Otter [add] Squirrel [add] WildBoar [add] Mole [add] Acorns
This commit is contained in:
@@ -1,12 +1,17 @@
|
|||||||
// 1.21.1 2026-10-03T20:06:11.749153036 Registries
|
// 1.21.1 2026-10-13T16:08:08.973123976 Registries
|
||||||
|
6dc6f6baab5618aa54fdaab95faf1ece135b8b69 data/masterwild/neoforge/biome_modifier/spawn_beaver.json
|
||||||
ead89faabf72208190d381bb26c0381632944e55 data/masterwild/neoforge/biome_modifier/spawn_butterfly.json
|
ead89faabf72208190d381bb26c0381632944e55 data/masterwild/neoforge/biome_modifier/spawn_butterfly.json
|
||||||
5b1394075b71f32144518c3778e59a37c35788b7 data/masterwild/neoforge/biome_modifier/spawn_capybara.json
|
5b1394075b71f32144518c3778e59a37c35788b7 data/masterwild/neoforge/biome_modifier/spawn_capybara.json
|
||||||
42b42dadaa2670d7d4a4405bbd688cad31734cd1 data/masterwild/neoforge/biome_modifier/spawn_duck.json
|
42b42dadaa2670d7d4a4405bbd688cad31734cd1 data/masterwild/neoforge/biome_modifier/spawn_duck.json
|
||||||
7d8ae6f7dfb59ddf054cabf0a1169a571465c6bc data/masterwild/neoforge/biome_modifier/spawn_firefly.json
|
7d8ae6f7dfb59ddf054cabf0a1169a571465c6bc data/masterwild/neoforge/biome_modifier/spawn_firefly.json
|
||||||
794f7cd1a27f9d8b96379fb661eab0d120cad281 data/masterwild/neoforge/biome_modifier/spawn_hedgehog.json
|
794f7cd1a27f9d8b96379fb661eab0d120cad281 data/masterwild/neoforge/biome_modifier/spawn_hedgehog.json
|
||||||
3d5b931996cbc1319a2e2afe8ddc7e455f407f18 data/masterwild/neoforge/biome_modifier/spawn_monkey.json
|
3d5b931996cbc1319a2e2afe8ddc7e455f407f18 data/masterwild/neoforge/biome_modifier/spawn_monkey.json
|
||||||
|
8af580e68718f83c4ab4e1ba3a4b0cd065c0402c data/masterwild/neoforge/biome_modifier/spawn_otter.json
|
||||||
643ad56ac8f259789977e34868ea4ea77122aafe data/masterwild/neoforge/biome_modifier/spawn_pinguin.json
|
643ad56ac8f259789977e34868ea4ea77122aafe data/masterwild/neoforge/biome_modifier/spawn_pinguin.json
|
||||||
264ebbb0f1efd8cefc13e93c0031c3b19c80a225 data/masterwild/neoforge/biome_modifier/spawn_raccoon.json
|
264ebbb0f1efd8cefc13e93c0031c3b19c80a225 data/masterwild/neoforge/biome_modifier/spawn_raccoon.json
|
||||||
|
11349be98ac060765f44c9d882c7a75697573edb data/masterwild/neoforge/biome_modifier/spawn_rat.json
|
||||||
0f98182744360df8e11851c2b6782e325689090d data/masterwild/neoforge/biome_modifier/spawn_red_panda.json
|
0f98182744360df8e11851c2b6782e325689090d data/masterwild/neoforge/biome_modifier/spawn_red_panda.json
|
||||||
cc5600e4e2999812382684cc52f9d59e19a521e1 data/masterwild/neoforge/biome_modifier/spawn_rooster.json
|
cc5600e4e2999812382684cc52f9d59e19a521e1 data/masterwild/neoforge/biome_modifier/spawn_rooster.json
|
||||||
30308b10a3b95454e8678a8324ae88285a9e7b21 data/masterwild/neoforge/biome_modifier/spawn_shark.json
|
30308b10a3b95454e8678a8324ae88285a9e7b21 data/masterwild/neoforge/biome_modifier/spawn_shark.json
|
||||||
|
917c97e88a102edd3390a4a9fb96cef4d79cd964 data/masterwild/neoforge/biome_modifier/spawn_squirrel.json
|
||||||
|
61dbb02ee9c09ae5e34a4b53011bfab20de1221b data/masterwild/neoforge/biome_modifier/spawn_wild_boar.json
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// 1.21.1 2026-10-03T20:06:11.750559852 Languages: en_us for mod: masterwild
|
// 1.21.1 2026-10-13T16:08:08.973730865 Languages: en_us for mod: masterwild
|
||||||
00583df3ad42ddb46acc722e93243863da7ba227 assets/masterwild/lang/en_us.json
|
81bf1ee9c9addc3bd88c52aa3321d62cc33b4df5 assets/masterwild/lang/en_us.json
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
// 1.21.1 2026-10-03T20:08:32.139155153 Item Models: masterwild
|
// 1.21.1 2026-10-13T16:08:08.973990839 Item Models: masterwild
|
||||||
|
2aa81cb21e77496327acb2976e6c39aec2ffcadb assets/masterwild/models/item/acorns.json
|
||||||
a92e1a88c1d3c3c04b2b001f0bffd19a1f3462f0 assets/masterwild/models/item/banana.json
|
a92e1a88c1d3c3c04b2b001f0bffd19a1f3462f0 assets/masterwild/models/item/banana.json
|
||||||
8cb5b876c97ae89d180a200612d0d14c8456c2f7 assets/masterwild/models/item/banana_peel.json
|
8cb5b876c97ae89d180a200612d0d14c8456c2f7 assets/masterwild/models/item/banana_peel.json
|
||||||
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/beaver_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/butterfly_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/butterfly_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/capybara_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/capybara_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/duck_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/duck_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/firefly_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/firefly_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/hedgehog_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/hedgehog_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/monkey_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/monkey_spawn_egg.json
|
||||||
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/otter_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/pinguin_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/pinguin_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/raccoon_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/raccoon_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/rat_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/rat_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/red-panda_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/red-panda_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/rooster_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/rooster_spawn_egg.json
|
||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/shark_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/shark_spawn_egg.json
|
||||||
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/squirrel_spawn_egg.json
|
||||||
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/wild_boar_spawn_egg.json
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
// 1.21.1 2026-09-24T17:08:07.015279022 Tags for minecraft:item mod id masterwild
|
// 1.21.1 2026-10-13T16:08:08.971991159 Tags for minecraft:item mod id masterwild
|
||||||
|
497dc583ad66187f5aba24802d96838b8c2289c8 data/c/tags/item/foods.json
|
||||||
|
|||||||
@@ -1,31 +1,40 @@
|
|||||||
{
|
{
|
||||||
"creativetab.masterwild.masterwild": "MasterWild",
|
"creativetab.masterwild.masterwild": "MasterWild",
|
||||||
|
"entity.masterwild.beaver": "Beaver",
|
||||||
"entity.masterwild.butterfly": "Butterfly",
|
"entity.masterwild.butterfly": "Butterfly",
|
||||||
"entity.masterwild.capybara": "Capybara",
|
"entity.masterwild.capybara": "Capybara",
|
||||||
"entity.masterwild.duck": "Duck",
|
"entity.masterwild.duck": "Duck",
|
||||||
"entity.masterwild.firefly": "Firefly",
|
"entity.masterwild.firefly": "Firefly",
|
||||||
"entity.masterwild.hedgehog": "Hedgehog",
|
"entity.masterwild.hedgehog": "Hedgehog",
|
||||||
"entity.masterwild.monkey": "Monkey",
|
"entity.masterwild.monkey": "Monkey",
|
||||||
|
"entity.masterwild.otter": "Otter",
|
||||||
"entity.masterwild.pinguin": "Pinguin",
|
"entity.masterwild.pinguin": "Pinguin",
|
||||||
"entity.masterwild.raccoon": "Raccoon",
|
"entity.masterwild.raccoon": "Raccoon",
|
||||||
"entity.masterwild.rat": "Rat",
|
"entity.masterwild.rat": "Rat",
|
||||||
"entity.masterwild.red_panda": "Red Panda",
|
"entity.masterwild.red_panda": "Red Panda",
|
||||||
"entity.masterwild.rooster": "Rooster",
|
"entity.masterwild.rooster": "Rooster",
|
||||||
"entity.masterwild.shark": "Shark",
|
"entity.masterwild.shark": "Shark",
|
||||||
|
"entity.masterwild.squirrel": "Squirrel",
|
||||||
|
"entity.masterwild.wild_boar": "Wild Boar",
|
||||||
|
"item.masterwild.acorns": "Acorns",
|
||||||
"item.masterwild.banana": "Banana",
|
"item.masterwild.banana": "Banana",
|
||||||
"item.masterwild.banana_peel": "Banana Peel",
|
"item.masterwild.banana_peel": "Banana Peel",
|
||||||
|
"item.masterwild.beaver_spawn_egg": "Beaver Spawn Egg",
|
||||||
"item.masterwild.butterfly_spawn_egg": "Butterfly Spawn Egg",
|
"item.masterwild.butterfly_spawn_egg": "Butterfly Spawn Egg",
|
||||||
"item.masterwild.capybara_spawn_egg": "Capybara Spawn Egg",
|
"item.masterwild.capybara_spawn_egg": "Capybara Spawn Egg",
|
||||||
"item.masterwild.duck_spawn_egg": "Duck Spawn Egg",
|
"item.masterwild.duck_spawn_egg": "Duck Spawn Egg",
|
||||||
"item.masterwild.firefly_spawn_egg": "Firefly Spawn Egg",
|
"item.masterwild.firefly_spawn_egg": "Firefly Spawn Egg",
|
||||||
"item.masterwild.hedgehog_spawn_egg": "Hedgehog Spawn Egg",
|
"item.masterwild.hedgehog_spawn_egg": "Hedgehog Spawn Egg",
|
||||||
"item.masterwild.monkey_spawn_egg": "Monkey Spawn Egg",
|
"item.masterwild.monkey_spawn_egg": "Monkey Spawn Egg",
|
||||||
|
"item.masterwild.otter_spawn_egg": "Otter Spawn Egg",
|
||||||
"item.masterwild.pinguin_spawn_egg": "Pinguin Spawn Egg",
|
"item.masterwild.pinguin_spawn_egg": "Pinguin Spawn Egg",
|
||||||
"item.masterwild.raccoon_spawn_egg": "Raccoon Spawn Egg",
|
"item.masterwild.raccoon_spawn_egg": "Raccoon Spawn Egg",
|
||||||
"item.masterwild.rat_spawn_egg": "Rat Spawn Egg",
|
"item.masterwild.rat_spawn_egg": "Rat Spawn Egg",
|
||||||
"item.masterwild.red-panda_spawn_egg": "Red Panda Spawn Egg",
|
"item.masterwild.red-panda_spawn_egg": "Red Panda Spawn Egg",
|
||||||
"item.masterwild.rooster_spawn_egg": "Rooster Spawn Egg",
|
"item.masterwild.rooster_spawn_egg": "Rooster Spawn Egg",
|
||||||
"item.masterwild.shark_spawn_egg": "Shark Spawn Egg",
|
"item.masterwild.shark_spawn_egg": "Shark Spawn Egg",
|
||||||
|
"item.masterwild.squirrel_spawn_egg": "Squirrel Spawn Egg",
|
||||||
|
"item.masterwild.wild_boar_spawn_egg": "Wild Boar Spawn Egg",
|
||||||
"subtitles.masterwild.monkey_hurt": "Monkey Hurt",
|
"subtitles.masterwild.monkey_hurt": "Monkey Hurt",
|
||||||
"subtitles.masterwild.rooster_crow": "Rooster crows"
|
"subtitles.masterwild.rooster_crow": "Rooster crows"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "masterwild:item/acorns"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/template_spawn_egg"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/template_spawn_egg"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/template_spawn_egg"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/template_spawn_egg"
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"masterwild:banana",
|
||||||
|
"masterwild:acorns"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"type": "neoforge:add_spawns",
|
||||||
|
"biomes": [
|
||||||
|
"minecraft:river",
|
||||||
|
"minecraft:swamp"
|
||||||
|
],
|
||||||
|
"spawners": {
|
||||||
|
"type": "masterwild:beaver",
|
||||||
|
"maxCount": 2,
|
||||||
|
"minCount": 1,
|
||||||
|
"weight": 5
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"type": "neoforge:add_spawns",
|
||||||
|
"biomes": [
|
||||||
|
"minecraft:river",
|
||||||
|
"minecraft:swamp"
|
||||||
|
],
|
||||||
|
"spawners": {
|
||||||
|
"type": "masterwild:otter",
|
||||||
|
"maxCount": 2,
|
||||||
|
"minCount": 1,
|
||||||
|
"weight": 6
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"type": "neoforge:add_spawns",
|
||||||
|
"biomes": "#minecraft:is_forest",
|
||||||
|
"spawners": {
|
||||||
|
"type": "masterwild:rat",
|
||||||
|
"maxCount": 3,
|
||||||
|
"minCount": 2,
|
||||||
|
"weight": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"type": "neoforge:add_spawns",
|
||||||
|
"biomes": [
|
||||||
|
"minecraft:forest",
|
||||||
|
"minecraft:birch_forest",
|
||||||
|
"minecraft:taiga"
|
||||||
|
],
|
||||||
|
"spawners": {
|
||||||
|
"type": "masterwild:squirrel",
|
||||||
|
"maxCount": 4,
|
||||||
|
"minCount": 2,
|
||||||
|
"weight": 12
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"type": "neoforge:add_spawns",
|
||||||
|
"biomes": [
|
||||||
|
"minecraft:forest",
|
||||||
|
"minecraft:dark_forest",
|
||||||
|
"minecraft:taiga"
|
||||||
|
],
|
||||||
|
"spawners": {
|
||||||
|
"type": "masterwild:wild_boar",
|
||||||
|
"maxCount": 3,
|
||||||
|
"minCount": 1,
|
||||||
|
"weight": 6
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ public class ModCreativeModeTabs {
|
|||||||
|
|
||||||
output.accept(ModItems.BANANA);
|
output.accept(ModItems.BANANA);
|
||||||
output.accept(ModItems.BANANA_PEEL);
|
output.accept(ModItems.BANANA_PEEL);
|
||||||
|
output.accept(ModItems.ACORNS);
|
||||||
|
|
||||||
output.accept(ModItems.PINGUIN_SPAWN_EGG);
|
output.accept(ModItems.PINGUIN_SPAWN_EGG);
|
||||||
output.accept(ModItems.FIREFLY_SPAWN_EGG);
|
output.accept(ModItems.FIREFLY_SPAWN_EGG);
|
||||||
@@ -34,6 +35,20 @@ public class ModCreativeModeTabs {
|
|||||||
output.accept(ModItems.CAPYBARA_SPAWN_EGG);
|
output.accept(ModItems.CAPYBARA_SPAWN_EGG);
|
||||||
output.accept(ModItems.DUCK_SPAWN_EGG);
|
output.accept(ModItems.DUCK_SPAWN_EGG);
|
||||||
output.accept(ModItems.RAT_SPAWN_EGG);
|
output.accept(ModItems.RAT_SPAWN_EGG);
|
||||||
|
output.accept(ModItems.SQUIRREL_SPAWN_EGG);
|
||||||
|
output.accept(ModItems.OTTER_SPAWN_EGG);
|
||||||
|
/*
|
||||||
|
output.accept(ModItems.DEER_SPAWN_EGG);
|
||||||
|
|
||||||
|
*/
|
||||||
|
output.accept(ModItems.BEAVER_SPAWN_EGG);
|
||||||
|
/*
|
||||||
|
output.accept(ModItems.FALCON_SPAWN_EGG);
|
||||||
|
output.accept(ModItems.MOLE_SPAWN_EGG);
|
||||||
|
output.accept(ModItems.HERON_SPAWN_EGG);
|
||||||
|
|
||||||
|
*/
|
||||||
|
output.accept(ModItems.WILD_BOAR_SPAWN_EGG);
|
||||||
|
|
||||||
}).build());
|
}).build());
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,15 @@ import net.minecraft.world.food.FoodProperties;
|
|||||||
|
|
||||||
public class ModFoodProperties {
|
public class ModFoodProperties {
|
||||||
public static final FoodProperties BANANA = new FoodProperties.Builder()
|
public static final FoodProperties BANANA = new FoodProperties.Builder()
|
||||||
.nutrition(3)
|
.nutrition(4)
|
||||||
.saturationModifier(0.25F)
|
.saturationModifier(0.5F)
|
||||||
.usingConvertsTo(ModItems.BANANA_PEEL.get())
|
.usingConvertsTo(ModItems.BANANA_PEEL.get())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
public static final FoodProperties ACORNS = new FoodProperties.Builder()
|
||||||
|
.nutrition(2)
|
||||||
|
.saturationModifier(0.25F)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ public class ModItems {
|
|||||||
.food(ModFoodProperties.BANANA)
|
.food(ModFoodProperties.BANANA)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
public static final DeferredItem<Item> ACORNS = ITEMS.register("acorns",
|
||||||
|
() -> new Item(new Item.Properties()
|
||||||
|
.stacksTo(16)
|
||||||
|
.food(ModFoodProperties.ACORNS)
|
||||||
|
));
|
||||||
|
|
||||||
//SpawnEggs
|
//SpawnEggs
|
||||||
public static final DeferredItem<Item> PINGUIN_SPAWN_EGG = ITEMS.register("pinguin_spawn_egg",
|
public static final DeferredItem<Item> PINGUIN_SPAWN_EGG = ITEMS.register("pinguin_spawn_egg",
|
||||||
() -> new DeferredSpawnEggItem(ModEntities.PINGUIN, 0x0b0b17, 0xd6e3e3,
|
() -> new DeferredSpawnEggItem(ModEntities.PINGUIN, 0x0b0b17, 0xd6e3e3,
|
||||||
@@ -61,8 +67,38 @@ public class ModItems {
|
|||||||
public static final DeferredItem<Item> RAT_SPAWN_EGG = ITEMS.register("rat_spawn_egg",
|
public static final DeferredItem<Item> RAT_SPAWN_EGG = ITEMS.register("rat_spawn_egg",
|
||||||
() -> new DeferredSpawnEggItem(ModEntities.RAT, 0x767677, 0x965654,
|
() -> new DeferredSpawnEggItem(ModEntities.RAT, 0x767677, 0x965654,
|
||||||
new Item.Properties()));
|
new Item.Properties()));
|
||||||
|
public static final DeferredItem<Item> SQUIRREL_SPAWN_EGG = ITEMS.register("squirrel_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.SQUIRREL, 0x8a4a2b, 0xc96a2f,
|
||||||
|
new Item.Properties()));
|
||||||
|
public static final DeferredItem<Item> OTTER_SPAWN_EGG = ITEMS.register("otter_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.OTTER, 0x4f3a2a, 0xcabf9e,
|
||||||
|
new Item.Properties()));
|
||||||
|
/*
|
||||||
|
public static final DeferredItem<Item> DEER_SPAWN_EGG = ITEMS.register("deer_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.DEER, 0x7a5330, 0xe8d9b5,
|
||||||
|
new Item.Properties()));
|
||||||
|
|
||||||
|
*/
|
||||||
|
public static final DeferredItem<Item> BEAVER_SPAWN_EGG = ITEMS.register("beaver_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.BEAVER, 0x4a3522, 0x8a6a42,
|
||||||
|
new Item.Properties()));
|
||||||
|
/*
|
||||||
|
public static final DeferredItem<Item> FALCON_SPAWN_EGG = ITEMS.register("falcon_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.FALCON, 0x5c4a3d, 0xd8c9a3,
|
||||||
|
new Item.Properties()));
|
||||||
|
public static final DeferredItem<Item> MOLE_SPAWN_EGG = ITEMS.register("mole_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.MOLE, 0x2e2a28, 0x6b5d52,
|
||||||
|
new Item.Properties()));
|
||||||
|
public static final DeferredItem<Item> HERON_SPAWN_EGG = ITEMS.register("heron_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.HERON, 0xd9d4c9, 0xe6943b,
|
||||||
|
new Item.Properties()));
|
||||||
|
|
||||||
|
*/
|
||||||
|
public static final DeferredItem<Item> WILD_BOAR_SPAWN_EGG = ITEMS.register("wild_boar_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.WILD_BOAR, 0x3f2f26, 0x8c7158,
|
||||||
|
new Item.Properties()));
|
||||||
|
|
||||||
public static void register(IEventBus eventBus) {
|
public static void register(IEventBus eventBus) {
|
||||||
ITEMS.register(eventBus);
|
ITEMS.register(eventBus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,6 @@ import net.neoforged.bus.api.SubscribeEvent;
|
|||||||
import net.neoforged.fml.ModContainer;
|
import net.neoforged.fml.ModContainer;
|
||||||
import net.neoforged.fml.common.EventBusSubscriber;
|
import net.neoforged.fml.common.EventBusSubscriber;
|
||||||
import net.neoforged.fml.common.Mod;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.neoforged.fml.config.ModConfig;
|
|
||||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
@@ -19,11 +18,15 @@ import ovh.glitchlabs.masterwild.Item.ModCreativeModeTabs;
|
|||||||
import ovh.glitchlabs.masterwild.Item.ModItems;
|
import ovh.glitchlabs.masterwild.Item.ModItems;
|
||||||
import ovh.glitchlabs.masterwild.Sounds.ModSounds;
|
import ovh.glitchlabs.masterwild.Sounds.ModSounds;
|
||||||
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.Beaver.BeaverRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Monkey.MonkeyRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.Monkey.MonkeyRenderer;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.Otter.OtterRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Pinguin.PinguinRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.Pinguin.PinguinRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Raccoon.RaccoonRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.Raccoon.RaccoonRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Rooster.RoosterRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.Rooster.RoosterRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Shark.SharkRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.Shark.SharkRenderer;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.Squirrel.SquirrelRenderer;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.WildBoar.wildboarRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.butterfly.ButterflyRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.butterfly.ButterflyRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.capibara.CapybaraRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.capibara.CapybaraRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.duck.duckRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.duck.duckRenderer;
|
||||||
@@ -90,6 +93,14 @@ public class Masterwild {
|
|||||||
EntityRenderers.register(ModEntities.CAPYBARA.get(), CapybaraRenderer::new);
|
EntityRenderers.register(ModEntities.CAPYBARA.get(), CapybaraRenderer::new);
|
||||||
EntityRenderers.register(ModEntities.DUCK.get(), duckRenderer::new);
|
EntityRenderers.register(ModEntities.DUCK.get(), duckRenderer::new);
|
||||||
EntityRenderers.register(ModEntities.RAT.get(), ratRenderer::new);
|
EntityRenderers.register(ModEntities.RAT.get(), ratRenderer::new);
|
||||||
|
EntityRenderers.register(ModEntities.BEAVER.get(), BeaverRenderer::new);
|
||||||
|
//EntityRenderers.register(ModEntities.DEER.get(), DeerRenderer::new);
|
||||||
|
//EntityRenderers.register(ModEntities.FALCON.get(), FalconRenderer::new);
|
||||||
|
//EntityRenderers.register(ModEntities.HERON.get(), HeronRenderer::new);
|
||||||
|
//EntityRenderers.register(ModEntities.MOLE.get(), MoleRenderer::new);
|
||||||
|
EntityRenderers.register(ModEntities.OTTER.get(), OtterRenderer::new);
|
||||||
|
EntityRenderers.register(ModEntities.SQUIRREL.get(), SquirrelRenderer::new);
|
||||||
|
EntityRenderers.register(ModEntities.WILD_BOAR.get(), wildboarRenderer::new);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public class ModItemModelProvider extends ItemModelProvider {
|
|||||||
|
|
||||||
//food
|
//food
|
||||||
basicItem(ModItems.BANANA.get());
|
basicItem(ModItems.BANANA.get());
|
||||||
|
basicItem(ModItems.ACORNS.get());
|
||||||
|
|
||||||
//spawneggs
|
//spawneggs
|
||||||
withExistingParent(ModItems.PINGUIN_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
withExistingParent(ModItems.PINGUIN_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
@@ -33,5 +34,19 @@ public class ModItemModelProvider extends ItemModelProvider {
|
|||||||
withExistingParent(ModItems.CAPYBARA_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
withExistingParent(ModItems.CAPYBARA_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
withExistingParent(ModItems.DUCK_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
withExistingParent(ModItems.DUCK_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
withExistingParent(ModItems.RAT_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
withExistingParent(ModItems.RAT_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
withExistingParent(ModItems.SQUIRREL_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
withExistingParent(ModItems.OTTER_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
/*
|
||||||
|
withExistingParent(ModItems.DEER_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
|
||||||
|
*/
|
||||||
|
withExistingParent(ModItems.BEAVER_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
/*
|
||||||
|
withExistingParent(ModItems.FALCON_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
withExistingParent(ModItems.MOLE_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
withExistingParent(ModItems.HERON_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
|
|
||||||
|
*/
|
||||||
|
withExistingParent(ModItems.WILD_BOAR_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,8 @@ import net.minecraft.data.PackOutput;
|
|||||||
import net.minecraft.data.tags.ItemTagsProvider;
|
import net.minecraft.data.tags.ItemTagsProvider;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.neoforged.fml.common.Mod;
|
||||||
|
import net.neoforged.neoforge.common.Tags;
|
||||||
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ovh.glitchlabs.masterwild.Item.ModItems;
|
import ovh.glitchlabs.masterwild.Item.ModItems;
|
||||||
@@ -20,7 +22,10 @@ public class ModItemTagProvider extends ItemTagsProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addTags(HolderLookup.Provider provider) {
|
protected void addTags(HolderLookup.Provider provider) {
|
||||||
//tag(ModTags.Items.TRANSFORMABLE_ITEMS);
|
tag(Tags.Items.FOODS)
|
||||||
|
.add(ModItems.BANANA.get())
|
||||||
|
.add(ModItems.ACORNS.get())
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@ public class ModLanguageProvider extends LanguageProvider {
|
|||||||
protected void addTranslations() {
|
protected void addTranslations() {
|
||||||
add(ModItems.BANANA.get(), "Banana");
|
add(ModItems.BANANA.get(), "Banana");
|
||||||
add(ModItems.BANANA_PEEL.get(), "Banana Peel");
|
add(ModItems.BANANA_PEEL.get(), "Banana Peel");
|
||||||
|
add(ModItems.ACORNS.get(), "Acorns");
|
||||||
|
|
||||||
add(ModEntities.PINGUIN.get(), "Pinguin");
|
add(ModEntities.PINGUIN.get(), "Pinguin");
|
||||||
add(ModEntities.FIREFLY.get(), "Firefly");
|
add(ModEntities.FIREFLY.get(), "Firefly");
|
||||||
@@ -29,6 +30,20 @@ public class ModLanguageProvider extends LanguageProvider {
|
|||||||
add(ModEntities.CAPYBARA.get(), "Capybara");
|
add(ModEntities.CAPYBARA.get(), "Capybara");
|
||||||
add(ModEntities.DUCK.get(), "Duck");
|
add(ModEntities.DUCK.get(), "Duck");
|
||||||
add(ModEntities.RAT.get(), "Rat");
|
add(ModEntities.RAT.get(), "Rat");
|
||||||
|
add(ModEntities.SQUIRREL.get(), "Squirrel");
|
||||||
|
add(ModEntities.OTTER.get(), "Otter");
|
||||||
|
/*
|
||||||
|
add(ModEntities.DEER.get(), "Deer");
|
||||||
|
|
||||||
|
*/
|
||||||
|
add(ModEntities.BEAVER.get(), "Beaver");
|
||||||
|
/*
|
||||||
|
add(ModEntities.FALCON.get(), "Falcon");
|
||||||
|
add(ModEntities.MOLE.get(), "Mole");
|
||||||
|
add(ModEntities.HERON.get(), "Heron");
|
||||||
|
|
||||||
|
*/
|
||||||
|
add(ModEntities.WILD_BOAR.get(), "Wild Boar");
|
||||||
|
|
||||||
add(ModItems.PINGUIN_SPAWN_EGG.get(), "Pinguin Spawn Egg");
|
add(ModItems.PINGUIN_SPAWN_EGG.get(), "Pinguin Spawn Egg");
|
||||||
add(ModItems.FIREFLY_SPAWN_EGG.get(), "Firefly Spawn Egg");
|
add(ModItems.FIREFLY_SPAWN_EGG.get(), "Firefly Spawn Egg");
|
||||||
@@ -42,6 +57,19 @@ public class ModLanguageProvider extends LanguageProvider {
|
|||||||
add(ModItems.CAPYBARA_SPAWN_EGG.get(), "Capybara Spawn Egg");
|
add(ModItems.CAPYBARA_SPAWN_EGG.get(), "Capybara Spawn Egg");
|
||||||
add(ModItems.DUCK_SPAWN_EGG.get(), "Duck Spawn Egg");
|
add(ModItems.DUCK_SPAWN_EGG.get(), "Duck Spawn Egg");
|
||||||
add(ModItems.RAT_SPAWN_EGG.get(), "Rat Spawn Egg");
|
add(ModItems.RAT_SPAWN_EGG.get(), "Rat Spawn Egg");
|
||||||
|
add(ModItems.SQUIRREL_SPAWN_EGG.get(), "Squirrel Spawn Egg");
|
||||||
|
add(ModItems.OTTER_SPAWN_EGG.get(), "Otter Spawn Egg");
|
||||||
|
/*
|
||||||
|
add(ModItems.DEER_SPAWN_EGG.get(), "Deer Spawn Egg");
|
||||||
|
*/
|
||||||
|
add(ModItems.BEAVER_SPAWN_EGG.get(), "Beaver Spawn Egg");
|
||||||
|
/*
|
||||||
|
add(ModItems.FALCON_SPAWN_EGG.get(), "Falcon Spawn Egg");
|
||||||
|
add(ModItems.MOLE_SPAWN_EGG.get(), "Mole Spawn Egg");
|
||||||
|
add(ModItems.HERON_SPAWN_EGG.get(), "Heron Spawn Egg");
|
||||||
|
|
||||||
|
*/
|
||||||
|
add(ModItems.WILD_BOAR_SPAWN_EGG.get(), "Wild Boar Spawn Egg");
|
||||||
|
|
||||||
add("creativetab.masterwild.masterwild", "MasterWild");
|
add("creativetab.masterwild.masterwild", "MasterWild");
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,43 @@ public class ModEntities {
|
|||||||
ENTITY_TYPES.register("rat", () -> EntityType.Builder.of(RatEntity::new, MobCategory.CREATURE)
|
ENTITY_TYPES.register("rat", () -> EntityType.Builder.of(RatEntity::new, MobCategory.CREATURE)
|
||||||
.sized(0.6f, 0.5f).build("rat"));
|
.sized(0.6f, 0.5f).build("rat"));
|
||||||
|
|
||||||
|
public static final Supplier<EntityType<SquirrelEntity>> SQUIRREL =
|
||||||
|
ENTITY_TYPES.register("squirrel", () -> EntityType.Builder.of(SquirrelEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.4f, 0.5f).build("squirrel"));
|
||||||
|
|
||||||
|
public static final Supplier<EntityType<OtterEntity>> OTTER =
|
||||||
|
ENTITY_TYPES.register("otter", () -> EntityType.Builder.of(OtterEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.5f, 0.4f).build("otter"));
|
||||||
|
/*
|
||||||
|
public static final Supplier<EntityType<DeerEntity>> DEER =
|
||||||
|
ENTITY_TYPES.register("deer", () -> EntityType.Builder.of(DeerEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.9f, 1.4f).build("deer"));
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static final Supplier<EntityType<BeaverEntity>> BEAVER =
|
||||||
|
ENTITY_TYPES.register("beaver", () -> EntityType.Builder.of(BeaverEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.6f, 0.5f).build("beaver"));
|
||||||
|
|
||||||
|
/*
|
||||||
|
public static final Supplier<EntityType<FalconEntity>> FALCON =
|
||||||
|
ENTITY_TYPES.register("falcon", () -> EntityType.Builder.of(FalconEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.5f, 0.4f).build("falcon"));
|
||||||
|
|
||||||
|
public static final Supplier<EntityType<MoleEntity>> MOLE =
|
||||||
|
ENTITY_TYPES.register("mole", () -> EntityType.Builder.of(MoleEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.3f, 0.25f).build("mole"));
|
||||||
|
|
||||||
|
public static final Supplier<EntityType<HeronEntity>> HERON =
|
||||||
|
ENTITY_TYPES.register("heron", () -> EntityType.Builder.of(HeronEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.6f, 1.2f).build("heron"));
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
public static final Supplier<EntityType<WildBoarEntity>> WILD_BOAR =
|
||||||
|
ENTITY_TYPES.register("wild_boar", () -> EntityType.Builder.of(WildBoarEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.9f, 0.9f).build("wild_boar"));
|
||||||
|
|
||||||
|
|
||||||
public static void register(IEventBus eventBus) {
|
public static void register(IEventBus eventBus) {
|
||||||
ENTITY_TYPES.register(eventBus);
|
ENTITY_TYPES.register(eventBus);
|
||||||
|
|||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.Beaver;// Made with Blockbench 5.2.1
|
||||||
|
// Exported for Minecraft version 1.17 or later with Mojang mappings
|
||||||
|
// Paste this class into your mod and generate all required imports
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
import net.minecraft.client.model.HierarchicalModel;
|
||||||
|
import net.minecraft.client.model.geom.ModelLayerLocation;
|
||||||
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
|
import net.minecraft.client.model.geom.PartPose;
|
||||||
|
import net.minecraft.client.model.geom.builders.*;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.BeaverEntity;
|
||||||
|
|
||||||
|
public class BeaverModel<T extends BeaverEntity> extends HierarchicalModel<T> {
|
||||||
|
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
|
||||||
|
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "beavermodel"), "main");
|
||||||
|
private final ModelPart beaver;
|
||||||
|
private final ModelPart body;
|
||||||
|
private final ModelPart L_Front_Leg;
|
||||||
|
private final ModelPart L_Back_leg;
|
||||||
|
private final ModelPart R_Front_leg;
|
||||||
|
private final ModelPart R_back_leg;
|
||||||
|
private final ModelPart head;
|
||||||
|
|
||||||
|
public BeaverModel(ModelPart root) {
|
||||||
|
this.beaver = root.getChild("beaver");
|
||||||
|
this.body = this.beaver.getChild("body");
|
||||||
|
this.L_Front_Leg = this.beaver.getChild("L_Front_Leg");
|
||||||
|
this.L_Back_leg = this.beaver.getChild("L_Back_leg");
|
||||||
|
this.R_Front_leg = this.beaver.getChild("R_Front_leg");
|
||||||
|
this.R_back_leg = this.beaver.getChild("R_back_leg");
|
||||||
|
this.head = this.beaver.getChild("head");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LayerDefinition createBodyLayer() {
|
||||||
|
MeshDefinition meshdefinition = new MeshDefinition();
|
||||||
|
PartDefinition partdefinition = meshdefinition.getRoot();
|
||||||
|
|
||||||
|
PartDefinition beaver = partdefinition.addOrReplaceChild("beaver", CubeListBuilder.create(), PartPose.offset(0.1667F, 20.5526F, 0.0742F));
|
||||||
|
|
||||||
|
PartDefinition body = beaver.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 0).addBox(-5.5F, -4.7157F, -5.7192F, 11.0F, 9.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offset(-0.1667F, -1.8369F, 1.645F));
|
||||||
|
|
||||||
|
PartDefinition cube_r1 = body.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 20).addBox(-1.0F, -0.7137F, -0.233F, 7.0F, 1.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.5F, -0.7157F, 5.0308F, -0.2182F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition L_Front_Leg = beaver.addOrReplaceChild("L_Front_Leg", CubeListBuilder.create().texOffs(44, 13).addBox(-1.75F, -1.25F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(44, 5).addBox(-1.75F, 1.75F, -3.0F, 4.0F, 0.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(5.3333F, 1.6974F, -2.8242F));
|
||||||
|
|
||||||
|
PartDefinition L_Back_leg = beaver.addOrReplaceChild("L_Back_leg", CubeListBuilder.create().texOffs(30, 32).addBox(-2.0F, -2.0F, -2.0F, 3.0F, 5.0F, 4.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(30, 41).addBox(-1.0F, 3.0F, -3.5F, 3.0F, 0.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(5.5833F, 0.4474F, 4.1758F));
|
||||||
|
|
||||||
|
PartDefinition R_Front_leg = beaver.addOrReplaceChild("R_Front_leg", CubeListBuilder.create().texOffs(44, 29).addBox(-1.25F, -1.25F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(44, 9).addBox(-2.25F, 1.75F, -3.0F, 4.0F, 0.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(-5.1667F, 1.6974F, -2.8242F));
|
||||||
|
|
||||||
|
PartDefinition R_back_leg = beaver.addOrReplaceChild("R_back_leg", CubeListBuilder.create().texOffs(36, 20).addBox(-1.0F, -2.0F, -2.0F, 3.0F, 5.0F, 4.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(44, 0).addBox(-2.0F, 3.0F, -3.5F, 3.0F, 0.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(-5.4167F, 0.4474F, 4.1758F));
|
||||||
|
|
||||||
|
PartDefinition head = beaver.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 32).addBox(-3.5F, -3.1F, -7.726F, 7.0F, 7.0F, 8.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(44, 35).addBox(-2.5F, -2.1F, -8.726F, 5.0F, 3.0F, 1.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(44, 19).addBox(-1.5F, 0.9F, -8.226F, 3.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offset(-0.1667F, -2.4526F, -4.3482F));
|
||||||
|
|
||||||
|
PartDefinition cube_r2 = head.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(36, 29).addBox(-6.0F, -2.0F, 3.0F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.0F, -2.1F, -6.726F, 0.0F, 0.1745F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r3 = head.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(30, 46).addBox(4.0F, -2.0F, 3.0F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, -2.1F, -6.726F, 0.0F, -0.1745F, 0.0F));
|
||||||
|
|
||||||
|
return LayerDefinition.create(meshdefinition, 64, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupAnim(BeaverEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||||
|
this.root().getAllParts().forEach(ModelPart::resetPose);
|
||||||
|
this.applyHeadRotation(netHeadYaw, headPitch);
|
||||||
|
this.walk(limbSwing, limbSwingAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyHeadRotation(float headYaw, float headPitch) {
|
||||||
|
headYaw = Mth.clamp(headYaw, -30f, 30f);
|
||||||
|
headPitch = Mth.clamp(headPitch, -25f, 45f);
|
||||||
|
this.head.yRot = headYaw * ((float) Math.PI / 180f);
|
||||||
|
this.head.xRot = headPitch * ((float) Math.PI / 180f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void walk(float limbSwing, float limbSwingAmount) {
|
||||||
|
float amount = 1.0F * limbSwingAmount;
|
||||||
|
this.R_Front_leg.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.L_Back_leg.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.L_Front_Leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
this.R_back_leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, int color) {
|
||||||
|
beaver.render(poseStack, vertexConsumer, packedLight, packedOverlay, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelPart root() {
|
||||||
|
return beaver;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.Beaver;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||||
|
import net.minecraft.client.renderer.entity.MobRenderer;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.BeaverEntity;
|
||||||
|
|
||||||
|
public class BeaverRenderer extends MobRenderer<BeaverEntity, BeaverModel<BeaverEntity>> {
|
||||||
|
private static final ResourceLocation TEXTURE =
|
||||||
|
ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "textures/entity/beaver.png");
|
||||||
|
private static final float ADULT_SCALE = 0.85f;
|
||||||
|
private static final float BABY_SCALE = 0.45f;
|
||||||
|
private static final float SHADOW = 0.25f;
|
||||||
|
|
||||||
|
public BeaverRenderer(EntityRendererProvider.Context context) {
|
||||||
|
super(context, new BeaverModel<>(context.bakeLayer(BeaverModel.LAYER_LOCATION)), SHADOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getTextureLocation(BeaverEntity entity) {
|
||||||
|
return TEXTURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void scale(BeaverEntity entity, PoseStack poseStack, float partialTick) {
|
||||||
|
float scale = entity.isBaby() ? BABY_SCALE : ADULT_SCALE;
|
||||||
|
poseStack.scale(scale, scale, scale);
|
||||||
|
this.shadowRadius = SHADOW * scale;
|
||||||
|
}
|
||||||
|
}
|
||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.Otter;// Made with Blockbench 5.2.1
|
||||||
|
// Exported for Minecraft version 1.17 or later with Mojang mappings
|
||||||
|
// Paste this class into your mod and generate all required imports
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
import net.minecraft.client.model.HierarchicalModel;
|
||||||
|
import net.minecraft.client.model.geom.ModelLayerLocation;
|
||||||
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
|
import net.minecraft.client.model.geom.PartPose;
|
||||||
|
import net.minecraft.client.model.geom.builders.*;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||||
|
import net.minecraft.client.renderer.entity.MobRenderer;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.OtterEntity;
|
||||||
|
|
||||||
|
public class OtterModel<T extends OtterEntity> extends HierarchicalModel<T> {
|
||||||
|
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
|
||||||
|
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "ottermodel"), "main");
|
||||||
|
private final ModelPart otter;
|
||||||
|
private final ModelPart body;
|
||||||
|
private final ModelPart tail;
|
||||||
|
private final ModelPart L_Front_leg;
|
||||||
|
private final ModelPart L_back_leg;
|
||||||
|
private final ModelPart R_Front_leg;
|
||||||
|
private final ModelPart R_back_leg;
|
||||||
|
private final ModelPart head;
|
||||||
|
|
||||||
|
public OtterModel(ModelPart root) {
|
||||||
|
this.otter = root.getChild("otter");
|
||||||
|
this.body = this.otter.getChild("body");
|
||||||
|
this.tail = this.body.getChild("tail");
|
||||||
|
this.L_Front_leg = this.otter.getChild("L_Front_leg");
|
||||||
|
this.L_back_leg = this.otter.getChild("L_back_leg");
|
||||||
|
this.R_Front_leg = this.otter.getChild("R_Front_leg");
|
||||||
|
this.R_back_leg = this.otter.getChild("R_back_leg");
|
||||||
|
this.head = this.otter.getChild("head");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LayerDefinition createBodyLayer() {
|
||||||
|
MeshDefinition meshdefinition = new MeshDefinition();
|
||||||
|
PartDefinition partdefinition = meshdefinition.getRoot();
|
||||||
|
|
||||||
|
PartDefinition otter = partdefinition.addOrReplaceChild("otter", CubeListBuilder.create(), PartPose.offset(0.0833F, 23.0F, -3.125F));
|
||||||
|
|
||||||
|
PartDefinition body = otter.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 0).addBox(-3.0F, -5.0F, -3.0F, 5.0F, 5.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offset(0.4167F, -2.0F, 2.125F));
|
||||||
|
|
||||||
|
PartDefinition tail = body.addOrReplaceChild("tail", CubeListBuilder.create().texOffs(22, 17).addBox(-1.0F, -1.5F, 0.0F, 3.0F, 3.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(-1.0F, -2.5F, 9.0F));
|
||||||
|
|
||||||
|
PartDefinition L_Front_leg = otter.addOrReplaceChild("L_Front_leg", CubeListBuilder.create().texOffs(22, 26).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(1.9167F, -2.0F, 1.375F));
|
||||||
|
|
||||||
|
PartDefinition L_back_leg = otter.addOrReplaceChild("L_back_leg", CubeListBuilder.create().texOffs(12, 33).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(1.9167F, -2.0F, 9.375F));
|
||||||
|
|
||||||
|
PartDefinition R_Front_leg = otter.addOrReplaceChild("R_Front_leg", CubeListBuilder.create().texOffs(24, 33).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(-2.0833F, -2.0F, 1.375F));
|
||||||
|
|
||||||
|
PartDefinition R_back_leg = otter.addOrReplaceChild("R_back_leg", CubeListBuilder.create().texOffs(0, 28).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(-2.0833F, -2.0F, 9.375F));
|
||||||
|
|
||||||
|
PartDefinition head = otter.addOrReplaceChild("head", CubeListBuilder.create().texOffs(34, 0).addBox(-6.0F, -1.5833F, -2.5833F, 3.0F, 4.0F, 0.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(34, 10).addBox(-4.0F, -3.5833F, -0.5833F, 1.0F, 2.0F, 0.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(0, 17).addBox(-3.0F, -4.5833F, -3.8333F, 6.0F, 6.0F, 5.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(12, 28).addBox(-2.0F, -1.5833F, -4.8333F, 4.0F, 3.0F, 1.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(34, 4).addBox(3.0F, -1.5833F, -2.5833F, 3.0F, 4.0F, 0.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(34, 8).addBox(3.0F, -3.5833F, -0.5833F, 1.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offset(-0.0833F, -6.4167F, -0.0417F));
|
||||||
|
|
||||||
|
return LayerDefinition.create(meshdefinition, 64, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupAnim(OtterEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||||
|
this.root().getAllParts().forEach(ModelPart::resetPose);
|
||||||
|
this.applyHeadRotation(netHeadYaw, headPitch);
|
||||||
|
this.walk(limbSwing, limbSwingAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyHeadRotation(float headYaw, float headPitch) {
|
||||||
|
headYaw = Mth.clamp(headYaw, -30f, 30f);
|
||||||
|
headPitch = Mth.clamp(headPitch, -25f, 45f);
|
||||||
|
this.head.yRot = headYaw * ((float) Math.PI / 180f);
|
||||||
|
this.head.xRot = headPitch * ((float) Math.PI / 180f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void walk(float limbSwing, float limbSwingAmount) {
|
||||||
|
float amount = 1.0F * limbSwingAmount;
|
||||||
|
this.R_Front_leg.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.L_back_leg.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.L_Front_leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
this.R_back_leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, int color) {
|
||||||
|
otter.render(poseStack, vertexConsumer, packedLight, packedOverlay, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelPart root() {
|
||||||
|
return otter;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.Otter;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||||
|
import net.minecraft.client.renderer.entity.MobRenderer;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.OtterEntity;
|
||||||
|
|
||||||
|
public class OtterRenderer extends MobRenderer<OtterEntity, OtterModel<OtterEntity>> {
|
||||||
|
private static final ResourceLocation TEXTURE =
|
||||||
|
ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "textures/entity/otter.png");
|
||||||
|
private static final float ADULT_SCALE = 0.8f;
|
||||||
|
private static final float BABY_SCALE = 0.45f;
|
||||||
|
private static final float SHADOW = 0.25f;
|
||||||
|
|
||||||
|
public OtterRenderer(EntityRendererProvider.Context context) {
|
||||||
|
super(context, new OtterModel<>(context.bakeLayer(OtterModel.LAYER_LOCATION)), SHADOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getTextureLocation(OtterEntity entity) {
|
||||||
|
return TEXTURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void scale(OtterEntity entity, PoseStack poseStack, float partialTick) {
|
||||||
|
float scale = entity.isBaby() ? BABY_SCALE : ADULT_SCALE;
|
||||||
|
poseStack.scale(scale, scale, scale);
|
||||||
|
this.shadowRadius = SHADOW * scale;
|
||||||
|
}
|
||||||
|
}
|
||||||
+155
@@ -0,0 +1,155 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.Squirrel;// Made with Blockbench 5.2.1
|
||||||
|
// Exported for Minecraft version 1.17 or later with Mojang mappings
|
||||||
|
// Paste this class into your mod and generate all required imports
|
||||||
|
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
import net.minecraft.client.model.HierarchicalModel;
|
||||||
|
import net.minecraft.client.model.geom.ModelLayerLocation;
|
||||||
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
|
import net.minecraft.client.model.geom.PartPose;
|
||||||
|
import net.minecraft.client.model.geom.builders.*;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.SquirrelEntity;
|
||||||
|
|
||||||
|
public class SquirrelModel<T extends SquirrelEntity> extends HierarchicalModel<T> {
|
||||||
|
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
|
||||||
|
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "squirrelmodel"), "main");
|
||||||
|
private final ModelPart Squirrel;
|
||||||
|
private final ModelPart head;
|
||||||
|
private final ModelPart body;
|
||||||
|
private final ModelPart R_Back_Leg;
|
||||||
|
private final ModelPart R_Back_down_Leg;
|
||||||
|
private final ModelPart R_Front_leg;
|
||||||
|
private final ModelPart L_front_Leg;
|
||||||
|
private final ModelPart L_Back_Leg;
|
||||||
|
private final ModelPart L_Back_down_leg;
|
||||||
|
private final ModelPart tail;
|
||||||
|
|
||||||
|
public SquirrelModel(ModelPart root) {
|
||||||
|
this.Squirrel = root.getChild("Squirrel");
|
||||||
|
this.head = this.Squirrel.getChild("head");
|
||||||
|
this.body = this.Squirrel.getChild("body");
|
||||||
|
this.R_Back_Leg = this.Squirrel.getChild("R_Back_Leg");
|
||||||
|
this.R_Back_down_Leg = this.R_Back_Leg.getChild("R_Back_down_Leg");
|
||||||
|
this.R_Front_leg = this.Squirrel.getChild("R_Front_leg");
|
||||||
|
this.L_front_Leg = this.Squirrel.getChild("L_front_Leg");
|
||||||
|
this.L_Back_Leg = this.Squirrel.getChild("L_Back_Leg");
|
||||||
|
this.L_Back_down_leg = this.L_Back_Leg.getChild("L_Back_down_leg");
|
||||||
|
this.tail = this.Squirrel.getChild("tail");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LayerDefinition createBodyLayer() {
|
||||||
|
MeshDefinition meshdefinition = new MeshDefinition();
|
||||||
|
PartDefinition partdefinition = meshdefinition.getRoot();
|
||||||
|
|
||||||
|
PartDefinition Squirrel = partdefinition.addOrReplaceChild("Squirrel", CubeListBuilder.create(), PartPose.offset(0.0F, 25.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition head = Squirrel.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 9).addBox(-2.0F, -2.7926F, -3.8209F, 4.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -5.2074F, -2.1791F));
|
||||||
|
|
||||||
|
PartDefinition cube_r1 = head.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(16, 26).addBox(1.0F, -2.0F, -2.0F, 1.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.7926F, -0.3209F, 0.0F, 0.0F, 0.3491F));
|
||||||
|
|
||||||
|
PartDefinition cube_r2 = head.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(20, 0).addBox(-1.0F, -2.0F, -1.0F, 3.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.5F, 1.2074F, -4.3209F, 0.2182F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r3 = head.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(26, 14).addBox(-2.0F, -2.0F, -2.0F, 1.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.7926F, -0.3209F, 0.0F, 0.0F, -0.3491F));
|
||||||
|
|
||||||
|
PartDefinition body = Squirrel.addOrReplaceChild("body", CubeListBuilder.create(), PartPose.offset(0.0F, -4.616F, 1.1651F));
|
||||||
|
|
||||||
|
PartDefinition cube_r4 = body.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(16, 9).addBox(-1.0F, -1.0F, 1.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.5F, -1.634F, -2.1651F, -0.5236F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r5 = body.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(0, 0).addBox(-2.0F, -3.0F, -1.0F, 4.0F, 3.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.866F, -3.1651F, -0.5236F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition R_Back_Leg = Squirrel.addOrReplaceChild("R_Back_Leg", CubeListBuilder.create(), PartPose.offset(-2.5305F, -3.558F, 0.3338F));
|
||||||
|
|
||||||
|
PartDefinition cube_r6 = R_Back_Leg.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(16, 14).addBox(1.0F, -2.0F, 1.0F, 1.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.4695F, -0.192F, -2.3338F, -0.5236F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition R_Back_down_Leg = R_Back_Leg.addOrReplaceChild("R_Back_down_Leg", CubeListBuilder.create(), PartPose.offset(0.5305F, 2.558F, 1.1662F));
|
||||||
|
|
||||||
|
PartDefinition cube_r7 = R_Back_down_Leg.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(8, 26).addBox(-1.0F, -1.0F, -2.0F, 1.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.1309F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition R_Front_leg = Squirrel.addOrReplaceChild("R_Front_leg", CubeListBuilder.create().texOffs(4, 29).addBox(-0.5F, -0.25F, -0.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-1.75F, -3.75F, -2.0F));
|
||||||
|
|
||||||
|
PartDefinition L_front_Leg = Squirrel.addOrReplaceChild("L_front_Leg", CubeListBuilder.create().texOffs(30, 0).addBox(-0.5F, -0.25F, -0.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(1.75F, -3.75F, -2.0F));
|
||||||
|
|
||||||
|
PartDefinition L_Back_Leg = Squirrel.addOrReplaceChild("L_Back_Leg", CubeListBuilder.create(), PartPose.offset(2.5305F, -3.558F, 0.3338F));
|
||||||
|
|
||||||
|
PartDefinition cube_r8 = L_Back_Leg.addOrReplaceChild("cube_r8", CubeListBuilder.create().texOffs(0, 17).addBox(-2.0F, -2.0F, 1.0F, 1.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.4695F, -0.192F, -2.3338F, -0.5236F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition L_Back_down_leg = L_Back_Leg.addOrReplaceChild("L_Back_down_leg", CubeListBuilder.create(), PartPose.offset(-0.5305F, 2.558F, 1.1662F));
|
||||||
|
|
||||||
|
PartDefinition cube_r9 = L_Back_down_leg.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(20, 4).addBox(0.0F, -1.0F, -2.0F, 1.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -0.1309F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition tail = Squirrel.addOrReplaceChild("tail", CubeListBuilder.create(), PartPose.offset(0.0F, -2.9035F, 3.0352F));
|
||||||
|
|
||||||
|
PartDefinition cube_r10 = tail.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(18, 20).addBox(-1.0F, -4.0F, -1.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -5.3465F, 0.9648F, 0.8727F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r11 = tail.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(30, 24).addBox(-1.0F, -4.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0F, -4.8465F, 1.2148F, 0.8731F, -0.028F, -0.0334F));
|
||||||
|
|
||||||
|
PartDefinition cube_r12 = tail.addOrReplaceChild("cube_r12", CubeListBuilder.create().texOffs(30, 18).addBox(-1.0F, -4.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0F, -4.0965F, 0.4648F, 0.8745F, 0.0561F, 0.0669F));
|
||||||
|
|
||||||
|
PartDefinition cube_r13 = tail.addOrReplaceChild("cube_r13", CubeListBuilder.create().texOffs(8, 30).addBox(-1.0F, -3.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0F, -2.5965F, 0.7148F, 0.176F, -0.1289F, -0.0229F));
|
||||||
|
|
||||||
|
PartDefinition cube_r14 = tail.addOrReplaceChild("cube_r14", CubeListBuilder.create().texOffs(12, 30).addBox(-1.0F, -3.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0F, -2.5965F, -0.2852F, 0.1752F, 0.0859F, 0.0152F));
|
||||||
|
|
||||||
|
PartDefinition cube_r15 = tail.addOrReplaceChild("cube_r15", CubeListBuilder.create().texOffs(28, 4).addBox(1.0F, -4.0F, -1.0F, 0.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.5F, -2.0965F, 3.2148F, 0.176F, 0.1289F, 0.0229F));
|
||||||
|
|
||||||
|
PartDefinition cube_r16 = tail.addOrReplaceChild("cube_r16", CubeListBuilder.create().texOffs(26, 18).addBox(-1.0F, -4.0F, -1.0F, 0.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, -2.0965F, 3.2148F, 0.176F, -0.1289F, -0.0229F));
|
||||||
|
|
||||||
|
PartDefinition cube_r17 = tail.addOrReplaceChild("cube_r17", CubeListBuilder.create().texOffs(22, 26).addBox(1.0F, -3.0F, -1.0F, 0.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.5F, -6.8465F, 1.7148F, 0.8959F, 0.1945F, 0.237F));
|
||||||
|
|
||||||
|
PartDefinition cube_r18 = tail.addOrReplaceChild("cube_r18", CubeListBuilder.create().texOffs(26, 23).addBox(-1.0F, -3.0F, -1.0F, 0.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, -6.8465F, 1.7148F, 0.8959F, -0.1945F, -0.237F));
|
||||||
|
|
||||||
|
PartDefinition cube_r19 = tail.addOrReplaceChild("cube_r19", CubeListBuilder.create().texOffs(16, 30).addBox(-1.0F, -4.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.0F, -4.8465F, 1.2148F, 0.8731F, 0.028F, 0.0334F));
|
||||||
|
|
||||||
|
PartDefinition cube_r20 = tail.addOrReplaceChild("cube_r20", CubeListBuilder.create().texOffs(30, 21).addBox(-1.0F, -4.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.0F, -4.0965F, 0.4648F, 0.8745F, -0.0561F, -0.0669F));
|
||||||
|
|
||||||
|
PartDefinition cube_r21 = tail.addOrReplaceChild("cube_r21", CubeListBuilder.create().texOffs(30, 9).addBox(-1.0F, -3.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.0F, -2.5965F, -0.2852F, 0.1752F, -0.0859F, -0.0152F));
|
||||||
|
|
||||||
|
PartDefinition cube_r22 = tail.addOrReplaceChild("cube_r22", CubeListBuilder.create().texOffs(10, 17).addBox(-1.0F, -3.0F, 1.0F, 2.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.0F, -2.5965F, 0.7148F, 0.176F, 0.1289F, 0.0229F));
|
||||||
|
|
||||||
|
PartDefinition cube_r23 = tail.addOrReplaceChild("cube_r23", CubeListBuilder.create().texOffs(0, 23).addBox(-1.0F, -4.0F, -1.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.0965F, 1.2148F, 0.1745F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r24 = tail.addOrReplaceChild("cube_r24", CubeListBuilder.create().texOffs(26, 28).addBox(1.0F, -3.0F, -1.0F, 0.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.5F, 1.1535F, 1.7148F, -0.3155F, 0.2494F, -0.0804F));
|
||||||
|
|
||||||
|
PartDefinition cube_r25 = tail.addOrReplaceChild("cube_r25", CubeListBuilder.create().texOffs(0, 29).addBox(-1.0F, -3.0F, -1.0F, 0.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, 1.1535F, 1.7148F, -0.3155F, -0.2494F, 0.0804F));
|
||||||
|
|
||||||
|
PartDefinition cube_r26 = tail.addOrReplaceChild("cube_r26", CubeListBuilder.create().texOffs(10, 20).addBox(-1.0F, -4.0F, -1.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 1.1535F, -0.0352F, -0.3054F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
return LayerDefinition.create(meshdefinition, 64, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupAnim(SquirrelEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||||
|
this.root().getAllParts().forEach(ModelPart::resetPose);
|
||||||
|
this.applyHeadRotation(netHeadYaw, headPitch);
|
||||||
|
this.walk(limbSwing, limbSwingAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyHeadRotation(float headYaw, float headPitch) {
|
||||||
|
headYaw = Mth.clamp(headYaw, -30f, 30f);
|
||||||
|
headPitch = Mth.clamp(headPitch, -25f, 45f);
|
||||||
|
this.head.yRot = headYaw * ((float) Math.PI / 180f);
|
||||||
|
this.head.xRot = headPitch * ((float) Math.PI / 180f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void walk(float limbSwing, float limbSwingAmount) {
|
||||||
|
float amount = 1.0F * limbSwingAmount;
|
||||||
|
this.R_Front_leg.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.L_Back_Leg.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.L_front_Leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
this.R_Back_Leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, int color) {
|
||||||
|
Squirrel.render(poseStack, vertexConsumer, packedLight, packedOverlay, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelPart root() {
|
||||||
|
return Squirrel;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.Squirrel;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||||
|
import net.minecraft.client.renderer.entity.MobRenderer;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.SquirrelEntity;
|
||||||
|
|
||||||
|
public class SquirrelRenderer extends MobRenderer<SquirrelEntity, SquirrelModel<SquirrelEntity>> {
|
||||||
|
private static final ResourceLocation TEXTURE =
|
||||||
|
ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "textures/entity/squirrel.png");
|
||||||
|
private static final float ADULT_SCALE = 1.0f;
|
||||||
|
private static final float BABY_SCALE = 0.45f;
|
||||||
|
private static final float SHADOW = 0.25f;
|
||||||
|
|
||||||
|
public SquirrelRenderer(EntityRendererProvider.Context context) {
|
||||||
|
super(context, new SquirrelModel<>(context.bakeLayer(SquirrelModel.LAYER_LOCATION)), SHADOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getTextureLocation(SquirrelEntity entity) {
|
||||||
|
return TEXTURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void scale(SquirrelEntity entity, PoseStack poseStack, float partialTick) {
|
||||||
|
float scale = entity.isBaby() ? BABY_SCALE : ADULT_SCALE;
|
||||||
|
poseStack.scale(scale, scale, scale);
|
||||||
|
this.shadowRadius = SHADOW * scale;
|
||||||
|
}
|
||||||
|
}
|
||||||
+97
@@ -0,0 +1,97 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.WildBoar;// Made with Blockbench 5.2.1
|
||||||
|
// Exported for Minecraft version 1.17 or later with Mojang mappings
|
||||||
|
// Paste this class into your mod and generate all required imports
|
||||||
|
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
import net.minecraft.client.model.HierarchicalModel;
|
||||||
|
import net.minecraft.client.model.geom.ModelLayerLocation;
|
||||||
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
|
import net.minecraft.client.model.geom.PartPose;
|
||||||
|
import net.minecraft.client.model.geom.builders.*;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.WildBoarEntity;
|
||||||
|
|
||||||
|
public class wildboarModel<T extends WildBoarEntity> extends HierarchicalModel<T> {
|
||||||
|
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
|
||||||
|
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "wildboarmodel"), "main");
|
||||||
|
private final ModelPart wildBoar;
|
||||||
|
private final ModelPart body;
|
||||||
|
private final ModelPart head;
|
||||||
|
private final ModelPart leg1;
|
||||||
|
private final ModelPart leg2;
|
||||||
|
private final ModelPart leg3;
|
||||||
|
private final ModelPart leg4;
|
||||||
|
|
||||||
|
public wildboarModel(ModelPart root) {
|
||||||
|
this.wildBoar = root.getChild("wildBoar");
|
||||||
|
this.body = this.wildBoar.getChild("body");
|
||||||
|
this.head = this.wildBoar.getChild("head");
|
||||||
|
this.leg1 = this.wildBoar.getChild("leg1");
|
||||||
|
this.leg2 = this.wildBoar.getChild("leg2");
|
||||||
|
this.leg3 = this.wildBoar.getChild("leg3");
|
||||||
|
this.leg4 = this.wildBoar.getChild("leg4");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LayerDefinition createBodyLayer() {
|
||||||
|
MeshDefinition meshdefinition = new MeshDefinition();
|
||||||
|
PartDefinition partdefinition = meshdefinition.getRoot();
|
||||||
|
|
||||||
|
PartDefinition wildBoar = partdefinition.addOrReplaceChild("wildBoar", CubeListBuilder.create(), PartPose.offset(0.0F, 11.0F, 2.0F));
|
||||||
|
|
||||||
|
PartDefinition body = wildBoar.addOrReplaceChild("body", CubeListBuilder.create().texOffs(28, 8).addBox(-5.0F, -10.0F, -7.0F, 10.0F, 16.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 1.5708F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r1 = body.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 20).addBox(1.0F, -2.0F, -1.0F, 0.0F, 5.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 7.0F, -1.0F, -1.5708F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition head = wildBoar.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -4.0F, -8.0F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(15, 15).addBox(-2.0F, 0.0F, -10.0F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 1.0F, -8.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r2 = head.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(16, 22).mirror().addBox(0.0F, -3.0F, 0.0F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false)
|
||||||
|
.texOffs(22, 22).addBox(5.0F, -3.0F, 0.0F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-3.0F, 2.25F, -9.5F, 0.5672F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition leg1 = wildBoar.addOrReplaceChild("leg1", CubeListBuilder.create().texOffs(0, 16).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(-3.0F, 7.0F, 5.0F));
|
||||||
|
|
||||||
|
PartDefinition leg2 = wildBoar.addOrReplaceChild("leg2", CubeListBuilder.create().texOffs(0, 16).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(3.0F, 7.0F, 5.0F));
|
||||||
|
|
||||||
|
PartDefinition leg3 = wildBoar.addOrReplaceChild("leg3", CubeListBuilder.create().texOffs(0, 16).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(-3.0F, 7.0F, -7.0F));
|
||||||
|
|
||||||
|
PartDefinition leg4 = wildBoar.addOrReplaceChild("leg4", CubeListBuilder.create().texOffs(0, 16).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(3.0F, 7.0F, -7.0F));
|
||||||
|
|
||||||
|
return LayerDefinition.create(meshdefinition, 64, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupAnim(WildBoarEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||||
|
this.root().getAllParts().forEach(ModelPart::resetPose);
|
||||||
|
this.applyHeadRotation(netHeadYaw, headPitch);
|
||||||
|
this.walk(limbSwing, limbSwingAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyHeadRotation(float headYaw, float headPitch) {
|
||||||
|
headYaw = Mth.clamp(headYaw, -30f, 30f);
|
||||||
|
headPitch = Mth.clamp(headPitch, -25f, 45f);
|
||||||
|
this.head.yRot = headYaw * ((float) Math.PI / 180f);
|
||||||
|
this.head.xRot = headPitch * ((float) Math.PI / 180f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void walk(float limbSwing, float limbSwingAmount) {
|
||||||
|
float amount = 1.0F * limbSwingAmount;
|
||||||
|
this.leg3.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.leg2.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.leg4.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
this.leg1.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, int color) {
|
||||||
|
wildBoar.render(poseStack, vertexConsumer, packedLight, packedOverlay, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelPart root() {
|
||||||
|
return wildBoar;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.WildBoar;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||||
|
import net.minecraft.client.renderer.entity.MobRenderer;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.WildBoarEntity;
|
||||||
|
|
||||||
|
public class wildboarRenderer extends MobRenderer<WildBoarEntity, wildboarModel<WildBoarEntity>> {
|
||||||
|
private static final ResourceLocation TEXTURE =
|
||||||
|
ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "textures/entity/wildboar.png");
|
||||||
|
private static final float ADULT_SCALE = 1.0f;
|
||||||
|
private static final float BABY_SCALE = 0.45f;
|
||||||
|
private static final float SHADOW = 0.25f;
|
||||||
|
|
||||||
|
public wildboarRenderer(EntityRendererProvider.Context context) {
|
||||||
|
super(context, new wildboarModel<>(context.bakeLayer(wildboarModel.LAYER_LOCATION)), SHADOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getTextureLocation(WildBoarEntity entity) {
|
||||||
|
return TEXTURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void scale(WildBoarEntity entity, PoseStack poseStack, float partialTick) {
|
||||||
|
float scale = entity.isBaby() ? BABY_SCALE : ADULT_SCALE;
|
||||||
|
poseStack.scale(scale, scale, scale);
|
||||||
|
this.shadowRadius = SHADOW * scale;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.*;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.pathfinder.PathType;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
public class BeaverEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(Items.OAK_SAPLING, Items.BIRCH_SAPLING);
|
||||||
|
|
||||||
|
public BeaverEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
this.setPathfindingMalus(PathType.WATER, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 8)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.25)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 10)
|
||||||
|
.add(Attributes.STEP_HEIGHT, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new PanicGoal(this, 1.5));
|
||||||
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1));
|
||||||
|
this.goalSelector.addGoal(5, new RandomStrollGoal(this, 0.9));
|
||||||
|
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||||
|
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return ModEntities.BEAVER.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.FOX_SNIFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.RABBIT_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.RABBIT_DEATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.*;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
public class DeerEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(Items.WHEAT, Items.CARROT);
|
||||||
|
|
||||||
|
public DeerEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 10)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.3)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 14)
|
||||||
|
.add(Attributes.STEP_HEIGHT, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new PanicGoal(this, 1.8));
|
||||||
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(4, new AvoidEntityGoal<>(this, Player.class, 8.0F, 1.4, 1.6));
|
||||||
|
this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.1));
|
||||||
|
this.goalSelector.addGoal(6, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||||
|
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return null; //ModEntities.DEER.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.FOX_AMBIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.FOX_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.FOX_DEATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
|
||||||
|
import net.minecraft.world.entity.ai.goal.FloatGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.BreedGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.TemptGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
|
||||||
|
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
|
||||||
|
import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
|
||||||
|
import net.minecraft.world.entity.ai.navigation.PathNavigation;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
public class FalconEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(Items.CHICKEN, Items.RABBIT);
|
||||||
|
|
||||||
|
public FalconEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
this.moveControl = new FlyingMoveControl(this, 20, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 6)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.3)
|
||||||
|
.add(Attributes.FLYING_SPEED, 0.4)
|
||||||
|
.add(Attributes.ATTACK_DAMAGE, 3)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PathNavigation createNavigation(Level level) {
|
||||||
|
FlyingPathNavigation navigation = new FlyingPathNavigation(this, level);
|
||||||
|
navigation.setCanOpenDoors(false);
|
||||||
|
navigation.setCanFloat(true);
|
||||||
|
navigation.setCanPassDoors(true);
|
||||||
|
return navigation;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2, true));
|
||||||
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(4, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(5, new LookAtPlayerGoal(this, Player.class, 8.0F));
|
||||||
|
this.goalSelector.addGoal(6, new RandomLookAroundGoal(this));
|
||||||
|
|
||||||
|
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
|
||||||
|
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, SquirrelEntity.class, true));
|
||||||
|
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, RatEntity.class, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoGravity() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return null; //ModEntities.FALCON.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.PHANTOM_AMBIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.PHANTOM_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.PHANTOM_DEATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.*;
|
||||||
|
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
|
||||||
|
import net.minecraft.world.entity.animal.AbstractFish;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.pathfinder.PathType;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
|
||||||
|
public class HeronEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(Items.COD, Items.SALMON);
|
||||||
|
|
||||||
|
public HeronEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
this.setPathfindingMalus(PathType.WATER, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 6)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.3)
|
||||||
|
.add(Attributes.ATTACK_DAMAGE, 1)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 12)
|
||||||
|
.add(Attributes.STEP_HEIGHT, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));
|
||||||
|
this.goalSelector.addGoal(2, new PanicGoal(this, 1.5));
|
||||||
|
this.goalSelector.addGoal(3, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(4, new TemptGoal(this, 1.0, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(6, new WaterAvoidingRandomStrollGoal(this, 0.8));
|
||||||
|
this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||||
|
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
|
||||||
|
|
||||||
|
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, AbstractFish.class, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return null; //ModEntities.HERON.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.ALLAY_AMBIENT_WITHOUT_ITEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.ALLAY_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.ALLAY_DEATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.*;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
public class MoleEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(Items.SWEET_BERRIES);
|
||||||
|
|
||||||
|
public MoleEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 3)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.18)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 6)
|
||||||
|
.add(Attributes.STEP_HEIGHT, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new PanicGoal(this, 1.8));
|
||||||
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(3, new TemptGoal(this, 1.0, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(4, new AvoidEntityGoal<>(this, Player.class, 5.0F, 1.4, 1.5));
|
||||||
|
this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(6, new WaterAvoidingRandomStrollGoal(this, 0.7));
|
||||||
|
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return null;//ModEntities.MOLE.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.SILVERFISH_AMBIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.SILVERFISH_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.SILVERFISH_DEATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.*;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.pathfinder.PathType;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
public class OtterEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(Items.COD, Items.SALMON);
|
||||||
|
|
||||||
|
public OtterEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
this.setPathfindingMalus(PathType.WATER, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 6)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.3)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 10)
|
||||||
|
.add(Attributes.STEP_HEIGHT, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new PanicGoal(this, 1.6));
|
||||||
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1));
|
||||||
|
this.goalSelector.addGoal(5, new RandomStrollGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||||
|
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return ModEntities.OTTER.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.TURTLE_AMBIENT_LAND;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.TURTLE_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.TURTLE_DEATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.*;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.Item.ModItems;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
|
||||||
|
public class SquirrelEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(ModItems.ACORNS);
|
||||||
|
|
||||||
|
public SquirrelEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 4)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.35)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 10)
|
||||||
|
.add(Attributes.STEP_HEIGHT, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0));
|
||||||
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(3, new TemptGoal(this, 1.2, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(4, new AvoidEntityGoal<>(this, Player.class, 6.0F, 1.6, 1.8));
|
||||||
|
this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.2));
|
||||||
|
this.goalSelector.addGoal(6, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||||
|
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dropCustomDeathLoot(ServerLevel serverLevel, DamageSource source, boolean recentlyHit) {
|
||||||
|
super.dropCustomDeathLoot(serverLevel, source, recentlyHit);
|
||||||
|
this.spawnAtLocation(new ItemStack(ModItems.ACORNS.get()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return ModEntities.SQUIRREL.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.PARROT_AMBIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.PARROT_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.PARROT_DEATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.*;
|
||||||
|
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
|
||||||
|
public class WildBoarEntity extends Animal {
|
||||||
|
private static final Ingredient FOOD = Ingredient.of(Items.CARROT, Items.POTATO);
|
||||||
|
|
||||||
|
public WildBoarEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 14)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.28)
|
||||||
|
.add(Attributes.ATTACK_DAMAGE, 4)
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 12)
|
||||||
|
.add(Attributes.KNOCKBACK_RESISTANCE, 0.2)
|
||||||
|
.add(Attributes.STEP_HEIGHT, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.3, true));
|
||||||
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, FOOD, false));
|
||||||
|
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1));
|
||||||
|
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||||
|
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||||
|
|
||||||
|
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFood(ItemStack stack) {
|
||||||
|
return FOOD.test(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
||||||
|
return ModEntities.WILD_BOAR.get().create(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getAmbientSound() {
|
||||||
|
return SoundEvents.PIG_AMBIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getHurtSound(DamageSource damageSource) {
|
||||||
|
return SoundEvents.PIG_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEvent getDeathSound() {
|
||||||
|
return SoundEvents.PIG_DEATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,11 +6,15 @@ import net.neoforged.neoforge.client.event.EntityRenderersEvent;
|
|||||||
import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent;
|
import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent;
|
||||||
import ovh.glitchlabs.masterwild.Masterwild;
|
import ovh.glitchlabs.masterwild.Masterwild;
|
||||||
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.Beaver.BeaverModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Monkey.MonkeyModel;
|
import ovh.glitchlabs.masterwild.entity.client.Monkey.MonkeyModel;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.Otter.OtterModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Pinguin.PinguinModel;
|
import ovh.glitchlabs.masterwild.entity.client.Pinguin.PinguinModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Raccoon.RaccoonModel;
|
import ovh.glitchlabs.masterwild.entity.client.Raccoon.RaccoonModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Rooster.RoosterModel;
|
import ovh.glitchlabs.masterwild.entity.client.Rooster.RoosterModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.Shark.SharkModel;
|
import ovh.glitchlabs.masterwild.entity.client.Shark.SharkModel;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.Squirrel.SquirrelModel;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.WildBoar.wildboarModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.butterfly.ButterflyModel;
|
import ovh.glitchlabs.masterwild.entity.client.butterfly.ButterflyModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.capibara.CapybaraModel;
|
import ovh.glitchlabs.masterwild.entity.client.capibara.CapybaraModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.duck.duckModel;
|
import ovh.glitchlabs.masterwild.entity.client.duck.duckModel;
|
||||||
@@ -36,6 +40,14 @@ public class ModEventBusEvents {
|
|||||||
event.registerLayerDefinition(CapybaraModel.LAYER_LOCATION, CapybaraModel::createBodyLayer);
|
event.registerLayerDefinition(CapybaraModel.LAYER_LOCATION, CapybaraModel::createBodyLayer);
|
||||||
event.registerLayerDefinition(duckModel.LAYER_LOCATION, duckModel::createBodyLayer);
|
event.registerLayerDefinition(duckModel.LAYER_LOCATION, duckModel::createBodyLayer);
|
||||||
event.registerLayerDefinition(ratModel.LAYER_LOCATION, ratModel::createBodyLayer);
|
event.registerLayerDefinition(ratModel.LAYER_LOCATION, ratModel::createBodyLayer);
|
||||||
|
event.registerLayerDefinition(BeaverModel.LAYER_LOCATION, BeaverModel::createBodyLayer);
|
||||||
|
//event.registerLayerDefinition(DeerModel.LAYER_LOCATION, DeerModel::createBodyLayer);
|
||||||
|
//event.registerLayerDefinition(FalconModel.LAYER_LOCATION, FalconModel::createBodyLayer);
|
||||||
|
//event.registerLayerDefinition(HeronModel.LAYER_LOCATION, HeronModel::createBodyLayer);
|
||||||
|
//event.registerLayerDefinition(MoleModel.LAYER_LOCATION, MoleModel::createBodyLayer);
|
||||||
|
event.registerLayerDefinition(OtterModel.LAYER_LOCATION, OtterModel::createBodyLayer);
|
||||||
|
event.registerLayerDefinition(SquirrelModel.LAYER_LOCATION, SquirrelModel::createBodyLayer);
|
||||||
|
event.registerLayerDefinition(wildboarModel.LAYER_LOCATION, wildboarModel::createBodyLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@@ -51,5 +63,13 @@ public class ModEventBusEvents {
|
|||||||
event.put(ModEntities.CAPYBARA.get(), CapybaraEntity.createAttributes().build());
|
event.put(ModEntities.CAPYBARA.get(), CapybaraEntity.createAttributes().build());
|
||||||
event.put(ModEntities.DUCK.get(), duckEntity.createAttributes().build());
|
event.put(ModEntities.DUCK.get(), duckEntity.createAttributes().build());
|
||||||
event.put(ModEntities.RAT.get(), RatEntity.createAttributes().build());
|
event.put(ModEntities.RAT.get(), RatEntity.createAttributes().build());
|
||||||
|
event.put(ModEntities.BEAVER.get(), BeaverEntity.createAttributes().build());
|
||||||
|
//event.put(ModEntities.DEER.get(), DeerEntity.createAttributes().build());
|
||||||
|
//event.put(ModEntities.FALCON.get(), FalconEntity.createAttributes().build());
|
||||||
|
//event.put(ModEntities.HERON.get(), HeronEntity.createAttributes().build());
|
||||||
|
//event.put(ModEntities.MOLE.get(), MoleEntity.createAttributes().build());
|
||||||
|
event.put(ModEntities.OTTER.get(), OtterEntity.createAttributes().build());
|
||||||
|
event.put(ModEntities.SQUIRREL.get(), SquirrelEntity.createAttributes().build());
|
||||||
|
event.put(ModEntities.WILD_BOAR.get(), WildBoarEntity.createAttributes().build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,32 @@ public class ModSpawnPlacements {
|
|||||||
event.register(ModEntities.RAT.get(), SpawnPlacementTypes.ON_GROUND,
|
event.register(ModEntities.RAT.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
event.register(ModEntities.SQUIRREL.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
event.register(ModEntities.OTTER.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
/*
|
||||||
|
event.register(ModEntities.DEER.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
*/
|
||||||
|
event.register(ModEntities.BEAVER.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
/*
|
||||||
|
event.register(ModEntities.MOLE.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
event.register(ModEntities.HERON.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
|
||||||
|
*/
|
||||||
|
event.register(ModEntities.WILD_BOAR.get(), SpawnPlacementTypes.ON_GROUND,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules,
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
|
||||||
event.register(ModEntities.SHARK.get(), SpawnPlacementTypes.IN_WATER,
|
event.register(ModEntities.SHARK.get(), SpawnPlacementTypes.IN_WATER,
|
||||||
Heightmap.Types.OCEAN_FLOOR, WaterAnimal::checkSurfaceWaterAnimalSpawnRules,
|
Heightmap.Types.OCEAN_FLOOR, WaterAnimal::checkSurfaceWaterAnimalSpawnRules,
|
||||||
@@ -55,5 +81,12 @@ public class ModSpawnPlacements {
|
|||||||
Heightmap.Types.MOTION_BLOCKING,
|
Heightmap.Types.MOTION_BLOCKING,
|
||||||
(type, level, reason, pos, random) -> level.getLevel().isDay() && level.canSeeSky(pos),
|
(type, level, reason, pos, random) -> level.getLevel().isDay() && level.canSeeSky(pos),
|
||||||
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
/*
|
||||||
|
event.register(ModEntities.FALCON.get(), SpawnPlacementTypes.NO_RESTRICTIONS,
|
||||||
|
Heightmap.Types.MOTION_BLOCKING,
|
||||||
|
(type, level, reason, pos, random) -> level.getLevel().isDay() && level.canSeeSky(pos),
|
||||||
|
RegisterSpawnPlacementsEvent.Operation.REPLACE);
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,6 +32,14 @@ public class ModBiomeModifiers {
|
|||||||
public static final ResourceKey<BiomeModifier> SPAWN_CAPYBARA = registerKey("spawn_capybara");
|
public static final ResourceKey<BiomeModifier> SPAWN_CAPYBARA = registerKey("spawn_capybara");
|
||||||
public static final ResourceKey<BiomeModifier> SPAWN_DUCK = registerKey("spawn_duck");
|
public static final ResourceKey<BiomeModifier> SPAWN_DUCK = registerKey("spawn_duck");
|
||||||
public static final ResourceKey<BiomeModifier> SPAWN_RAT = registerKey("spawn_rat");
|
public static final ResourceKey<BiomeModifier> SPAWN_RAT = registerKey("spawn_rat");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_SQUIRREL = registerKey("spawn_squirrel");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_OTTER = registerKey("spawn_otter");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_DEER = registerKey("spawn_deer");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_BEAVER = registerKey("spawn_beaver");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_FALCON = registerKey("spawn_falcon");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_MOLE = registerKey("spawn_mole");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_HERON = registerKey("spawn_heron");
|
||||||
|
public static final ResourceKey<BiomeModifier> SPAWN_WILD_BOAR = registerKey("spawn_wild_boar");
|
||||||
|
|
||||||
public static void bootstrap(BootstrapContext<BiomeModifier> context) {
|
public static void bootstrap(BootstrapContext<BiomeModifier> context) {
|
||||||
var placedFeatures = context.lookup(Registries.PLACED_FEATURE);
|
var placedFeatures = context.lookup(Registries.PLACED_FEATURE);
|
||||||
@@ -116,6 +124,65 @@ public class ModBiomeModifiers {
|
|||||||
addSpawn(context, SPAWN_RAT,
|
addSpawn(context, SPAWN_RAT,
|
||||||
biomes.getOrThrow(BiomeTags.IS_FOREST),
|
biomes.getOrThrow(BiomeTags.IS_FOREST),
|
||||||
ModEntities.RAT.get(), 3, 2, 3);
|
ModEntities.RAT.get(), 3, 2, 3);
|
||||||
|
|
||||||
|
addSpawn(context, SPAWN_SQUIRREL,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.FOREST),
|
||||||
|
biomes.getOrThrow(Biomes.BIRCH_FOREST),
|
||||||
|
biomes.getOrThrow(Biomes.TAIGA)),
|
||||||
|
ModEntities.SQUIRREL.get(), 12, 2, 4);
|
||||||
|
|
||||||
|
addSpawn(context, SPAWN_OTTER,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.RIVER),
|
||||||
|
biomes.getOrThrow(Biomes.SWAMP)),
|
||||||
|
ModEntities.OTTER.get(), 6, 1, 2);
|
||||||
|
/*
|
||||||
|
addSpawn(context, SPAWN_DEER,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.FOREST),
|
||||||
|
biomes.getOrThrow(Biomes.BIRCH_FOREST),
|
||||||
|
biomes.getOrThrow(Biomes.TAIGA),
|
||||||
|
biomes.getOrThrow(Biomes.MEADOW)),
|
||||||
|
ModEntities.DEER.get(), 8, 1, 3);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
addSpawn(context, SPAWN_BEAVER,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.RIVER),
|
||||||
|
biomes.getOrThrow(Biomes.SWAMP)),
|
||||||
|
ModEntities.BEAVER.get(), 5, 1, 2);
|
||||||
|
|
||||||
|
/*
|
||||||
|
addSpawn(context, SPAWN_FALCON,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.WINDSWEPT_HILLS),
|
||||||
|
biomes.getOrThrow(Biomes.MEADOW),
|
||||||
|
biomes.getOrThrow(Biomes.FOREST)),
|
||||||
|
ModEntities.FALCON.get(), 4, 1, 2);
|
||||||
|
|
||||||
|
addSpawn(context, SPAWN_MOLE,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.PLAINS),
|
||||||
|
biomes.getOrThrow(Biomes.FOREST)),
|
||||||
|
ModEntities.MOLE.get(), 6, 1, 2);
|
||||||
|
|
||||||
|
addSpawn(context, SPAWN_HERON,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.SWAMP),
|
||||||
|
biomes.getOrThrow(Biomes.MANGROVE_SWAMP),
|
||||||
|
biomes.getOrThrow(Biomes.RIVER)),
|
||||||
|
ModEntities.HERON.get(), 5, 1, 2);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
addSpawn(context, SPAWN_WILD_BOAR,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.FOREST),
|
||||||
|
biomes.getOrThrow(Biomes.DARK_FOREST),
|
||||||
|
biomes.getOrThrow(Biomes.TAIGA)),
|
||||||
|
ModEntities.WILD_BOAR.get(), 6, 1, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addSpawn(BootstrapContext<BiomeModifier> context, ResourceKey<BiomeModifier> key,
|
private static void addSpawn(BootstrapContext<BiomeModifier> context, ResourceKey<BiomeModifier> key,
|
||||||
@@ -127,6 +194,4 @@ public class ModBiomeModifiers {
|
|||||||
private static ResourceKey<BiomeModifier> registerKey(String name) {
|
private static ResourceKey<BiomeModifier> registerKey(String name) {
|
||||||
return ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, name));
|
return ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 558 B |
Reference in New Issue
Block a user