[add] RAT
[fix] hitbox from Capybara
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ mod_name=MasterWild
|
|||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=All Rights Reserved
|
mod_license=All Rights Reserved
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=0.2.0
|
mod_version=0.2.6
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// 1.21.1 2026-09-29T16:57:54.505766212 Registries
|
// 1.21.1 2026-10-03T20:06:11.749153036 Registries
|
||||||
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
|
||||||
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
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// 1.21.1 2026-10-03T14:21:42.612129097 Languages: en_us for mod: masterwild
|
// 1.21.1 2026-10-03T20:06:11.750559852 Languages: en_us for mod: masterwild
|
||||||
7994d49f6ed6926077869619b9bc8775e7d4956a assets/masterwild/lang/en_us.json
|
00583df3ad42ddb46acc722e93243863da7ba227 assets/masterwild/lang/en_us.json
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// 1.21.1 2026-10-03T14:21:42.613329425 Item Models: masterwild
|
// 1.21.1 2026-10-03T20:08:32.139155153 Item Models: masterwild
|
||||||
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/butterfly_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/butterfly_spawn_egg.json
|
||||||
@@ -9,6 +9,7 @@ a92e1a88c1d3c3c04b2b001f0bffd19a1f3462f0 assets/masterwild/models/item/banana.js
|
|||||||
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/monkey_spawn_egg.json
|
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets/masterwild/models/item/monkey_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/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
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"entity.masterwild.monkey": "Monkey",
|
"entity.masterwild.monkey": "Monkey",
|
||||||
"entity.masterwild.pinguin": "Pinguin",
|
"entity.masterwild.pinguin": "Pinguin",
|
||||||
"entity.masterwild.raccoon": "Raccoon",
|
"entity.masterwild.raccoon": "Raccoon",
|
||||||
|
"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",
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
"item.masterwild.monkey_spawn_egg": "Monkey Spawn Egg",
|
"item.masterwild.monkey_spawn_egg": "Monkey 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.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",
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/template_spawn_egg"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"type": "neoforge:add_spawns",
|
||||||
|
"biomes": [
|
||||||
|
"minecraft:plains",
|
||||||
|
"minecraft:sunflower_plains",
|
||||||
|
"minecraft:meadow"
|
||||||
|
],
|
||||||
|
"spawners": {
|
||||||
|
"type": "masterwild:duck",
|
||||||
|
"maxCount": 3,
|
||||||
|
"minCount": 2,
|
||||||
|
"weight": 5
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,6 +33,7 @@ public class ModCreativeModeTabs {
|
|||||||
output.accept(ModItems.MONKEY_SPAWN_EGG);
|
output.accept(ModItems.MONKEY_SPAWN_EGG);
|
||||||
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);
|
||||||
|
|
||||||
}).build());
|
}).build());
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ public class ModItems {
|
|||||||
public static final DeferredItem<Item> DUCK_SPAWN_EGG = ITEMS.register("duck_spawn_egg",
|
public static final DeferredItem<Item> DUCK_SPAWN_EGG = ITEMS.register("duck_spawn_egg",
|
||||||
() -> new DeferredSpawnEggItem(ModEntities.DUCK, 0x341b10, 0x516a4c,
|
() -> new DeferredSpawnEggItem(ModEntities.DUCK, 0x341b10, 0x516a4c,
|
||||||
new Item.Properties()));
|
new Item.Properties()));
|
||||||
|
public static final DeferredItem<Item> RAT_SPAWN_EGG = ITEMS.register("rat_spawn_egg",
|
||||||
|
() -> new DeferredSpawnEggItem(ModEntities.RAT, 0x767677, 0x965654,
|
||||||
|
new Item.Properties()));
|
||||||
|
|
||||||
public static void register(IEventBus eventBus) {
|
public static void register(IEventBus eventBus) {
|
||||||
ITEMS.register(eventBus);
|
ITEMS.register(eventBus);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import ovh.glitchlabs.masterwild.entity.client.capibara.CapybaraRenderer;
|
|||||||
import ovh.glitchlabs.masterwild.entity.client.duck.duckRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.duck.duckRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.firefly.FireflyRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.firefly.FireflyRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.hedgehog.HedgehogRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.hedgehog.HedgehogRenderer;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.rat.ratRenderer;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.red_panda.Red_PandaRenderer;
|
import ovh.glitchlabs.masterwild.entity.client.red_panda.Red_PandaRenderer;
|
||||||
|
|
||||||
// The value here should match an entry in the META-INF/neoforge.mods.toml file
|
// The value here should match an entry in the META-INF/neoforge.mods.toml file
|
||||||
@@ -88,6 +89,7 @@ public class Masterwild {
|
|||||||
EntityRenderers.register(ModEntities.MONKEY.get(), MonkeyRenderer::new);
|
EntityRenderers.register(ModEntities.MONKEY.get(), MonkeyRenderer::new);
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,6 @@ public class ModItemModelProvider extends ItemModelProvider {
|
|||||||
withExistingParent(ModItems.MONKEY_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
withExistingParent(ModItems.MONKEY_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||||
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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,7 @@ public class ModLanguageProvider extends LanguageProvider {
|
|||||||
add(ModEntities.MONKEY.get(), "Monkey");
|
add(ModEntities.MONKEY.get(), "Monkey");
|
||||||
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(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");
|
||||||
@@ -40,6 +41,7 @@ public class ModLanguageProvider extends LanguageProvider {
|
|||||||
add(ModItems.MONKEY_SPAWN_EGG.get(), "Monkey Spawn Egg");
|
add(ModItems.MONKEY_SPAWN_EGG.get(), "Monkey Spawn Egg");
|
||||||
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("creativetab.masterwild.masterwild", "MasterWild");
|
add("creativetab.masterwild.masterwild", "MasterWild");
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,16 @@ public class ModEntities {
|
|||||||
|
|
||||||
public static final Supplier<EntityType<CapybaraEntity>> CAPYBARA =
|
public static final Supplier<EntityType<CapybaraEntity>> CAPYBARA =
|
||||||
ENTITY_TYPES.register("capybara", () -> EntityType.Builder.of(CapybaraEntity::new, MobCategory.CREATURE)
|
ENTITY_TYPES.register("capybara", () -> EntityType.Builder.of(CapybaraEntity::new, MobCategory.CREATURE)
|
||||||
.sized(0.6f, 0.5f).build("capybara"));
|
.sized(0.85f, 0.85f).build("capybara"));
|
||||||
|
|
||||||
public static final Supplier<EntityType<duckEntity>> DUCK =
|
public static final Supplier<EntityType<duckEntity>> DUCK =
|
||||||
ENTITY_TYPES.register("duck", () -> EntityType.Builder.of(duckEntity::new, MobCategory.CREATURE)
|
ENTITY_TYPES.register("duck", () -> EntityType.Builder.of(duckEntity::new, MobCategory.CREATURE)
|
||||||
.sized(0.6f, 0.5f).build("duck"));
|
.sized(0.6f, 0.5f).build("duck"));
|
||||||
|
|
||||||
|
public static final Supplier<EntityType<RatEntity>> RAT =
|
||||||
|
ENTITY_TYPES.register("rat", () -> EntityType.Builder.of(RatEntity::new, MobCategory.CREATURE)
|
||||||
|
.sized(0.6f, 0.5f).build("rat"));
|
||||||
|
|
||||||
|
|
||||||
public static void register(IEventBus eventBus) {
|
public static void register(IEventBus eventBus) {
|
||||||
ENTITY_TYPES.register(eventBus);
|
ENTITY_TYPES.register(eventBus);
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.rat;// Made with Blockbench 5.2.0
|
||||||
|
// 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.RatEntity;
|
||||||
|
|
||||||
|
public class ratModel<T extends RatEntity> 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, "ratmodel"), "main");
|
||||||
|
private final ModelPart Rat;
|
||||||
|
private final ModelPart body;
|
||||||
|
private final ModelPart legs;
|
||||||
|
private final ModelPart R_front_leg;
|
||||||
|
private final ModelPart R_down_leg;
|
||||||
|
private final ModelPart L_front_leg;
|
||||||
|
private final ModelPart L_down_leg;
|
||||||
|
private final ModelPart tail;
|
||||||
|
private final ModelPart head;
|
||||||
|
|
||||||
|
public ratModel(ModelPart root) {
|
||||||
|
this.Rat = root.getChild("Rat");
|
||||||
|
this.body = this.Rat.getChild("body");
|
||||||
|
this.legs = this.body.getChild("legs");
|
||||||
|
this.R_front_leg = this.legs.getChild("R_front_leg");
|
||||||
|
this.R_down_leg = this.legs.getChild("R_down_leg");
|
||||||
|
this.L_front_leg = this.legs.getChild("L_front_leg");
|
||||||
|
this.L_down_leg = this.legs.getChild("L_down_leg");
|
||||||
|
this.tail = this.body.getChild("tail");
|
||||||
|
this.head = this.Rat.getChild("head");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LayerDefinition createBodyLayer() {
|
||||||
|
MeshDefinition meshdefinition = new MeshDefinition();
|
||||||
|
PartDefinition partdefinition = meshdefinition.getRoot();
|
||||||
|
|
||||||
|
PartDefinition Rat = partdefinition.addOrReplaceChild("Rat", CubeListBuilder.create(), PartPose.offset(0.375F, 22.3644F, -0.7309F));
|
||||||
|
|
||||||
|
PartDefinition body = Rat.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 0).addBox(-3.75F, -3.7289F, -5.5383F, 6.0F, 6.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(0.375F, -1.6356F, 2.2691F));
|
||||||
|
|
||||||
|
PartDefinition legs = body.addOrReplaceChild("legs", CubeListBuilder.create(), PartPose.offset(-0.75F, 1.3961F, -0.5383F));
|
||||||
|
|
||||||
|
PartDefinition R_front_leg = legs.addOrReplaceChild("R_front_leg", CubeListBuilder.create().texOffs(26, 27).addBox(-7.0F, 0.0F, -3.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(3.0F, 0.875F, -4.0F));
|
||||||
|
|
||||||
|
PartDefinition R_down_leg = legs.addOrReplaceChild("R_down_leg", CubeListBuilder.create().texOffs(32, 5).addBox(-1.5F, 1.75F, -2.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(24, 32).addBox(-0.5F, -2.25F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(-3.5F, -0.875F, 4.0F));
|
||||||
|
|
||||||
|
PartDefinition L_front_leg = legs.addOrReplaceChild("L_front_leg", CubeListBuilder.create().texOffs(32, 0).addBox(4.0F, 0.0F, -3.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(-3.0F, 0.875F, -4.0F));
|
||||||
|
|
||||||
|
PartDefinition L_down_leg = legs.addOrReplaceChild("L_down_leg", CubeListBuilder.create().texOffs(14, 29).addBox(-0.5F, -2.25F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F))
|
||||||
|
.texOffs(0, 29).addBox(-1.5F, 1.75F, -2.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(3.5F, -0.875F, 4.0F));
|
||||||
|
|
||||||
|
PartDefinition tail = body.addOrReplaceChild("tail", CubeListBuilder.create(), PartPose.offset(-0.75F, -1.2289F, 3.9617F));
|
||||||
|
|
||||||
|
PartDefinition cube_r1 = tail.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 16).addBox(-1.0F, -2.0F, -1.0F, 1.0F, 1.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, 1.5F, 1.0F, -0.1309F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition head = Rat.addOrReplaceChild("head", CubeListBuilder.create(), PartPose.offset(-0.375F, -3.2955F, -3.0447F));
|
||||||
|
|
||||||
|
PartDefinition cube_r2 = head.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(32, 13).addBox(-2.0F, -3.0F, 1.0F, 3.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-3.0F, -0.5689F, -2.4744F, 0.0F, 0.1745F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r3 = head.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(32, 10).addBox(-1.0F, -3.0F, 1.0F, 3.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(3.0F, -0.5689F, -2.4744F, 0.0F, -0.1745F, 0.0F));
|
||||||
|
|
||||||
|
PartDefinition cube_r4 = head.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(26, 16).addBox(-2.5F, -2.0F, -7.0F, 5.0F, 4.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.6811F, 0.2756F, 0.1309F, 0.0F, 0.0F));
|
||||||
|
|
||||||
|
return LayerDefinition.create(meshdefinition, 64, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupAnim(RatEntity 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_down_leg.xRot = Mth.cos(limbSwing * 0.6662F) * amount;
|
||||||
|
this.L_front_leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
this.R_down_leg.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * amount;
|
||||||
|
this.tail.yRot = Mth.cos(limbSwing * 0.3331F) * 0.2F * amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, int color) {
|
||||||
|
Rat.render(poseStack, vertexConsumer, packedLight, packedOverlay, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelPart root() {
|
||||||
|
return Rat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.client.rat;
|
||||||
|
|
||||||
|
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.RatEntity;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.custom.RoosterEntity;
|
||||||
|
|
||||||
|
public class ratRenderer extends MobRenderer<RatEntity, ratModel<RatEntity>> {
|
||||||
|
private static final ResourceLocation TEXTURE =
|
||||||
|
ResourceLocation.fromNamespaceAndPath(Masterwild.MODID, "textures/entity/rat.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 ratRenderer(EntityRendererProvider.Context context) {
|
||||||
|
super(context, new ratModel<>(context.bakeLayer(ratModel.LAYER_LOCATION)), SHADOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getTextureLocation(RatEntity entity) {
|
||||||
|
return TEXTURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//@Override
|
||||||
|
protected void scale(RoosterEntity 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,52 @@
|
|||||||
|
package ovh.glitchlabs.masterwild.entity.custom;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
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;
|
||||||
|
|
||||||
|
public class RatEntity extends Animal {
|
||||||
|
|
||||||
|
public RatEntity(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
|
return Mob.createMobAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 5)
|
||||||
|
.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(4, new FollowParentGoal(this, 1.1));
|
||||||
|
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.8));
|
||||||
|
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 false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable AgeableMob getBreedOffspring(ServerLevel serverLevel, AgeableMob ageableMob) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ import ovh.glitchlabs.masterwild.entity.client.capibara.CapybaraModel;
|
|||||||
import ovh.glitchlabs.masterwild.entity.client.duck.duckModel;
|
import ovh.glitchlabs.masterwild.entity.client.duck.duckModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.firefly.FireflyModel;
|
import ovh.glitchlabs.masterwild.entity.client.firefly.FireflyModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.hedgehog.HedgehogModel;
|
import ovh.glitchlabs.masterwild.entity.client.hedgehog.HedgehogModel;
|
||||||
|
import ovh.glitchlabs.masterwild.entity.client.rat.ratModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.client.red_panda.Red_PandaModel;
|
import ovh.glitchlabs.masterwild.entity.client.red_panda.Red_PandaModel;
|
||||||
import ovh.glitchlabs.masterwild.entity.custom.*;
|
import ovh.glitchlabs.masterwild.entity.custom.*;
|
||||||
|
|
||||||
@@ -34,6 +35,7 @@ public class ModEventBusEvents {
|
|||||||
event.registerLayerDefinition(MonkeyModel.LAYER_LOCATION, MonkeyModel::createBodyLayer);
|
event.registerLayerDefinition(MonkeyModel.LAYER_LOCATION, MonkeyModel::createBodyLayer);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@@ -48,5 +50,6 @@ public class ModEventBusEvents {
|
|||||||
event.put(ModEntities.MONKEY.get(), MonkeyEntity.createAttributes().build());
|
event.put(ModEntities.MONKEY.get(), MonkeyEntity.createAttributes().build());
|
||||||
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public class ModSpawnPlacements {
|
|||||||
event.register(ModEntities.CAPYBARA.get(), SpawnPlacementTypes.ON_GROUND,
|
event.register(ModEntities.CAPYBARA.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.DUCK.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,
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class ModBiomeModifiers {
|
|||||||
public static final ResourceKey<BiomeModifier> SPAWN_BUTTERFLY = registerKey("spawn_butterfly");
|
public static final ResourceKey<BiomeModifier> SPAWN_BUTTERFLY = registerKey("spawn_butterfly");
|
||||||
public static final ResourceKey<BiomeModifier> SPAWN_MONKEY = registerKey("spawn_monkey");
|
public static final ResourceKey<BiomeModifier> SPAWN_MONKEY = registerKey("spawn_monkey");
|
||||||
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 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);
|
||||||
@@ -103,6 +104,13 @@ public class ModBiomeModifiers {
|
|||||||
biomes.getOrThrow(Biomes.SWAMP),
|
biomes.getOrThrow(Biomes.SWAMP),
|
||||||
biomes.getOrThrow(Biomes.SAVANNA)),
|
biomes.getOrThrow(Biomes.SAVANNA)),
|
||||||
ModEntities.CAPYBARA.get(), 5, 3, 4);
|
ModEntities.CAPYBARA.get(), 5, 3, 4);
|
||||||
|
|
||||||
|
addSpawn(context, SPAWN_DUCK,
|
||||||
|
HolderSet.direct(
|
||||||
|
biomes.getOrThrow(Biomes.PLAINS),
|
||||||
|
biomes.getOrThrow(Biomes.SUNFLOWER_PLAINS),
|
||||||
|
biomes.getOrThrow(Biomes.MEADOW)),
|
||||||
|
ModEntities.DUCK.get(), 5, 2, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addSpawn(BootstrapContext<BiomeModifier> context, ResourceKey<BiomeModifier> key,
|
private static void addSpawn(BootstrapContext<BiomeModifier> context, ResourceKey<BiomeModifier> key,
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user