added mummy added cobra added saber added sand blocks
@ -0,0 +1,3 @@
|
||||
// 1.21.1 2025-02-07T19:09:08.6447576 VoltexDesertUpdate/
|
||||
3d00d260ef61a03ff3b98c011ee1465b91dcd987 data\voltexdesertupdate\worldgen\configured_feature\palm.json
|
||||
e644e0605cf42a2e5e5d97e6677675375619cf44 data\voltexdesertupdate\worldgen\placed_feature\palm_placed.json
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_bricks"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_1"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_2"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_3"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_4"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_5"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_6"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_7"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_rock_shade_8"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/sandstone_tile_bricks"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/wiped_sand_shade_1"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "voltexdesertupdate:block/wiped_sand_shade_2"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_bricks"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_1"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_2"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_3"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_4"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_5"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_6"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_7"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_rock_shade_8"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/sandstone_tile_bricks"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/wiped_sand_shade_1"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "voltexdesertupdate:block/wiped_sand_shade_2"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "voltexdesertupdate:item/saber"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_bricks"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_1"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_2"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_3"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_4"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_5"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_6"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_7"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_rock_shade_8"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/sandstone_tile_bricks"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/wiped_sand_shade_1"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "voltexdesertupdate:block/wiped_sand_shade_2"
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:quicksand_block"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_bricks"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_1"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_2"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_3"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_4"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_5"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_6"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_7"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_rock_shade_8"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:sandstone_tile_bricks"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:wiped_sand_shade_1"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "voltexdesertupdate:wiped_sand_shade_2"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
{
|
||||
"type": "minecraft:tree",
|
||||
"config": {
|
||||
"decorators": [],
|
||||
"dirt_provider": {
|
||||
"type": "minecraft:simple_state_provider",
|
||||
"state": {
|
||||
"Name": "minecraft:dirt"
|
||||
}
|
||||
},
|
||||
"foliage_placer": {
|
||||
"type": "minecraft:acacia_foliage_placer",
|
||||
"offset": 1,
|
||||
"radius": 3
|
||||
},
|
||||
"foliage_provider": {
|
||||
"type": "minecraft:simple_state_provider",
|
||||
"state": {
|
||||
"Name": "voltexdesertupdate:palm_leaves",
|
||||
"Properties": {
|
||||
"distance": "7",
|
||||
"persistent": "false",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
}
|
||||
},
|
||||
"force_dirt": false,
|
||||
"ignore_vines": false,
|
||||
"minimum_size": {
|
||||
"type": "minecraft:two_layers_feature_size",
|
||||
"limit": 1,
|
||||
"lower_size": 0,
|
||||
"upper_size": 2
|
||||
},
|
||||
"trunk_placer": {
|
||||
"type": "minecraft:bending_trunk_placer",
|
||||
"base_height": 3,
|
||||
"bend_length": {
|
||||
"type": "minecraft:uniform",
|
||||
"max_inclusive": 2,
|
||||
"min_inclusive": 1
|
||||
},
|
||||
"height_rand_a": 2,
|
||||
"height_rand_b": 0,
|
||||
"min_height_for_leaves": 4
|
||||
},
|
||||
"trunk_provider": {
|
||||
"type": "minecraft:simple_state_provider",
|
||||
"state": {
|
||||
"Name": "voltexdesertupdate:palm_log",
|
||||
"Properties": {
|
||||
"axis": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
{
|
||||
"feature": "voltexdesertupdate:palm",
|
||||
"placement": [
|
||||
{
|
||||
"type": "minecraft:count",
|
||||
"count": {
|
||||
"type": "minecraft:weighted_list",
|
||||
"distribution": [
|
||||
{
|
||||
"data": 2,
|
||||
"weight": 9
|
||||
},
|
||||
{
|
||||
"data": 4,
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "minecraft:in_square"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:surface_water_depth_filter",
|
||||
"max_water_depth": 0
|
||||
},
|
||||
{
|
||||
"type": "minecraft:heightmap",
|
||||
"heightmap": "OCEAN_FLOOR"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:biome"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:block_predicate_filter",
|
||||
"predicate": {
|
||||
"type": "minecraft:would_survive",
|
||||
"state": {
|
||||
"Name": "voltexdesertupdate:palm_sapling",
|
||||
"Properties": {
|
||||
"stage": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -4,9 +4,11 @@ import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
|
||||
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
|
||||
import net.minecraft.block.FireBlock;
|
||||
import net.voltexstudios.blocks.ModBlocks;
|
||||
import net.voltexstudios.entity.ModEntities;
|
||||
import net.voltexstudios.entity.custom.BanditEntity;
|
||||
import net.voltexstudios.entity.custom.CobraEntity;
|
||||
import net.voltexstudios.entity.custom.MummyEntity;
|
||||
import net.voltexstudios.entity.custom.VultureEntity;
|
||||
import net.voltexstudios.item.ModItemGroups;
|
||||
import net.voltexstudios.item.ModItems;
|
||||
@ -29,6 +31,9 @@ public class VoltexDesertUpdate implements ModInitializer {
|
||||
ModEntities.registerModEntities();
|
||||
|
||||
FabricDefaultAttributeRegistry.register(ModEntities.VULTURE_ENTITY, VultureEntity.createVultureAttributes());
|
||||
FabricDefaultAttributeRegistry.register(ModEntities.BANDIT_ENTITY, BanditEntity.createBanditAttributes());
|
||||
FabricDefaultAttributeRegistry.register(ModEntities.COBRA_ENTITY, CobraEntity.createCobraAttributes());
|
||||
FabricDefaultAttributeRegistry.register(ModEntities.MUMMY_ENTITY, MummyEntity.createMummyAttributes());
|
||||
|
||||
FlammableBlockRegistry.getDefaultInstance().add(ModBlocks.PALM_LOG, 5, 5);
|
||||
FlammableBlockRegistry.getDefaultInstance().add(ModBlocks.PALM_WOOD, 5, 5);
|
||||
|
@ -7,8 +7,14 @@ import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.voltexstudios.blocks.ModBlocks;
|
||||
import net.voltexstudios.entity.ModEntities;
|
||||
import net.voltexstudios.entity.client.VultureModel;
|
||||
import net.voltexstudios.entity.client.VultureRenderer;
|
||||
import net.voltexstudios.entity.client.bandit.BanditModel;
|
||||
import net.voltexstudios.entity.client.bandit.BanditRenderer;
|
||||
import net.voltexstudios.entity.client.cobra.CobraModel;
|
||||
import net.voltexstudios.entity.client.cobra.CobraRenderer;
|
||||
import net.voltexstudios.entity.client.mummy.MummyModel;
|
||||
import net.voltexstudios.entity.client.mummy.MummyRenderer;
|
||||
import net.voltexstudios.entity.client.vulture.VultureModel;
|
||||
import net.voltexstudios.entity.client.vulture.VultureRenderer;
|
||||
|
||||
|
||||
public class VoltexDesertUpdateClient implements ClientModInitializer {
|
||||
@ -19,6 +25,12 @@ public class VoltexDesertUpdateClient implements ClientModInitializer {
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.PALM_SAPLING, RenderLayer.getCutout());
|
||||
|
||||
EntityModelLayerRegistry.registerModelLayer(VultureModel.VULTURE, VultureModel::getTexturedModelData);
|
||||
EntityModelLayerRegistry.registerModelLayer(BanditModel.BANDIT, BanditModel::getTexturedModelData);
|
||||
EntityModelLayerRegistry.registerModelLayer(CobraModel.COBRA, CobraModel::getTexturedModelData);
|
||||
EntityModelLayerRegistry.registerModelLayer(MummyModel.MUMMY, MummyModel::getTexturedModelData);
|
||||
EntityRendererRegistry.register(ModEntities.VULTURE_ENTITY, VultureRenderer::new);
|
||||
EntityRendererRegistry.register(ModEntities.BANDIT_ENTITY, BanditRenderer::new);
|
||||
EntityRendererRegistry.register(ModEntities.COBRA_ENTITY, CobraRenderer::new);
|
||||
EntityRendererRegistry.register(ModEntities.MUMMY_ENTITY, MummyRenderer::new);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import net.voltexstudios.datagen.ModLootTableProvider;
|
||||
import net.voltexstudios.datagen.ModModelProvider;
|
||||
import net.voltexstudios.world.ModConfiguredFeatures;
|
||||
import net.voltexstudios.world.ModPlacedFeatures;
|
||||
import net.voltexstudios.datagen.ModRegistryDataGenerator;
|
||||
|
||||
public class VoltexDesertUpdateDataGenerator implements DataGeneratorEntrypoint {
|
||||
|
||||
@ -21,7 +22,7 @@ public class VoltexDesertUpdateDataGenerator implements DataGeneratorEntrypoint
|
||||
pack.addProvider(ModItemTagProvider::new);
|
||||
pack.addProvider(ModLootTableProvider::new);
|
||||
pack.addProvider(ModModelProvider::new);
|
||||
|
||||
pack.addProvider(ModRegistryDataGenerator::new);
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,32 @@ public class ModBlocks {
|
||||
public static final Block QUICKSAND_BLOCK = registerBlock("quicksand_block",
|
||||
new QuicksandBlock(AbstractBlock.Settings.copy(Blocks.POWDER_SNOW)));
|
||||
|
||||
public static final Block WIPED_SAND_SHADE_1 = registerBlock("wiped_sand_shade_1",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SAND)));
|
||||
public static final Block WIPED_SAND_SHADE_2 = registerBlock("wiped_sand_shade_2",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SAND)));
|
||||
public static final Block SANDSTONE_BRICKS = registerBlock("sandstone_bricks",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_TILE_BRICKS = registerBlock("sandstone_tile_bricks",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_1 = registerBlock("sandstone_rock_shade_1",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_2 = registerBlock("sandstone_rock_shade_2",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_3 = registerBlock("sandstone_rock_shade_3",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_4 = registerBlock("sandstone_rock_shade_4",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_5 = registerBlock("sandstone_rock_shade_5",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_6 = registerBlock("sandstone_rock_shade_6",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_7 = registerBlock("sandstone_rock_shade_7",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
public static final Block SANDSTONE_ROCK_SHADE_8 = registerBlock("sandstone_rock_shade_8",
|
||||
new Block(AbstractBlock.Settings.copy(Blocks.SANDSTONE)));
|
||||
|
||||
|
||||
public static final Block PALM_LOG = registerBlock("palm_log",
|
||||
new PillarBlock(AbstractBlock.Settings.copy(Blocks.OAK_LOG)));
|
||||
public static final Block PALM_WOOD = registerBlock("palm_wood",
|
||||
|
@ -15,13 +15,13 @@ import net.minecraft.registry.tag.EntityTypeTags;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.*;
|
||||
import net.voltexstudios.blocks.ModBlocks;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Optional;
|
||||
@ -43,14 +43,20 @@ public class QuicksandBlock extends Block implements FluidDrainable {
|
||||
return CODEC;
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
protected boolean isSideInvisible(BlockState state, BlockState stateFrom, Direction direction) {
|
||||
return stateFrom.isOf(this) || super.isSideInvisible(state, stateFrom, direction);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected VoxelShape getCullingShape(BlockState state, BlockView world, BlockPos pos) {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
|
||||
if (!(entity instanceof LivingEntity) || entity.getBlockStateAtPos().isOf(this)) {
|
||||
entity.slowMovement(state, new Vec3d(0.8999999761581421, 1.5, 0.8999999761581421));
|
||||
@ -67,6 +73,7 @@ public class QuicksandBlock extends Block implements FluidDrainable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
||||
if (!((double)fallDistance < 4.0) && entity instanceof LivingEntity livingEntity) {
|
||||
LivingEntity.FallSounds fallSounds = livingEntity.getFallSounds();
|
||||
@ -75,6 +82,7 @@ public class QuicksandBlock extends Block implements FluidDrainable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
if (context instanceof EntityShapeContext entityShapeContext) {
|
||||
Entity entity = entityShapeContext.getEntity();
|
||||
@ -93,11 +101,13 @@ public class QuicksandBlock extends Block implements FluidDrainable {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VoxelShape getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
return VoxelShapes.empty();
|
||||
|
||||
}
|
||||
|
||||
public static boolean canWalkOnQuicksand(Entity entity) {
|
||||
private boolean canWalkOnQuicksand(Entity entity) {
|
||||
if (entity.getType().isIn(EntityTypeTags.POWDER_SNOW_WALKABLE_MOBS)) {
|
||||
return true;
|
||||
} else {
|
||||
@ -105,25 +115,30 @@ public class QuicksandBlock extends Block implements FluidDrainable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack tryDrainFluid(@Nullable PlayerEntity player, WorldAccess world, BlockPos pos, BlockState state) {
|
||||
world.setBlockState(pos, Blocks.AIR.getDefaultState(), Block.NOTIFY_ALL_AND_REDRAW);
|
||||
if (!world.isClient()) {
|
||||
world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(state));
|
||||
}
|
||||
|
||||
return new ItemStack(Items.POWDER_SNOW_BUCKET);
|
||||
return new ItemStack(ModBlocks.QUICKSAND_BLOCK.asItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<SoundEvent> getBucketFillSound() {
|
||||
return Optional.of(SoundEvents.ITEM_BUCKET_FILL_POWDER_SNOW);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canPathfindThrough(BlockState state, NavigationType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
return VoxelShapes.empty(); // Optional: also prevents outline rendering
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -15,10 +15,24 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
addDrop(ModBlocks.QUICKSAND_BLOCK);
|
||||
addDrop(ModBlocks.PALM_LOG);
|
||||
addDrop(ModBlocks.PALM_WOOD);
|
||||
addDrop(ModBlocks.PALM_PLANKS);
|
||||
addDrop(ModBlocks.PALM_SAPLING);
|
||||
addDrop(ModBlocks.PALM_LEAVES, leavesDrops(ModBlocks.PALM_LEAVES, ModBlocks.PALM_SAPLING, 0.0625F));
|
||||
|
||||
addDrop(ModBlocks.WIPED_SAND_SHADE_1);
|
||||
addDrop(ModBlocks.WIPED_SAND_SHADE_2);
|
||||
addDrop(ModBlocks.SANDSTONE_BRICKS);
|
||||
addDrop(ModBlocks.SANDSTONE_TILE_BRICKS);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_1);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_2);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_3);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_4);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_5);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_6);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_7);
|
||||
addDrop(ModBlocks.SANDSTONE_ROCK_SHADE_8);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import net.minecraft.data.client.ItemModelGenerator;
|
||||
import net.minecraft.data.client.Models;
|
||||
import net.minecraft.data.client.TexturedModel;
|
||||
import net.voltexstudios.blocks.ModBlocks;
|
||||
import net.voltexstudios.item.ModItems;
|
||||
|
||||
public class ModModelProvider extends FabricModelProvider {
|
||||
|
||||
@ -22,10 +23,27 @@ public class ModModelProvider extends FabricModelProvider {
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.PALM_PLANKS);
|
||||
blockStateModelGenerator.registerSingleton(ModBlocks.PALM_LEAVES, TexturedModel.LEAVES);
|
||||
blockStateModelGenerator.registerTintableCrossBlockState(ModBlocks.PALM_SAPLING, BlockStateModelGenerator.TintType.NOT_TINTED);
|
||||
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.WIPED_SAND_SHADE_1);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.WIPED_SAND_SHADE_2);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_BRICKS);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_TILE_BRICKS);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_1);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_2);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_3);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_4);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_5);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_6);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_7);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SANDSTONE_ROCK_SHADE_8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
|
||||
itemModelGenerator.register(ModBlocks.PALM_SAPLING.asItem(), Models.GENERATED);
|
||||
|
||||
// Registering items
|
||||
itemModelGenerator.register(ModItems.SABER, Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.DUNE_STAFF, Models.GENERATED);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package net.voltexstudios.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModRegistryDataGenerator extends FabricDynamicRegistryProvider {
|
||||
public ModRegistryDataGenerator(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) {
|
||||
entries.addAll(registries.getWrapperOrThrow(RegistryKeys.CONFIGURED_FEATURE));
|
||||
entries.addAll(registries.getWrapperOrThrow(RegistryKeys.PLACED_FEATURE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "";
|
||||
}
|
||||
}
|
@ -6,8 +6,7 @@ import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.entity.custom.DuneProjectileEntity;
|
||||
import net.voltexstudios.entity.custom.VultureEntity;
|
||||
import net.voltexstudios.entity.custom.*;
|
||||
|
||||
public class ModEntities {
|
||||
|
||||
@ -22,6 +21,21 @@ public class ModEntities {
|
||||
EntityType.Builder.<DuneProjectileEntity>create(DuneProjectileEntity::new, SpawnGroup.MISC)
|
||||
.dimensions(0.25f, 0.25f).build());
|
||||
|
||||
public static final EntityType<BanditEntity> BANDIT_ENTITY = Registry.register(Registries.ENTITY_TYPE,
|
||||
Identifier.of(VoltexDesertUpdate.MOD_ID, "bandit_entity"),
|
||||
EntityType.Builder.create(BanditEntity::new, SpawnGroup.CREATURE)
|
||||
.dimensions(0.5f, 2f).build());
|
||||
|
||||
public static final EntityType<CobraEntity> COBRA_ENTITY = Registry.register(Registries.ENTITY_TYPE,
|
||||
Identifier.of(VoltexDesertUpdate.MOD_ID, "cobra_entity"),
|
||||
EntityType.Builder.create(CobraEntity::new, SpawnGroup.CREATURE)
|
||||
.dimensions(0.5f, 0.8f).build());
|
||||
|
||||
public static final EntityType<MummyEntity> MUMMY_ENTITY = Registry.register(Registries.ENTITY_TYPE,
|
||||
Identifier.of(VoltexDesertUpdate.MOD_ID, "mummy_entity"),
|
||||
EntityType.Builder.create(MummyEntity::new, SpawnGroup.CREATURE)
|
||||
.dimensions(0.5f, 2f).build());
|
||||
|
||||
public static void registerModEntities() {
|
||||
VoltexDesertUpdate.LOGGER.info("Registering Mod Entities for " + VoltexDesertUpdate.MOD_ID);
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
package net.voltexstudios.entity.client.bandit;
|
||||
|
||||
import net.minecraft.client.render.entity.animation.Animation;
|
||||
|
||||
public class BanditAnimations {
|
||||
public static final Animation ANIMATION = Animation.Builder.create(0f).build();
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package net.voltexstudios.entity.client.bandit;
|
||||
|
||||
import net.minecraft.client.model.*;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.entity.model.CrossbowPosing;
|
||||
import net.minecraft.client.render.entity.model.EntityModelLayer;
|
||||
import net.minecraft.client.render.entity.model.ModelWithArms;
|
||||
import net.minecraft.client.render.entity.model.SinglePartEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.mob.IllagerEntity;
|
||||
import net.minecraft.util.Arm;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.entity.custom.BanditEntity;
|
||||
|
||||
public class BanditModel<T extends BanditEntity> extends SinglePartEntityModel<T> implements ModelWithArms {
|
||||
|
||||
public static final EntityModelLayer BANDIT = new EntityModelLayer(Identifier.of(VoltexDesertUpdate.MOD_ID, "bandit"), "main");
|
||||
|
||||
private final ModelPart mambo;
|
||||
private final ModelPart head;
|
||||
private final ModelPart body;
|
||||
private final ModelPart arms;
|
||||
private final ModelPart right_leg;
|
||||
private final ModelPart left_leg;
|
||||
private final ModelPart right_arm;
|
||||
private final ModelPart left_arm;
|
||||
|
||||
public BanditModel(ModelPart root) {
|
||||
this.mambo = root.getChild("mambo");
|
||||
this.head = this.mambo.getChild("head");
|
||||
this.body = this.mambo.getChild("body");
|
||||
this.arms = this.mambo.getChild("arms");
|
||||
this.right_leg = this.mambo.getChild("right_leg");
|
||||
this.left_leg = this.mambo.getChild("left_leg");
|
||||
this.right_arm = this.mambo.getChild("right_arm");
|
||||
this.left_arm = this.mambo.getChild("left_arm");
|
||||
}
|
||||
public static TexturedModelData getTexturedModelData() {
|
||||
ModelData modelData = new ModelData();
|
||||
ModelPartData modelPartData = modelData.getRoot();
|
||||
ModelPartData mambo = modelPartData.addChild("mambo", ModelPartBuilder.create(), ModelTransform.pivot(0.0F, 24.0F, 0.0F));
|
||||
|
||||
ModelPartData head = mambo.addChild("head", ModelPartBuilder.create().uv(28, 18).cuboid(-4.0F, -10.0F, -4.0F, 8.0F, 10.0F, 8.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, -24.0F, 0.0F));
|
||||
|
||||
ModelPartData nose = head.addChild("nose", ModelPartBuilder.create().uv(52, 36).cuboid(-1.0F, -1.0F, -6.0F, 2.0F, 4.0F, 2.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, -2.0F, 0.0F));
|
||||
|
||||
ModelPartData headwear = head.addChild("headwear", ModelPartBuilder.create().uv(64, 0).cuboid(-4.0F, -10.0F, -4.0F, 8.0F, 10.0F, 8.0F, new Dilation(0.51F)), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
|
||||
|
||||
ModelPartData headwear2 = head.addChild("headwear2", ModelPartBuilder.create().uv(0, 0).cuboid(-7.0F, -7.0F, -8.3F, 14.0F, 14.0F, 4.0F, new Dilation(0.0F))
|
||||
.uv(0, 0).cuboid(-7.0F, -7.0F, -8.3F, 14.0F, 14.0F, 4.0F, new Dilation(0.0F)), ModelTransform.of(0.0F, 0.0F, 0.0F, -1.5708F, 0.0F, 0.0F));
|
||||
|
||||
ModelPartData body = mambo.addChild("body", ModelPartBuilder.create().uv(36, 0).cuboid(-4.0F, 0.0F, -3.0F, 8.0F, 12.0F, 6.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, -24.0F, 0.0F));
|
||||
|
||||
ModelPartData bodywear = body.addChild("bodywear", ModelPartBuilder.create().uv(0, 18).cuboid(-4.0F, 0.0F, -3.0F, 8.0F, 20.0F, 6.0F, new Dilation(0.5F)), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
|
||||
|
||||
ModelPartData arms = mambo.addChild("arms", ModelPartBuilder.create().uv(28, 36).cuboid(-4.0F, 2.0F, -2.0F, 8.0F, 4.0F, 4.0F, new Dilation(0.0F))
|
||||
.uv(32, 44).cuboid(-8.0F, -2.0F, -2.0F, 4.0F, 8.0F, 4.0F, new Dilation(0.0F)), ModelTransform.of(0.0F, -21.05F, -1.05F, -0.7505F, 0.0F, 0.0F));
|
||||
|
||||
ModelPartData mirrored = arms.addChild("mirrored", ModelPartBuilder.create().uv(48, 44).cuboid(4.0F, -23.05F, -3.05F, 4.0F, 8.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 21.05F, 1.05F));
|
||||
|
||||
ModelPartData right_leg = mambo.addChild("right_leg", ModelPartBuilder.create().uv(0, 44).cuboid(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(-2.0F, -12.0F, 0.0F));
|
||||
|
||||
ModelPartData left_leg = mambo.addChild("left_leg", ModelPartBuilder.create().uv(16, 44).cuboid(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(2.0F, -12.0F, 0.0F));
|
||||
|
||||
ModelPartData right_arm = mambo.addChild("right_arm", ModelPartBuilder.create().uv(0, 60).cuboid(-3.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(-5.0F, -22.0F, 0.0F));
|
||||
|
||||
ModelPartData left_arm = mambo.addChild("left_arm", ModelPartBuilder.create().uv(16, 60).mirrored().cuboid(-1.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)).mirrored(false), ModelTransform.pivot(5.0F, -22.0F, 0.0F));
|
||||
return TexturedModelData.of(modelData, 128, 128);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAngles(BanditEntity banditEntity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||
this.head.yaw = netHeadYaw * (float) (Math.PI / 180.0);
|
||||
this.head.pitch = headPitch * (float) (Math.PI / 180.0);
|
||||
if (this.riding) {
|
||||
this.right_arm.pitch = (float) (-Math.PI / 5);
|
||||
this.right_arm.yaw = 0.0F;
|
||||
this.right_arm.roll = 0.0F;
|
||||
this.left_arm.pitch = (float) (-Math.PI / 5);
|
||||
this.left_arm.yaw = 0.0F;
|
||||
this.left_arm.roll = 0.0F;
|
||||
this.right_leg.pitch = -1.4137167F;
|
||||
this.right_leg.yaw = (float) (Math.PI / 10);
|
||||
this.right_leg.roll = 0.07853982F;
|
||||
this.left_leg.pitch = -1.4137167F;
|
||||
this.left_leg.yaw = (float) (-Math.PI / 10);
|
||||
this.left_leg.roll = -0.07853982F;
|
||||
} else {
|
||||
this.right_arm.pitch = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 2.0F * limbSwingAmount * 0.5F;
|
||||
this.right_arm.yaw = 0.0F;
|
||||
this.right_arm.roll = 0.0F;
|
||||
this.left_arm.pitch = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F;
|
||||
this.left_arm.yaw = 0.0F;
|
||||
this.left_arm.roll = 0.0F;
|
||||
this.right_leg.pitch = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount * 0.5F;
|
||||
this.right_leg.yaw = 0.0F;
|
||||
this.right_leg.roll = 0.0F;
|
||||
this.left_leg.pitch = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount * 0.5F;
|
||||
this.left_leg.yaw = 0.0F;
|
||||
this.left_leg.roll = 0.0F;
|
||||
}
|
||||
|
||||
IllagerEntity.State state = banditEntity.getState();
|
||||
if (state == IllagerEntity.State.ATTACKING) {
|
||||
if (banditEntity.getMainHandStack().isEmpty()) {
|
||||
CrossbowPosing.meleeAttack(this.left_arm, this.right_arm, true, this.handSwingProgress, ageInTicks);
|
||||
} else {
|
||||
CrossbowPosing.meleeAttack(this.right_arm, this.left_arm, banditEntity, this.handSwingProgress, ageInTicks);
|
||||
}
|
||||
} else if (state == IllagerEntity.State.CROSSBOW_CHARGE) {
|
||||
CrossbowPosing.charge(this.right_arm, this.left_arm, banditEntity, true);
|
||||
} else if (state == IllagerEntity.State.CELEBRATING) {
|
||||
this.right_arm.pivotZ = 0.0F;
|
||||
this.right_arm.pivotX = -5.0F;
|
||||
this.right_arm.pitch = MathHelper.cos(ageInTicks * 0.6662F) * 0.05F;
|
||||
this.right_arm.roll = 2.670354F;
|
||||
this.right_arm.yaw = 0.0F;
|
||||
this.left_arm.pivotZ = 0.0F;
|
||||
this.left_arm.pivotX = 5.0F;
|
||||
this.left_arm.pitch = MathHelper.cos(ageInTicks * 0.6662F) * 0.05F;
|
||||
this.left_arm.roll = (float) (-Math.PI * 3.0 / 4.0);
|
||||
this.left_arm.yaw = 0.0F;
|
||||
}
|
||||
|
||||
boolean bl = state == IllagerEntity.State.CROSSED;
|
||||
this.arms.visible = bl;
|
||||
this.left_arm.visible = !bl;
|
||||
this.right_arm.visible = !bl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, VertexConsumer vertexConsumer, int light, int overlay, int color) {
|
||||
mambo.render(matrices, vertexConsumer, light, overlay, color);
|
||||
}
|
||||
|
||||
private ModelPart getAttackingArm(Arm arm) {
|
||||
return arm == Arm.LEFT ? this.left_arm : this.right_arm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelPart getPart() {
|
||||
return mambo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArmAngle(Arm arm, MatrixStack matrices) {
|
||||
this.getAttackingArm(arm).rotate(matrices);
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package net.voltexstudios.entity.client.bandit;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
||||
import net.minecraft.client.render.entity.feature.HeldItemFeatureRenderer;
|
||||
import net.minecraft.client.render.entity.model.IllagerEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.mob.VindicatorEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.entity.custom.BanditEntity;
|
||||
|
||||
public class BanditRenderer extends MobEntityRenderer<BanditEntity, BanditModel<BanditEntity>> {
|
||||
|
||||
public BanditRenderer(EntityRendererFactory.Context context) {
|
||||
super(context, new BanditModel<>(context.getPart(BanditModel.BANDIT)), 0.5f);
|
||||
this.addFeature(
|
||||
new HeldItemFeatureRenderer<>(this, context.getHeldItemRenderer()) {
|
||||
public void render(
|
||||
MatrixStack matrixStack,
|
||||
VertexConsumerProvider vertexConsumerProvider,
|
||||
int i,
|
||||
BanditEntity banditEntity,
|
||||
float f,
|
||||
float g,
|
||||
float h,
|
||||
float j,
|
||||
float k,
|
||||
float l
|
||||
) {
|
||||
if (banditEntity.isAttacking()) {
|
||||
matrixStack.push();
|
||||
|
||||
// Adjust the position of the item to the hand
|
||||
if (banditEntity.isLeftHanded()) {
|
||||
matrixStack.translate(0.0625, 1.3, 0.0625); // Adjust these values as needed
|
||||
} else {
|
||||
matrixStack.translate(-0.0625, 1.3, 0.0625); // Adjust these values as needed
|
||||
}
|
||||
|
||||
super.render(matrixStack, vertexConsumerProvider, i, banditEntity, f, g, h, j, k, l);
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(BanditEntity entity) {
|
||||
return Identifier.of(VoltexDesertUpdate.MOD_ID, "textures/entity/bandit/bandit.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(BanditEntity livingEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
|
||||
if(livingEntity.isBaby()) {
|
||||
matrixStack.scale(0.5f, 0.5f, 0.5f);
|
||||
} else {
|
||||
matrixStack.scale(1f, 1f, 1f);
|
||||
}
|
||||
|
||||
super.render(livingEntity, f, g, matrixStack, vertexConsumerProvider, i);
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package net.voltexstudios.entity.client.cobra;
|
||||
|
||||
import net.minecraft.client.render.entity.animation.Animation;
|
||||
import net.minecraft.client.render.entity.animation.AnimationHelper;
|
||||
import net.minecraft.client.render.entity.animation.Keyframe;
|
||||
import net.minecraft.client.render.entity.animation.Transformation;
|
||||
|
||||
public class CobraAnimations {
|
||||
|
||||
public static final Animation MOVE = Animation.Builder.create(1f).looping()
|
||||
.addBoneAnimation("head",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(5f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC)))
|
||||
.addBoneAnimation("tounge",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 3f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("body",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(0f, 5f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.75f, AnimationHelper.createRotationalVector(0f, -5f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC)))
|
||||
.addBoneAnimation("bone",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(0f, -20f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.75f, AnimationHelper.createRotationalVector(0f, 20f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC)))
|
||||
.addBoneAnimation("bone2",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(0f, -32.5f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.75f, AnimationHelper.createRotationalVector(0f, 32.5f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC))).build();
|
||||
public static final Animation IDLE_TOUNGE = Animation.Builder.create(0.6766666f)
|
||||
.addBoneAnimation("tounge",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 3f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createTranslationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createTranslationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.6766666f, AnimationHelper.createTranslationalVector(0f, 0f, 3f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("tounge",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.20834334f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(-5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.2916767f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.3433333f, AnimationHelper.createRotationalVector(-5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.375f, AnimationHelper.createRotationalVector(-5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.4583433f, AnimationHelper.createRotationalVector(-5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(-5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5416766f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(-5f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.6766666f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR))).build();
|
||||
public static final Animation IDLE = Animation.Builder.create(0.6766666f)
|
||||
.addBoneAnimation("tounge",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 3f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("tounge",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR))).build();
|
||||
public static final Animation ATTACK = Animation.Builder.create(0.625f)
|
||||
.addBoneAnimation("head",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.125f, AnimationHelper.createRotationalVector(-22.5f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.3433333f, AnimationHelper.createRotationalVector(70f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.625f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC)))
|
||||
.addBoneAnimation("head_look",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.125f, AnimationHelper.createRotationalVector(25f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.3433333f, AnimationHelper.createRotationalVector(-40f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.625f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC)))
|
||||
.addBoneAnimation("tounge",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 3f),
|
||||
Transformation.Interpolations.CUBIC))).build();
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package net.voltexstudios.entity.client.cobra;
|
||||
|
||||
import net.minecraft.client.model.*;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.entity.model.EntityModelLayer;
|
||||
import net.minecraft.client.render.entity.model.SinglePartEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.entity.custom.CobraEntity;
|
||||
|
||||
public class CobraModel<T extends CobraEntity> extends SinglePartEntityModel<T> {
|
||||
|
||||
public static final EntityModelLayer COBRA = new EntityModelLayer(Identifier.of(VoltexDesertUpdate.MOD_ID, "cobra"), "main");
|
||||
|
||||
private final ModelPart cobra;
|
||||
private final ModelPart head;
|
||||
private final ModelPart body;
|
||||
|
||||
public CobraModel(ModelPart root) {
|
||||
this.cobra = root.getChild("mambo");
|
||||
this.head = this.cobra.getChild("head");
|
||||
this.body = this.cobra.getChild("body");
|
||||
}
|
||||
|
||||
public static TexturedModelData getTexturedModelData() {
|
||||
ModelData modelData = new ModelData();
|
||||
ModelPartData modelPartData = modelData.getRoot();
|
||||
ModelPartData mambo = modelPartData.addChild("mambo", ModelPartBuilder.create(), ModelTransform.pivot(0.5F, 14.0F, -13.0F));
|
||||
|
||||
ModelPartData head = mambo.addChild("head", ModelPartBuilder.create().uv(20, 9).cuboid(-1.5F, -9.125F, -2.125F, 3.0F, 10.0F, 3.0F, new Dilation(0.0F))
|
||||
.uv(20, 22).cuboid(-4.0F, -12.125F, -0.125F, 8.0F, 8.0F, 0.0F, new Dilation(0.0F)), ModelTransform.pivot(-0.5F, 9.125F, 6.125F));
|
||||
|
||||
ModelPartData head_look = head.addChild("head_look", ModelPartBuilder.create().uv(0, 20).cuboid(-2.0F, -2.8333F, -4.3333F, 4.0F, 3.0F, 6.0F, new Dilation(0.0F))
|
||||
.uv(32, 20).cuboid(-1.5F, 0.1667F, -4.3333F, 0.0F, 1.0F, 1.0F, new Dilation(0.0F))
|
||||
.uv(32, 19).cuboid(1.5F, 0.1667F, -4.3333F, 0.0F, 1.0F, 1.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, -9.2917F, -0.7917F));
|
||||
|
||||
ModelPartData tounge = head_look.addChild("tounge", ModelPartBuilder.create().uv(0, 29).cuboid(-1.5F, 0.0F, -3.0F, 3.0F, 0.0F, 3.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 0.1667F, -4.3333F));
|
||||
|
||||
ModelPartData body = mambo.addChild("body", ModelPartBuilder.create().uv(0, 0).cuboid(-2.0F, -2.0F, 0.0F, 4.0F, 4.0F, 6.0F, new Dilation(0.0F)), ModelTransform.pivot(-0.5F, 8.0F, 7.0F));
|
||||
|
||||
ModelPartData bone = body.addChild("bone", ModelPartBuilder.create().uv(0, 10).cuboid(-2.0F, -2.0F, 0.0F, 4.0F, 4.0F, 6.0F, new Dilation(0.01F)), ModelTransform.pivot(0.0F, 0.0F, 6.0F));
|
||||
|
||||
ModelPartData bone2 = bone.addChild("bone2", ModelPartBuilder.create().uv(20, 0).cuboid(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 7.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 1.0F, 6.0F));
|
||||
return TexturedModelData.of(modelData, 64, 64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAngles(CobraEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||
this.getPart().traverse().forEach(ModelPart::resetTransform);
|
||||
this.setHeadAngles(netHeadYaw, headPitch);
|
||||
|
||||
this.animateMovement(CobraAnimations.MOVE, limbSwing, limbSwingAmount, 2f, 2.5f);
|
||||
this.updateAnimation(entity.idleAnimationState, CobraAnimations.IDLE, ageInTicks, 1f);
|
||||
}
|
||||
|
||||
private void setHeadAngles(float headYaw, float headPitch) {
|
||||
headYaw = MathHelper.clamp(headYaw, -30.0F, 30.0F);
|
||||
headPitch = MathHelper.clamp(headPitch, -25.0F, 45.0F);
|
||||
|
||||
this.head.yaw = headYaw * 0.017453292F;
|
||||
this.head.pitch = headPitch * 0.017453292F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, VertexConsumer vertexConsumer, int light, int overlay, int color) {
|
||||
cobra.render(matrices, vertexConsumer, light, overlay, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelPart getPart() {
|
||||
return cobra;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package net.voltexstudios.entity.client.cobra;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.entity.custom.CobraEntity;
|
||||
|
||||
public class CobraRenderer extends MobEntityRenderer<CobraEntity, CobraModel<CobraEntity>> {
|
||||
|
||||
public CobraRenderer(EntityRendererFactory.Context context) {
|
||||
super(context, new CobraModel<>(context.getPart(CobraModel.COBRA)), 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(CobraEntity entity) {
|
||||
return Identifier.of(VoltexDesertUpdate.MOD_ID, "textures/entity/cobra/cobra.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(CobraEntity livingEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
|
||||
if(livingEntity.isBaby()) {
|
||||
matrixStack.scale(0.5f, 0.5f, 0.5f);
|
||||
} else {
|
||||
matrixStack.scale(1f, 1f, 1f);
|
||||
}
|
||||
|
||||
super.render(livingEntity, f, g, matrixStack, vertexConsumerProvider, i);
|
||||
}
|
||||
}
|
@ -0,0 +1,357 @@
|
||||
package net.voltexstudios.entity.client.mummy;
|
||||
|
||||
import net.minecraft.client.render.entity.animation.Animation;
|
||||
import net.minecraft.client.render.entity.animation.AnimationHelper;
|
||||
import net.minecraft.client.render.entity.animation.Keyframe;
|
||||
import net.minecraft.client.render.entity.animation.Transformation;
|
||||
|
||||
public class MummyAnimations {
|
||||
|
||||
public static final Animation WALK = Animation.Builder.create(1f).looping()
|
||||
.addBoneAnimation("mambo",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -3f, -2f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createTranslationalVector(0f, -2f, -2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, -2f, -2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, -3f, -2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createTranslationalVector(0f, -2f, -2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.9167666f, AnimationHelper.createTranslationalVector(0f, -2f, -2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -3f, -2f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("mambo",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(10f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("head",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createRotationalVector(0.02f, -0.06f, 2.34f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.16766666f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(-7.31f, -4.95f, 0.64f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(0.02f, -0.06f, 2.34f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.6766666f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("body",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 27.5f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.16766666f, AnimationHelper.createRotationalVector(0f, -0.83f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(0f, -27.5f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.6766666f, AnimationHelper.createRotationalVector(0f, 0.83f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 27.5f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_arm",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(-1f, -1f, -4f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, -1f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createTranslationalVector(-1f, -1f, -4f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_arm",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-89.65f, -4.99f, -10.06f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createRotationalVector(-97.49f, -4.98f, -10.89f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(-97.49f, -4.98f, -10.89f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(-91.71f, -4.94f, -15.07f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(-97.49f, -4.98f, -10.89f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.9167666f, AnimationHelper.createRotationalVector(-97.49f, -4.98f, -10.89f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(-89.65f, -4.99f, -10.06f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_arm",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5f, AnimationHelper.createTranslationalVector(1f, -1f, -4f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -1f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_arm",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-104.78f, 2.58f, 9.67f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createRotationalVector(-107.74f, 4.15f, 15.73f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(-107.74f, 4.15f, 15.73f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(-99.34f, 4.46f, 16.94f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(-107.74f, 4.15f, 15.73f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.9167666f, AnimationHelper.createRotationalVector(-107.74f, 4.15f, 15.73f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(-104.78f, 2.58f, 9.67f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_leg",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 4f, -4f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createTranslationalVector(0f, 2.67f, -3f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, 1.33f, 1f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, 2f, 2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createTranslationalVector(0f, 1.33f, 1f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.6766666f, AnimationHelper.createTranslationalVector(0f, 1f, -1f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.9167666f, AnimationHelper.createTranslationalVector(0f, 4f, -3f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 4f, -4f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_leg",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-17.1f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(15f, 0f, 7.5f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.6766666f, AnimationHelper.createRotationalVector(44.51f, -0.05f, -18.09f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.9167666f, AnimationHelper.createRotationalVector(-40.22f, -6.05f, 0.86f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(-17.1f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_leg",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 2f, 2f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.08343333f, AnimationHelper.createTranslationalVector(0f, 1f, 2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.16766666f, AnimationHelper.createTranslationalVector(0f, 1f, -1f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, 4f, -3f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, 4f, -4f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createTranslationalVector(0f, 2.5f, -3f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.9167666f, AnimationHelper.createTranslationalVector(0f, 1.3f, 1f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 2f, 2f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_leg",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(15f, 0f, 7.5f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.16766666f, AnimationHelper.createRotationalVector(44.51f, 0.05f, 18.09f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(-40.22f, 6.05f, -0.86f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5f, AnimationHelper.createRotationalVector(-17.1f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(1f, AnimationHelper.createRotationalVector(15f, 0f, 7.5f),
|
||||
Transformation.Interpolations.LINEAR))).build();
|
||||
|
||||
|
||||
public static final Animation IDLE = Animation.Builder.create(2f).looping()
|
||||
.addBoneAnimation("mambo",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -3f, -2f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.7916766f, AnimationHelper.createTranslationalVector(0f, -3.5f, -2f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, -3f, -2f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("mambo",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(10f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("head",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.7916766f, AnimationHelper.createRotationalVector(-2.5f, 2.82f, 2.37f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(2f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("body",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 27.5f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("body",
|
||||
new Transformation(Transformation.Targets.SCALE,
|
||||
new Keyframe(0f, AnimationHelper.createScalingVector(1f, 1f, 1f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.7916766f, AnimationHelper.createScalingVector(0.98f, 0.98f, 0.98f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(2f, AnimationHelper.createScalingVector(1f, 1f, 1f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_arm",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(-1f, -1f, -4f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_arm",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-89.65f, -4.99f, -10.06f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.7916766f, AnimationHelper.createRotationalVector(-84.36f, -9.03f, -0.79f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(2f, AnimationHelper.createRotationalVector(-89.65f, -4.99f, -10.06f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_arm",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_arm",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-104.78f, 2.58f, 9.67f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.7916766f, AnimationHelper.createRotationalVector(-96.6f, 4.28f, -1.81f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(2f, AnimationHelper.createRotationalVector(-104.78f, 2.58f, 9.67f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_leg",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 4f, -4f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.7916766f, AnimationHelper.createTranslationalVector(0f, 4.5f, -3.75f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 4f, -4f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_leg",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-17.1f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_leg",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 2f, 2f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.7916766f, AnimationHelper.createTranslationalVector(0f, 2.5f, 2.25f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 2f, 2f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_leg",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(15f, 0f, 7.5f),
|
||||
Transformation.Interpolations.LINEAR))).build();
|
||||
|
||||
|
||||
public static final Animation ATTACK = Animation.Builder.create(0.625f)
|
||||
.addBoneAnimation("mambo",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -3f, -2f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -2f, 1f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, -3f, -2f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("mambo",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(10f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(-17.5f, 0f, 0f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(10f, 0f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("head",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(-69.99f, 3.46f, 4.11f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(-7.49f, 0.33f, 2.48f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("body",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 27.5f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_arm",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(-1f, -1f, -4f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createTranslationalVector(-1f, 0f, -3f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(-1f, -1f, -4f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_arm",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-89.65f, -4.99f, -10.06f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(-174.35f, -3.03f, 19.95f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.2916767f, AnimationHelper.createRotationalVector(-165.27f, -3.29f, 15.96f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(-77.15f, -4.99f, -10.06f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(-89.65f, -4.99f, -10.06f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_arm",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, 0f, 1f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, -1f, 0f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_arm",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-104.78f, 2.58f, 9.67f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(-165.02f, 12.67f, -10.65f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.2916767f, AnimationHelper.createRotationalVector(-159.18f, 11.33f, -7.95f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(-92.28f, 2.58f, 9.67f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(-104.78f, 2.58f, 9.67f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_leg",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 4f, -4f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.125f, AnimationHelper.createTranslationalVector(0f, 1f, -4f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, 3.5f, -3.5f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, 4f, -4f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("left_leg",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(-17.1f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.125f, AnimationHelper.createRotationalVector(-27.1f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(-19.6f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(-17.1f, -6.26f, -3.29f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_leg",
|
||||
new Transformation(Transformation.Targets.TRANSLATE,
|
||||
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 2f, 2f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, 0.5f, 3f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, 2f, 2f),
|
||||
Transformation.Interpolations.LINEAR)))
|
||||
.addBoneAnimation("right_leg",
|
||||
new Transformation(Transformation.Targets.ROTATE,
|
||||
new Keyframe(0f, AnimationHelper.createRotationalVector(15f, 0f, 7.5f),
|
||||
Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.25f, AnimationHelper.createRotationalVector(50f, 0f, 7.5f),
|
||||
Transformation.Interpolations.CUBIC),
|
||||
new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(15f, 0f, 7.5f),
|
||||
Transformation.Interpolations.LINEAR))).build();
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package net.voltexstudios.entity.client.mummy;
|
||||
|
||||
import net.minecraft.client.model.*;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.entity.model.EntityModelLayer;
|
||||
import net.minecraft.client.render.entity.model.SinglePartEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.entity.custom.MummyEntity;
|
||||
|
||||
public class MummyModel<T extends MummyEntity> extends SinglePartEntityModel<T> {
|
||||
|
||||
public static final EntityModelLayer MUMMY = new EntityModelLayer(Identifier.of(VoltexDesertUpdate.MOD_ID, "mummy"), "main");
|
||||
|
||||
private final ModelPart mummy;
|
||||
private final ModelPart head;
|
||||
|
||||
public MummyModel(ModelPart root) {
|
||||
this.mummy = root.getChild("mambo");
|
||||
this.head = this.mummy.getChild("head");
|
||||
}
|
||||
|
||||
public static TexturedModelData getTexturedModelData() {
|
||||
ModelData modelData = new ModelData();
|
||||
ModelPartData modelPartData = modelData.getRoot();
|
||||
ModelPartData mambo = modelPartData.addChild("mambo", ModelPartBuilder.create(), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
|
||||
|
||||
ModelPartData head = mambo.addChild("head", ModelPartBuilder.create().uv(0, 0).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(0.0F))
|
||||
.uv(30, 32).cuboid(-2.0F, -6.0F, 3.0F, 0.0F, 9.0F, 3.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
|
||||
|
||||
ModelPartData body = mambo.addChild("body", ModelPartBuilder.create().uv(0, 16).cuboid(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
|
||||
|
||||
ModelPartData left_arm = mambo.addChild("left_arm", ModelPartBuilder.create().uv(32, 0).cuboid(-1.0F, -2.0F, -2.0F, 3.0F, 12.0F, 4.0F, new Dilation(0.0F))
|
||||
.uv(44, 24).cuboid(2.0F, 2.0F, 0.0F, 2.0F, 6.0F, 0.0F, new Dilation(0.0F))
|
||||
.uv(40, 16).cuboid(0.0F, 6.0F, 2.0F, 0.0F, 4.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(5.0F, 2.0F, 0.0F));
|
||||
|
||||
ModelPartData right_arm = mambo.addChild("right_arm", ModelPartBuilder.create().uv(16, 32).cuboid(-2.0F, -2.0F, -2.0F, 3.0F, 12.0F, 4.0F, new Dilation(0.0F))
|
||||
.uv(40, 40).cuboid(-4.0F, 0.0F, 0.0F, 2.0F, 6.0F, 0.0F, new Dilation(0.0F))
|
||||
.uv(36, 32).cuboid(0.0F, 6.0F, 2.0F, 0.0F, 4.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(-5.0F, 2.0F, 0.0F));
|
||||
|
||||
ModelPartData left_leg = mambo.addChild("left_leg", ModelPartBuilder.create().uv(24, 16).mirrored().cuboid(-1.9F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)).mirrored(false)
|
||||
.uv(40, 24).cuboid(2.1F, 4.0F, 0.0F, 2.0F, 8.0F, 0.0F, new Dilation(0.0F)), ModelTransform.pivot(1.9F, 12.0F, 0.0F));
|
||||
|
||||
ModelPartData right_leg = mambo.addChild("right_leg", ModelPartBuilder.create().uv(0, 32).cuboid(-2.1F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F))
|
||||
.uv(36, 40).cuboid(-4.1F, 1.0F, 0.0F, 2.0F, 8.0F, 0.0F, new Dilation(0.0F)), ModelTransform.pivot(-1.9F, 12.0F, 0.0F));
|
||||
|
||||
return TexturedModelData.of(modelData, 64, 64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAngles(MummyEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||
this.getPart().traverse().forEach(ModelPart::resetTransform);
|
||||
this.setHeadAngles(netHeadYaw, headPitch);
|
||||
|
||||
this.animateMovement(MummyAnimations.WALK, limbSwing, limbSwingAmount, 2f, 2.5f);
|
||||
//this.updateAnimation(entity.idleAnimationState, MummyAnimations.IDLE, ageInTicks, 1f);
|
||||
}
|
||||
|
||||
private void setHeadAngles(float headYaw, float headPitch) {
|
||||
headYaw = MathHelper.clamp(headYaw, -30.0F, 30.0F);
|
||||
headPitch = MathHelper.clamp(headPitch, -25.0F, 45.0F);
|
||||
|
||||
this.head.yaw = headYaw * 0.017453292F;
|
||||
this.head.pitch = headPitch * 0.017453292F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, VertexConsumer vertexConsumer, int light, int overlay, int color) {
|
||||
mummy.render(matrices, vertexConsumer, light, overlay, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelPart getPart() {
|
||||
return this.mummy;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package net.voltexstudios.entity.client.mummy;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.entity.custom.MummyEntity;
|
||||
|
||||
public class MummyRenderer extends MobEntityRenderer<MummyEntity, MummyModel<MummyEntity>> {
|
||||
|
||||
public MummyRenderer(EntityRendererFactory.Context context) {
|
||||
super(context, new MummyModel<>(context.getPart(MummyModel.MUMMY)), 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(MummyEntity entity) {
|
||||
return Identifier.of(VoltexDesertUpdate.MOD_ID, "textures/entity/mummy/mummy.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MummyEntity livingEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
|
||||
if(livingEntity.isBaby()) {
|
||||
matrixStack.scale(0.5f, 0.5f, 0.5f);
|
||||
} else {
|
||||
matrixStack.scale(1f, 1f, 1f);
|
||||
}
|
||||
|
||||
super.render(livingEntity, f, g, matrixStack, vertexConsumerProvider, i);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package net.voltexstudios.entity.client;
|
||||
package net.voltexstudios.entity.client.vulture;
|
||||
|
||||
import net.minecraft.client.render.entity.animation.Animation;
|
||||
import net.minecraft.client.render.entity.animation.AnimationHelper;
|
@ -1,4 +1,4 @@
|
||||
package net.voltexstudios.entity.client;
|
||||
package net.voltexstudios.entity.client.vulture;
|
||||
|
||||
import net.minecraft.client.model.*;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
@ -1,4 +1,4 @@
|
||||
package net.voltexstudios.entity.client;
|
||||
package net.voltexstudios.entity.client.vulture;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
133
src/main/java/net/voltexstudios/entity/custom/BanditEntity.java
Normal file
@ -0,0 +1,133 @@
|
||||
package net.voltexstudios.entity.custom;
|
||||
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.ai.NavigationConditions;
|
||||
import net.minecraft.entity.ai.goal.*;
|
||||
import net.minecraft.entity.ai.pathing.MobNavigation;
|
||||
import net.minecraft.entity.attribute.DefaultAttributeContainer;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.entity.mob.HostileEntity;
|
||||
import net.minecraft.entity.mob.IllagerEntity;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.entity.passive.VillagerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.raid.RaiderEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.LocalDifficulty;
|
||||
import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.voltexstudios.item.ModItems;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BanditEntity extends IllagerEntity {
|
||||
|
||||
public BanditEntity(EntityType<? extends IllagerEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initGoals() {
|
||||
super.initGoals();
|
||||
this.goalSelector.add(0, new SwimGoal(this));
|
||||
this.goalSelector.add(2, new IllagerEntity.LongDoorInteractGoal(this));
|
||||
this.goalSelector.add(3, new RaiderEntity.PatrolApproachGoal(this, 10.0F));
|
||||
this.goalSelector.add(4, new MeleeAttackGoal(this, 1.0, false));
|
||||
//this.targetSelector.add(1, new RevengeGoal(this, RaiderEntity.class).setGroupRevenge());
|
||||
this.targetSelector.add(2, new ActiveTargetGoal<>(this, PlayerEntity.class, true));
|
||||
this.targetSelector.add(3, new ActiveTargetGoal<>(this, VillagerEntity.class, true));
|
||||
//this.targetSelector.add(4, new BanditEntity.TargetGoal(this));
|
||||
this.goalSelector.add(8, new WanderAroundGoal(this, 0.6));
|
||||
this.goalSelector.add(9, new LookAtEntityGoal(this, PlayerEntity.class, 3.0F, 1.0F));
|
||||
this.goalSelector.add(10, new LookAtEntityGoal(this, MobEntity.class, 8.0F));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData) {
|
||||
EntityData entityData2 = super.initialize(world, difficulty, spawnReason, entityData);
|
||||
((MobNavigation)this.getNavigation()).setCanPathThroughDoors(true);
|
||||
Random random = world.getRandom();
|
||||
this.initEquipment(random, difficulty);
|
||||
this.updateEnchantments(world, random, difficulty);
|
||||
return entityData2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IllagerEntity.State getState() {
|
||||
if (this.isAttacking()) {
|
||||
return IllagerEntity.State.ATTACKING;
|
||||
} else {
|
||||
return this.isCelebrating() ? IllagerEntity.State.CELEBRATING : IllagerEntity.State.CROSSED;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
if (!this.isAiDisabled() && NavigationConditions.hasMobNavigation(this)) {
|
||||
boolean bl = ((ServerWorld)this.getWorld()).hasRaidAt(this.getBlockPos());
|
||||
((MobNavigation)this.getNavigation()).setCanPathThroughDoors(bl);
|
||||
}
|
||||
|
||||
super.mobTick();
|
||||
}
|
||||
|
||||
public static DefaultAttributeContainer.Builder createBanditAttributes() {
|
||||
return HostileEntity.createHostileAttributes()
|
||||
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.35F)
|
||||
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 12.0)
|
||||
.add(EntityAttributes.GENERIC_MAX_HEALTH, 24.0)
|
||||
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 5.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initEquipment(Random random, LocalDifficulty localDifficulty) {
|
||||
this.equipStack(EquipmentSlot.MAINHAND, ModItems.SABER.getDefaultStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBonusForWave(ServerWorld world, int wave, boolean unused) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent getAmbientSound() {
|
||||
return SoundEvents.ENTITY_PILLAGER_AMBIENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent getDeathSound() {
|
||||
return SoundEvents.ENTITY_PILLAGER_DEATH;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent getHurtSound(DamageSource source) {
|
||||
return SoundEvents.ENTITY_PILLAGER_HURT;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SoundEvent getCelebratingSound() {
|
||||
return SoundEvents.ENTITY_PILLAGER_CELEBRATE;
|
||||
}
|
||||
|
||||
static class TargetGoal extends ActiveTargetGoal<LivingEntity> {
|
||||
public TargetGoal(BanditEntity banditEntity) {
|
||||
super(banditEntity, LivingEntity.class, 0, true, true, LivingEntity::isMobOrPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canStart() {
|
||||
return super.canStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
super.start();
|
||||
this.mob.setDespawnCounter(0);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package net.voltexstudios.entity.custom;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.AnimationState;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ai.goal.*;
|
||||
import net.minecraft.entity.attribute.DefaultAttributeContainer;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.mob.HostileEntity;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.World;
|
||||
import net.voltexstudios.blocks.ModBlocks;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class CobraEntity extends HostileEntity {
|
||||
|
||||
public final AnimationState idleAnimationState = new AnimationState();
|
||||
private int idleAnimationTimeout = 0;
|
||||
|
||||
public CobraEntity(EntityType<? extends CobraEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initGoals() {
|
||||
this.goalSelector.add(1, new SwimGoal(this));
|
||||
this.goalSelector.add(1, new CobraEntity.QuicksandJumpGoal(this, this.getWorld()));
|
||||
this.goalSelector.add(4, new MeleeAttackGoal(this, 0.8, false));
|
||||
this.goalSelector.add(5, new WanderAroundGoal(this, 0.8));
|
||||
|
||||
this.targetSelector.add(1, new RevengeGoal(this).setGroupRevenge());
|
||||
this.targetSelector.add(2, new ActiveTargetGoal<>(this, PlayerEntity.class, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
|
||||
if (this.getWorld().isClient()) {
|
||||
this.setupAnimationStates();
|
||||
}
|
||||
}
|
||||
|
||||
private void setupAnimationStates() {
|
||||
if (this.idleAnimationTimeout <= 0) {
|
||||
this.idleAnimationTimeout = 14;
|
||||
this.idleAnimationState.start(this.age);
|
||||
} else {
|
||||
--this.idleAnimationTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
public static DefaultAttributeContainer.Builder createCobraAttributes() {
|
||||
return HostileEntity.createHostileAttributes()
|
||||
.add(EntityAttributes.GENERIC_MAX_HEALTH, 8.0)
|
||||
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.4f)
|
||||
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 1.0);
|
||||
}
|
||||
|
||||
static class QuicksandJumpGoal extends Goal {
|
||||
private final MobEntity entity;
|
||||
private final World world;
|
||||
|
||||
public QuicksandJumpGoal(MobEntity entity, World world) {
|
||||
this.entity = entity;
|
||||
this.world = world;
|
||||
this.setControls(EnumSet.of(Goal.Control.JUMP));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canStart() {
|
||||
boolean bl = this.entity.hurtTime > 0;
|
||||
if (bl) {
|
||||
BlockPos blockPos = this.entity.getBlockPos().up();
|
||||
BlockState blockState = this.world.getBlockState(blockPos);
|
||||
return blockState.isOf(ModBlocks.QUICKSAND_BLOCK) || blockState.getCollisionShape(this.world, blockPos) == VoxelShapes.empty();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRunEveryTick() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
this.entity.getJumpControl().setActive();
|
||||
}
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.projectile.thrown.ThrownItemEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.world.World;
|
||||
@ -22,6 +23,27 @@ public class DuneProjectileEntity extends ThrownItemEntity {
|
||||
super(EntityType.EGG, livingEntity, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
System.out.println("Entity ID: " + this.getId()); // Debug-Nachricht
|
||||
World world = this.getWorld();
|
||||
if (world.isClient) {
|
||||
System.out.println("Spawning particles on client!"); // Debug-Nachricht
|
||||
for (int i = 0; i < 5; i++) {
|
||||
world.addParticle(
|
||||
ParticleTypes.FLAME,
|
||||
this.getX() + (random.nextDouble() - 0.5) * 0.5,
|
||||
this.getY() + (random.nextDouble() - 0.5) * 0.5,
|
||||
this.getZ() + (random.nextDouble() - 0.5) * 0.5,
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCollision(HitResult hitResult) {
|
||||
super.onCollision(hitResult);
|
||||
@ -36,6 +58,7 @@ public class DuneProjectileEntity extends ThrownItemEntity {
|
||||
super.onEntityHit(entityHitResult);
|
||||
Entity entity = entityHitResult.getEntity();
|
||||
entity.damage(this.getDamageSources().thrown(this, this.getOwner()), DAMAGE);
|
||||
this.discard();
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,86 @@
|
||||
package net.voltexstudios.entity.custom;
|
||||
|
||||
import net.minecraft.entity.AnimationState;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ai.goal.*;
|
||||
import net.minecraft.entity.attribute.DefaultAttributeContainer;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.mob.HostileEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MummyEntity extends HostileEntity {
|
||||
|
||||
public final AnimationState idleAnimationState = new AnimationState();
|
||||
private int idleAnimationTimeout = 0;
|
||||
|
||||
public MummyEntity(EntityType<? extends MummyEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initGoals() {
|
||||
this.goalSelector.add(8, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F));
|
||||
this.goalSelector.add(8, new LookAroundGoal(this));
|
||||
|
||||
this.goalSelector.add(2, new MummyAttackGoal(this, 1f, false));
|
||||
this.goalSelector.add(7, new WanderAroundGoal(this, 0.7f));
|
||||
this.targetSelector.add(2, new ActiveTargetGoal<>(this, PlayerEntity.class, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
|
||||
if (this.getWorld().isClient()) {
|
||||
this.setupAnimationStates();
|
||||
}
|
||||
}
|
||||
|
||||
private void setupAnimationStates() {
|
||||
if (this.idleAnimationTimeout <= 0) {
|
||||
this.idleAnimationTimeout = 40;
|
||||
this.idleAnimationState.start(this.age);
|
||||
} else {
|
||||
--this.idleAnimationTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
public static DefaultAttributeContainer.Builder createMummyAttributes() {
|
||||
return HostileEntity.createHostileAttributes()
|
||||
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.30F)
|
||||
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 12.0)
|
||||
.add(EntityAttributes.GENERIC_MAX_HEALTH, 24.0)
|
||||
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 5.0);
|
||||
}
|
||||
|
||||
static class MummyAttackGoal extends MeleeAttackGoal {
|
||||
private final MummyEntity mummy;
|
||||
private int ticks;
|
||||
|
||||
|
||||
public MummyAttackGoal(MummyEntity mummy, double speed, boolean pauseWhenMobIdle) {
|
||||
super(mummy, speed, pauseWhenMobIdle);
|
||||
this.mummy = mummy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
super.start();
|
||||
this.ticks = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
super.stop();
|
||||
this.mummy.setAttacking(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
this.ticks++;
|
||||
this.mummy.setAttacking(this.ticks >= 5 && this.getCooldown() < this.getMaxCooldown() / 2);
|
||||
}
|
||||
}
|
||||
}
|
@ -14,10 +14,11 @@ public class ModItemGroups {
|
||||
|
||||
public static final ItemGroup DESERT_UPDATE_GROUP = Registry.register(Registries.ITEM_GROUP,
|
||||
Identifier.of(VoltexDesertUpdate.MOD_ID, "desert_update"),
|
||||
FabricItemGroup.builder().icon(() -> new ItemStack(ModItems.DUNE_STAFF))
|
||||
FabricItemGroup.builder().icon(() -> new ItemStack(ModItems.SABER))
|
||||
.displayName(Text.translatable("itemgroup.voltexdesertupdate.desert_update"))
|
||||
.entries((displayContext, entries) -> {
|
||||
entries.add(ModItems.DUNE_STAFF);
|
||||
entries.add(ModItems.SABER);
|
||||
|
||||
entries.add(ModBlocks.QUICKSAND_BLOCK);
|
||||
entries.add(ModBlocks.PALM_WOOD);
|
||||
@ -25,6 +26,19 @@ public class ModItemGroups {
|
||||
entries.add(ModBlocks.PALM_LEAVES);
|
||||
entries.add(ModBlocks.PALM_SAPLING);
|
||||
entries.add(ModBlocks.PALM_LOG);
|
||||
|
||||
entries.add(ModBlocks.WIPED_SAND_SHADE_1);
|
||||
entries.add(ModBlocks.WIPED_SAND_SHADE_2);
|
||||
entries.add(ModBlocks.SANDSTONE_BRICKS);
|
||||
entries.add(ModBlocks.SANDSTONE_TILE_BRICKS);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_1);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_2);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_3);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_4);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_5);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_6);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_7);
|
||||
entries.add(ModBlocks.SANDSTONE_ROCK_SHADE_8);
|
||||
}).build());
|
||||
|
||||
public static void registerItemGroups() {
|
||||
|
@ -1,14 +1,14 @@
|
||||
package net.voltexstudios.item;
|
||||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroups;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Rarity;
|
||||
import net.voltexstudios.VoltexDesertUpdate;
|
||||
import net.voltexstudios.item.custom.DuneStaffItem;
|
||||
import net.voltexstudios.item.custom.SaberItem;
|
||||
|
||||
public class ModItems {
|
||||
|
||||
@ -18,6 +18,12 @@ public class ModItems {
|
||||
.fireproof()
|
||||
));
|
||||
|
||||
public static final Item SABER = registerItem("saber", new SaberItem(ToolMaterials.IRON, new Item.Settings()
|
||||
.attributeModifiers(
|
||||
SwordItem.createAttributeModifiers(ToolMaterials.IRON, 3, -2.4F)
|
||||
)
|
||||
));
|
||||
|
||||
private static Item registerItem(String name, Item item) {
|
||||
return Registry.register(Registries.ITEM, Identifier.of(VoltexDesertUpdate.MOD_ID, name), item);
|
||||
}
|
||||
@ -28,6 +34,7 @@ public class ModItems {
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(entries -> {
|
||||
// add items to the ingredients tab
|
||||
entries.add(DUNE_STAFF);
|
||||
entries.add(SABER);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
12
src/main/java/net/voltexstudios/item/custom/SaberItem.java
Normal file
@ -0,0 +1,12 @@
|
||||
package net.voltexstudios.item.custom;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.SwordItem;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
|
||||
public class SaberItem extends SwordItem {
|
||||
|
||||
public SaberItem(ToolMaterial toolMaterial, Settings settings) {
|
||||
super(toolMaterial, settings);
|
||||
}
|
||||
}
|
@ -21,6 +21,8 @@ public class ModConfiguredFeatures {
|
||||
|
||||
public static void bootstrap(Registerable<ConfiguredFeature<?, ?>> context) {
|
||||
|
||||
VoltexDesertUpdate.LOGGER.info("Bootstrapping ModConfiguredFeatures");
|
||||
|
||||
register(context, PALM_KEY, Feature.TREE, new TreeFeatureConfig.Builder(
|
||||
BlockStateProvider.of(ModBlocks.PALM_LOG),
|
||||
new BendingTrunkPlacer(3, 2, 0, 4, UniformIntProvider.create(1, 2)),
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
"item.voltexdesertupdate.dune_staff": "Staff of the Dunes",
|
||||
"item.voltexdesertupdate.saber": "Saber",
|
||||
|
||||
"entity.voltexdesertupdate.vulture": "Vulture",
|
||||
"entity.voltexdesertupdate.bandit": "Bandit",
|
||||
|
||||
"itemgroup.voltexdesertupdate.desert_update": "Desert Update",
|
||||
|
||||
@ -10,6 +12,18 @@
|
||||
"block.voltexdesertupdate.palm_wood": "Palm Wood",
|
||||
"block.voltexdesertupdate.palm_planks": "Palm Planks",
|
||||
"block.voltexdesertupdate.palm_leaves": "Palm Leaves",
|
||||
"block.voltexdesertupdate.palm_sapling": "Palm Sapling"
|
||||
"block.voltexdesertupdate.palm_sapling": "Palm Sapling",
|
||||
|
||||
"block.voltexdesertupdate.sandstone_bricks": "Sandstone Bricks",
|
||||
"block.voltexdesertupdate.sandstone_tile_bricks": "Sandstone Tile Bricks",
|
||||
"block.voltexdesertupdate.wiped_sand_shade_1": "Wiped Sand",
|
||||
"block.voltexdesertupdate.wiped_sand_shade_2": "Wiped Sand",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_1": "Sandstone Rock",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_2": "Sandstone Rock",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_3": "Sandstone Rock",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_4": "Sandstone Rock",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_5": "Sandstone Rock",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_6": "Sandstone Rock",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_7": "Sandstone Rock",
|
||||
"block.voltexdesertupdate.sandstone_rock_shade_8": "Sandstone Rock"
|
||||
}
|
After Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 510 B |
After Width: | Height: | Size: 527 B |
After Width: | Height: | Size: 522 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 554 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 527 B |
After Width: | Height: | Size: 518 B |
After Width: | Height: | Size: 432 B |
After Width: | Height: | Size: 411 B |
After Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 529 B |
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 406 B |
After Width: | Height: | Size: 478 B |