commit - dd41c79fb7602b9bbb98e427b931677c61980cea
commit + c1d9eeb8ff0caef261d62f8608da509912d6ef5e
blob - 0a7e7f1d6dcb3544e7f9d8fa85ba5bc4c7e30f05
blob + 4617ff020bfd9779c8c55061f04566b1e67a6d79
--- src/main/java/com/techsupportred/capybaramod/capybaramod.java
+++ src/main/java/com/techsupportred/capybaramod/capybaramod.java
import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraft.world.entity.SpawnPlacements;
import net.minecraft.world.entity.animal.Animal;
-import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
blob - c15a1b4e0d46b0f8a394a2a4deb6437b661fcaba
blob + 6ecd05e560cb1b94246fbddae815812cd9c6f0ab
--- src/main/java/com/techsupportred/capybaramod/entity/client/CapybaraModel.java
+++ src/main/java/com/techsupportred/capybaramod/entity/client/CapybaraModel.java
@Override
public ResourceLocation getTextureResource(CapybaraEntity object) {
- return new ResourceLocation(capybaramod.MOD_ID, "textures/entity/capybara_texture.png");
+ return new ResourceLocation(capybaramod.MOD_ID, "textures/entity/texture.png");
}
@Override
blob - e1f8e025923caabeec2f4588394ac951d99eb01b
blob + 2cfe75b0dd06b6521743cbbe030b4cbac2b6b5d9
--- src/main/java/com/techsupportred/capybaramod/entity/client/CapybaraRenderer.java
+++ src/main/java/com/techsupportred/capybaramod/entity/client/CapybaraRenderer.java
@Override
public ResourceLocation getTextureLocation(CapybaraEntity instance) {
- return new ResourceLocation(capybaramod.MOD_ID, "textures/entity/capybara_texture.png");
+ return new ResourceLocation(capybaramod.MOD_ID, "textures/entity/texture.png");
}
@Override
blob - 5b7823197dea7668b31e302967d7b8455e1b05bf
blob + 94cf37923d77c354748f64fcaa9ce4b3c7ecc566
--- src/main/java/com/techsupportred/capybaramod/entity/custom/CapybaraEntity.java
+++ src/main/java/com/techsupportred/capybaramod/entity/custom/CapybaraEntity.java
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.TamableAnimal;
+import java.util.Objects;
+
public class CapybaraEntity extends TamableAnimal implements IAnimatable {
private AnimationFactory factory = new AnimationFactory(this);
public void setTame(boolean tamed) {
super.setTame(tamed);
if (tamed) {
- getAttribute(Attributes.MAX_HEALTH).setBaseValue(10.0D);
- getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue((double)0.2f);
+ Objects.requireNonNull(getAttribute(Attributes.MAX_HEALTH)).setBaseValue(10.0D);
+ Objects.requireNonNull(getAttribute(Attributes.MOVEMENT_SPEED)).setBaseValue((double)0.2f);
} else {
- getAttribute(Attributes.MAX_HEALTH).setBaseValue(10.0D);
- getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue((double)0.2f);
+ Objects.requireNonNull(getAttribute(Attributes.MAX_HEALTH)).setBaseValue(10.0D);
+ Objects.requireNonNull(getAttribute(Attributes.MOVEMENT_SPEED)).setBaseValue((double)0.2f);
}
}
}
\ No newline at end of file
blob - c5dc9b9c2ae0417fed6e8cd8c1e81db1ccb2bde8 (mode 644)
blob + /dev/null
--- src/main/java/com/techsupportred/capybaramod/event/ModEvents.java
+++ /dev/null
-package com.techsupportred.capybaramod.event;
-
-import com.techsupportred.capybaramod.entity.ModEntityTypes;
-import com.techsupportred.capybaramod.entity.custom.CapybaraEntity;
-import com.techsupportred.capybaramod.capybaramod;
-import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
-import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.common.Mod;
-
-public class ModEvents {
- @Mod.EventBusSubscriber(modid = capybaramod.MOD_ID)
- public static class ForgeEvents {
-
- @Mod.EventBusSubscriber(modid = capybaramod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
- public static class ModEventBusEvents {
- @SubscribeEvent
- public static void entityAttributeEvent(EntityAttributeCreationEvent event) {
- event.put(ModEntityTypes.CAPYBARA.get(), CapybaraEntity.setAttributes());
- }
- }
-}}
blob - 914a423deb187df33670a35d7440dfd52711026c (mode 644)
blob + /dev/null
--- src/main/java/com/techsupportred/capybaramod/world/ModWorldEvents.java
+++ /dev/null
-package com.techsupportred.capybaramod.world;
-
-import com.techsupportred.capybaramod.capybaramod;
-import com.techsupportred.capybaramod.world.gen.ModEntityGeneration;
-import net.minecraftforge.event.world.BiomeLoadingEvent;
-import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.common.Mod;
-
-@Mod.EventBusSubscriber(modid = capybaramod.MOD_ID)
-public class ModWorldEvents {
- @SubscribeEvent
- public static void biomeLoadingEvent(final BiomeLoadingEvent event) {
- ModEntityGeneration.onEntitySpawn(event);
- }
-}
\ No newline at end of file
blob - a44a7a2c3e2f9b79deaf406eb633d7bbfe095d9a (mode 644)
blob + /dev/null
--- src/main/java/com/techsupportred/capybaramod/world/gen/ModEntityGeneration.java
+++ /dev/null
-package com.techsupportred.capybaramod.world.gen;
-
-import com.techsupportred.capybaramod.entity.ModEntityTypes;
-import net.minecraft.resources.ResourceKey;
-import net.minecraft.world.entity.EntityType;
-import net.minecraft.world.level.biome.Biome;
-import net.minecraft.world.level.biome.MobSpawnSettings;
-import net.minecraftforge.event.world.BiomeLoadingEvent;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class ModEntityGeneration {
- public static void onEntitySpawn(final BiomeLoadingEvent event) {
- addEntityToAllOverworldBiomes(event, ModEntityTypes.CAPYBARA.get(),
- 40, 2, 4);
- }
-
- private static void addEntityToAllBiomesExceptThese(BiomeLoadingEvent event, EntityType<?> type,
- int weight, int minCount, int maxCount, ResourceKey<Biome>... biomes) {
- // Goes through each entry in the biomes and sees if it matches the current biome we are loading
- boolean isBiomeSelected = Arrays.stream(biomes).map(ResourceKey::location)
- .map(Object::toString).anyMatch(s -> s.equals(event.getName().toString()));
-
- if(!isBiomeSelected) {
- addEntityToAllBiomes(event, type, weight, minCount, maxCount);
- }
- }
-
- @SafeVarargs
- private static void addEntityToSpecificBiomes(BiomeLoadingEvent event, EntityType<?> type,
- int weight, int minCount, int maxCount, ResourceKey<Biome>... biomes) {
- // Goes through each entry in the biomes and sees if it matches the current biome we are loading
- boolean isBiomeSelected = Arrays.stream(biomes).map(ResourceKey::location)
- .map(Object::toString).anyMatch(s -> s.equals(event.getName().toString()));
-
- if(isBiomeSelected) {
- addEntityToAllBiomes(event, type, weight, minCount, maxCount);
- }
- }
-
- private static void addEntityToAllOverworldBiomes(BiomeLoadingEvent event, EntityType<?> type,
- int weight, int minCount, int maxCount) {
- if(!event.getCategory().equals(Biome.BiomeCategory.THEEND) && !event.getCategory().equals(Biome.BiomeCategory.NETHER)) {
- addEntityToAllBiomes(event, type, weight, minCount, maxCount);
- }
- }
-
- private static void addEntityToAllBiomesNoNether(BiomeLoadingEvent event, EntityType<?> type,
- int weight, int minCount, int maxCount) {
- if(!event.getCategory().equals(Biome.BiomeCategory.NETHER)) {
- List<MobSpawnSettings.SpawnerData> base = event.getSpawns().getSpawner(type.getCategory());
- base.add(new MobSpawnSettings.SpawnerData(type,weight, minCount, maxCount));
- }
- }
-
- private static void addEntityToAllBiomesNoEnd(BiomeLoadingEvent event, EntityType<?> type,
- int weight, int minCount, int maxCount) {
- if(!event.getCategory().equals(Biome.BiomeCategory.THEEND)) {
- List<MobSpawnSettings.SpawnerData> base = event.getSpawns().getSpawner(type.getCategory());
- base.add(new MobSpawnSettings.SpawnerData(type,weight, minCount, maxCount));
- }
- }
-
- private static void addEntityToAllBiomes(BiomeLoadingEvent event, EntityType<?> type,
- int weight, int minCount, int maxCount) {
- List<MobSpawnSettings.SpawnerData> base = event.getSpawns().getSpawner(type.getCategory());
- base.add(new MobSpawnSettings.SpawnerData(type,weight, minCount, maxCount));
- }
-}
blob - ce901338cd1ebcb2c0deaa723ad70da571f972be
blob + 9cc7396d5fcdda1bbaa066c8848932475240894a
--- src/main/resources/assets/capybaramod/animations/capybara.animation.json
+++ src/main/resources/assets/capybaramod/animations/capybara.animation.json
-{
- "format_version": "1.8.0",
- "animations": {
- "animation.capybara.idle": {
- "loop": true
- },
- "animation.capybara.walk": {
- "loop": true,
- "animation_length": 1,
- "bones": {
- "body": {
- "rotation": {
- "0.0": {
- "vector": [0, 0, 0]
- },
- "0.5": {
- "vector": [-2.5, 0, 0]
- },
- "1.0": {
- "vector": [0, 0, 0]
- }
- }
- },
- "bone": {
- "rotation": {
- "0.0": {
- "vector": [0, 0, 0]
- },
- "0.5": {
- "vector": [-2.5, 0, 0]
- },
- "1.0": {
- "vector": [0, 0, 0]
- }
- },
- "position": {
- "0.0": {
- "vector": [0, 0, 0]
- },
- "0.5": {
- "vector": [0, 1, 0]
- },
- "1.0": {
- "vector": [0, 0, 0]
- }
- }
- },
- "leg1": {
- "rotation": {
- "0.0": {
- "vector": [-20, 0, 0]
- },
- "0.5": {
- "vector": [20, 0, 0]
- },
- "1.0": {
- "vector": [-20, 0, 0]
- }
- }
- },
- "leg2": {
- "rotation": {
- "0.0": {
- "vector": [20, 0, 0]
- },
- "0.5": {
- "vector": [-20, 0, 0]
- },
- "1.0": {
- "vector": [20, 0, 0]
- }
- }
- },
- "leg3": {
- "rotation": {
- "0.0": {
- "vector": [20, 0, 0]
- },
- "0.5": {
- "vector": [-20, 0, 0]
- },
- "1.0": {
- "vector": [20, 0, 0]
- }
- }
- },
- "leg4": {
- "rotation": {
- "0.0": {
- "vector": [-20, 0, 0]
- },
- "0.5": {
- "vector": [20, 0, 0]
- },
- "1.0": {
- "vector": [-20, 0, 0]
- }
- }
- }
- }
- },
- "animation.capybara.sitting": {
- "loop": true,
- "bones": {
- "body": {
- "position": {
- "vector": [0, -2, 0]
- }
- },
- "leg1": {
- "rotation": {
- "vector": [-87.5, 32.5, 0]
- },
- "position": {
- "vector": [0, -4, 2]
- }
- },
- "leg2": {
- "rotation": {
- "vector": [-90, -27.5, 0]
- },
- "position": {
- "vector": [0, -4, 2]
- }
- },
- "leg3": {
- "rotation": {
- "vector": [-90, 42.5, 0]
- },
- "position": {
- "vector": [0, -4, 0]
- }
- },
- "leg4": {
- "rotation": {
- "vector": [-90, -32.5, 0]
- },
- "position": {
- "vector": [0, -4, 0]
- }
- }
- }
- }
- },
- "geckolib_format_version": 2
+{
+ "format_version": "1.8.0",
+ "animations": {
+ "animation.capybara.idle": {
+ "loop": true
+ },
+ "animation.capybara.walk": {
+ "loop": true,
+ "animation_length": 1,
+ "bones": {
+ "body": {
+ "position": {
+ "0.0417": [0, 0, 0],
+ "0.375": [0, -0.25, 0],
+ "1.0": [0, 0, 0]
+ }
+ },
+ "bone": {
+ "position": {
+ "0.0": [0, -0.25, 0],
+ "0.5": [0, -0.5, 0],
+ "1.0": [0, -0.25, 0]
+ }
+ },
+ "leg1": {
+ "rotation": {
+ "0.0": [15, 0, 0],
+ "0.5": [-17.5, 0, 0],
+ "1.0": [15, 0, 0]
+ }
+ },
+ "leg2": {
+ "rotation": {
+ "0.0": [-17.5, 0, 0],
+ "0.5": [17.5, 0, 0],
+ "1.0": [-17.5, 0, 0]
+ }
+ },
+ "leg3": {
+ "rotation": {
+ "0.0": [12.5, 0, 0],
+ "0.5": [-15, 0, 0],
+ "1.0": [12.5, 0, 0]
+ }
+ },
+ "leg4": {
+ "rotation": {
+ "0.0": [-17.5, 0, 0],
+ "0.5": [17.5, 0, 0],
+ "1.0": [-17.5, 0, 0]
+ }
+ }
+ }
+ },
+ "animation.capybara.sitting": {
+ "loop": true,
+ "bones": {
+ "body": {
+ "position": [0, -2, 0]
+ },
+ "leg1": {
+ "rotation": [-90, 20, 0],
+ "position": [-0.25, -4, 2]
+ },
+ "leg2": {
+ "rotation": [-90, -12.5, 0],
+ "position": [2, -4, 2]
+ },
+ "leg3": {
+ "rotation": [-90, 5, 0],
+ "position": [-2, -4, 0]
+ },
+ "leg4": {
+ "rotation": [-90, -7.5, 0],
+ "position": [2, -4, 0]
+ }
+ }
+ }
+ }
}
\ No newline at end of file
blob - b46abdabee87640783811c90ea6713bc1aa8839b
blob + 3133c3f115fccec5862de650e1f93ea9fc87dd1a
--- src/main/resources/assets/capybaramod/geo/capybara.geo.json
+++ src/main/resources/assets/capybaramod/geo/capybara.geo.json
-{
- "format_version": "1.12.0",
- "minecraft:geometry": [
- {
- "description": {
- "identifier": "geometry.unknown",
- "texture_width": 64,
- "texture_height": 64,
- "visible_bounds_width": 3,
- "visible_bounds_height": 2.5,
- "visible_bounds_offset": [0, 0.75, 0]
- },
- "bones": [
- {
- "name": "body",
- "pivot": [-1, 13, 3],
- "rotation": [90, 0, 0],
- "cubes": [
- {"origin": [-4.5, 7, -4], "size": [9, 16, 8], "uv": [0, 0]}
- ]
- },
- {
- "name": "head",
- "pivot": [0, 12, -7]
- },
- {
- "name": "bone",
- "parent": "head",
- "pivot": [-0.5, 12, -11.5],
- "rotation": [17.5, 0, 0],
- "cubes": [
- {"origin": [-3.5, 9, -15.5], "size": [7, 7, 11], "uv": [0, 25]},
- {"origin": [2.5, 16, -7.5], "size": [1, 1, 2], "uv": [0, 0]},
- {"origin": [-3.5, 16, -7.5], "size": [1, 1, 2], "uv": [0, 0]}
- ]
- },
- {
- "name": "bone2",
- "parent": "bone",
- "pivot": [6.75, 11.85, -6.25],
- "rotation": [-3.01437, 0.65335, -41.48194]
- },
- {
- "name": "bone3",
- "parent": "bone",
- "pivot": [0, 21.5, -8]
- },
- {
- "name": "leg1",
- "pivot": [-3, 6, 7],
- "cubes": [
- {"origin": [-4.5, 0, 5], "size": [4, 6, 4], "uv": [26, 24]}
- ]
- },
- {
- "name": "leg2",
- "pivot": [3, 6, 7],
- "mirror": true,
- "cubes": [
- {"origin": [0.5, 0, 5], "size": [4, 6, 4], "uv": [26, 24]}
- ]
- },
- {
- "name": "leg3",
- "pivot": [-3, 6, -5],
- "cubes": [
- {"origin": [-4.5, 0, -7], "size": [4, 6, 4], "uv": [26, 24]}
- ]
- },
- {
- "name": "leg4",
- "pivot": [3, 6, -5],
- "mirror": true,
- "cubes": [
- {"origin": [0.5, 0, -7], "size": [4, 6, 4], "uv": [26, 24]}
- ]
- }
- ]
- }
- ]
+{
+ "format_version": "1.12.0",
+ "minecraft:geometry": [
+ {
+ "description": {
+ "identifier": "geometry.unknown",
+ "texture_width": 64,
+ "texture_height": 64,
+ "visible_bounds_width": 3,
+ "visible_bounds_height": 2.5,
+ "visible_bounds_offset": [0, 0.75, 0]
+ },
+ "bones": [
+ {
+ "name": "body",
+ "pivot": [-1, 13, 3],
+ "rotation": [90, 0, 0],
+ "cubes": [
+ {"origin": [-5.25, 6.25, -4], "size": [10.75, 17.5, 8], "uv": [0, 0]}
+ ]
+ },
+ {
+ "name": "head",
+ "pivot": [0, 12, -7]
+ },
+ {
+ "name": "bone",
+ "parent": "head",
+ "pivot": [-0.5, 12, -11.5],
+ "rotation": [17.5, 0, 0],
+ "cubes": [
+ {"origin": [-3.5, 10, -15.5], "size": [7, 7, 11], "uv": [0, 25]},
+ {"origin": [1.5, 17, -7.5], "size": [2, 1, 2], "uv": [0, 3]},
+ {"origin": [-3.5, 17, -7.5], "size": [2, 1, 2], "uv": [0, 0]}
+ ]
+ },
+ {
+ "name": "bone2",
+ "parent": "bone",
+ "pivot": [6.75, 11.85, -6.25],
+ "rotation": [-3.01437, 0.65335, -41.48194]
+ },
+ {
+ "name": "bone3",
+ "parent": "bone",
+ "pivot": [0, 21.5, -8]
+ },
+ {
+ "name": "leg1",
+ "pivot": [-3, 6, 7],
+ "cubes": [
+ {"origin": [-4.5, 0, 5], "size": [4, 6, 4], "uv": [36, 35]}
+ ]
+ },
+ {
+ "name": "leg2",
+ "pivot": [3, 6, 7],
+ "mirror": true,
+ "cubes": [
+ {"origin": [0.5, 0, 5], "size": [4, 6, 4], "uv": [36, 10], "mirror": false}
+ ]
+ },
+ {
+ "name": "leg3",
+ "pivot": [-3, 6, -5],
+ "cubes": [
+ {"origin": [-4.5, 0, -7], "size": [4, 6, 4], "uv": [36, 0]}
+ ]
+ },
+ {
+ "name": "leg4",
+ "pivot": [3, 6, -5],
+ "mirror": true,
+ "cubes": [
+ {"origin": [0.5, 0, -7], "size": [4, 6, 4], "uv": [25, 25], "mirror": false}
+ ]
+ }
+ ]
+ }
+ ]
}
\ No newline at end of file
blob - caee515e0534ad734dc7f0924fbfdba7bc7915c9
blob + 96798b1ea72c2fbe1e81013b3de22836e5c93137
--- src/main/resources/assets/capybaramod/lang/en_us.json
+++ src/main/resources/assets/capybaramod/lang/en_us.json
{
"item.capybaramod.capybara_spawn_egg": "Capybara Spawn Egg",
- "itemGroup.capybaratab": "Capybara Tutorial Tab"
+ "itemGroup.capybaratab": "Capybara Tab"
}
\ No newline at end of file
blob - 1f1e859464030296a7598c612467da8e52620cb7 (mode 644)
blob + /dev/null
Binary files src/main/resources/assets/capybaramod/textures/entity/capybara/capybara.png and /dev/null differ
blob - /dev/null
blob + 13c318d46cb7879be466e601143b0954c2f77dd7 (mode 644)
Binary files /dev/null and src/main/resources/assets/capybaramod/textures/entity/texture.png differ
blob - 1f1e859464030296a7598c612467da8e52620cb7 (mode 644)
blob + /dev/null
Binary files src/main/resources/assets/capybaramod/textures/entity/capybara_texture.png and /dev/null differ
blob - 109087838e63077c64dc28d34c6d01c31991a4f4 (mode 644)
blob + /dev/null
Binary files src/main/resources/assets/capybaramod/textures/entity/villager/profession/jumpy_master.png and /dev/null differ
blob - c00901d70e37cd30adca38ed2bd9fb5adcec3f0b (mode 644)
blob + /dev/null
--- src/main/resources/data/capybaramod/forge/biome_modifier/spawn_capybara.json
+++ /dev/null
-{
- "type": "forge:add_spawns",
- "biomes": [
- "minecraft:jungle"
- ],
- "spawners": {
- "type": "capybaramod:capybara",
- "weight": 150,
- "minCount": 1,
- "maxCount": 3
- }
-}
\ No newline at end of file