mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-10-25 16:46:25 -04:00
Compare commits
169
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
570805fdf1 | ||
|
|
ddecb08bc7 | ||
|
|
4d7cfcdf61 | ||
|
|
e56dd6ef64 | ||
|
|
ffe005511d | ||
|
|
1e634a20b8 | ||
|
|
f9f4745e93 | ||
|
|
c700674289 | ||
|
|
c4f0032eee | ||
|
|
d92986016b | ||
|
|
ab57e01242 | ||
|
|
0da1c740a4 | ||
|
|
a7979aa80c | ||
|
|
59804a4e08 | ||
|
|
072c67acad | ||
|
|
60bbe221de | ||
|
|
5f06dc214b | ||
|
|
a6607e585b | ||
|
|
20584f4507 | ||
|
|
9660f1f724 | ||
|
|
c8cbace800 | ||
|
|
a616a24923 | ||
|
|
12035dd589 | ||
|
|
9627b80b01 | ||
|
|
4e9cecc854 | ||
|
|
9d4b19b185 | ||
|
|
aee96d06aa | ||
|
|
23e3c585f7 | ||
|
|
c22a88079f | ||
|
|
2225402082 | ||
|
|
9197207431 | ||
|
|
47c7f7079c | ||
|
|
eb0c1dddfd | ||
|
|
e3dbfe6ff8 | ||
|
|
fac207f36b | ||
|
|
379e794848 | ||
|
|
9081a4b131 | ||
|
|
dc6d75b8ee | ||
|
|
bb297a4448 | ||
|
|
a93922c438 | ||
|
|
f7d21c80d7 | ||
|
|
9248d26fd4 | ||
|
|
b5ac54cd16 | ||
|
|
dc703e67f7 | ||
|
|
0930721865 | ||
|
|
644ff1772e | ||
|
|
3c7e0bebb6 | ||
|
|
0c0eea3876 | ||
|
|
5535140bb7 | ||
|
|
f9dd1448e5 | ||
|
|
ecf5d57ad2 | ||
|
|
8663888abc | ||
|
|
f452cd9a05 | ||
|
|
4fe9cd7fd6 | ||
|
|
9b0ca1c16b | ||
|
|
052ff59f57 | ||
|
|
40e5ef1c46 | ||
|
|
5025977d23 | ||
|
|
922006afe7 | ||
|
|
46cc7cb04d | ||
|
|
fa3e3bbb1b | ||
|
|
afbdcce337 | ||
|
|
2c1d11ed11 | ||
|
|
b88adf0479 | ||
|
|
b1066671f5 | ||
|
|
387e85d4ad | ||
|
|
1fa113f5ac | ||
|
|
77ab58d823 | ||
|
|
1a9e736d8b | ||
|
|
f680682f61 | ||
|
|
4d93d1244d | ||
|
|
6a7d5d2133 | ||
|
|
98397cd1da | ||
|
|
fc5a610394 | ||
|
|
504df5d998 | ||
|
|
3b4d3ebf50 | ||
|
|
aa39c1906e | ||
|
|
2e460e2ca2 | ||
|
|
a07ff7f442 | ||
|
|
5374569ea1 | ||
|
|
af9c1196bf | ||
|
|
09d5543469 | ||
|
|
49e4dd0298 | ||
|
|
c8e408c50a | ||
|
|
e8a0467643 | ||
|
|
2dd0b66b83 | ||
|
|
68374017e1 | ||
|
|
120520f51d | ||
|
|
e8dea9773a | ||
|
|
7b31e6bcc4 | ||
|
|
c6ffca639f | ||
|
|
c491a1f7ca | ||
|
|
0b333b743d | ||
|
|
95e79865e5 | ||
|
|
0e2860cd90 | ||
|
|
3259bf032c | ||
|
|
116205cdf1 | ||
|
|
43277d18dc | ||
|
|
86153419ee | ||
|
|
2b4d9c451c | ||
|
|
7f0e2fa9d8 | ||
|
|
e165095bd5 | ||
|
|
b8708d6e10 | ||
|
|
ef536390ca | ||
|
|
28befab173 | ||
|
|
c142439d5b | ||
|
|
1ca7335654 | ||
|
|
9197d9cdcd | ||
|
|
f75813e64d | ||
|
|
1f617c76a4 | ||
|
|
ebf573aa7a | ||
|
|
75363da470 | ||
|
|
cce4b932cc | ||
|
|
0973e1ced0 | ||
|
|
e7b5c84024 | ||
|
|
4001cc2a89 | ||
|
|
6e57d77d10 | ||
|
|
2206d96a6e | ||
|
|
33f05858f1 | ||
|
|
8443b88c16 | ||
|
|
a4f204a5a3 | ||
|
|
31b6be2164 | ||
|
|
0dbf73067b | ||
|
|
775703e1f5 | ||
|
|
bcdfef4886 | ||
|
|
a19adb463b | ||
|
|
b71208299f | ||
|
|
136b5824b0 | ||
|
|
5004edbbb6 | ||
|
|
d8bdd6329a | ||
|
|
82d56637a0 | ||
|
|
7232a43816 | ||
|
|
098eb7d14b | ||
|
|
835b70ed48 | ||
|
|
9d828a86fb | ||
|
|
910551ee70 | ||
|
|
9beee548d4 | ||
|
|
f9189b265f | ||
|
|
6f3894f27b | ||
|
|
bbc9a5e62e | ||
|
|
94765da04a | ||
|
|
8caa82f123 | ||
|
|
8e1fcc6f14 | ||
|
|
21c4d0233d | ||
|
|
2f87d53af6 | ||
|
|
131ef31492 | ||
|
|
b6b067b1d3 | ||
|
|
546f10eca7 | ||
|
|
542839ba69 | ||
|
|
efab1bba08 | ||
|
|
8f986bc326 | ||
|
|
e155d32aaf | ||
|
|
743e0b7d66 | ||
|
|
1518d703f9 | ||
|
|
af9d851d67 | ||
|
|
20ca91f1c9 | ||
|
|
6fb3c0e49a | ||
|
|
5cb4ff5f5f | ||
|
|
d035c08a5c | ||
|
|
fda7b13f50 | ||
|
|
fb4aaed220 | ||
|
|
c5e1b37ead | ||
|
|
2be9d303ea | ||
|
|
99ac6d213a | ||
|
|
f595724971 | ||
|
|
0511ba147b | ||
|
|
6f4aae8b7d | ||
|
|
01e5e74e64 | ||
|
|
b6565a5dee |
+9
-18
@@ -1,20 +1,11 @@
|
||||
# Changelog
|
||||
## [1.8.3 (MONTH xth, 2026)](#1-8-3)
|
||||
## [1.8.x (MONTH xth, 2026)](#1-8-x)
|
||||
|
||||
### Additions
|
||||
|
||||
### New rideable Pokémon
|
||||
|
||||
### Pokémon Added
|
||||
#### Generation 4
|
||||
|
||||
#### Generation 5
|
||||
|
||||
#### Generation 6
|
||||
|
||||
#### Generation 7
|
||||
|
||||
#### Generation 8
|
||||
|
||||
#### Generation 9
|
||||
|
||||
### Model updates for the following Pokémon
|
||||
|
||||
@@ -23,15 +14,15 @@
|
||||
### Changes
|
||||
|
||||
### Fixes
|
||||
- Fixed datapacks with item interaction evolutions that don't specify an item crashing the world on load.
|
||||
- Fixed the Pokédex evolution tree crashing when a datapack's dex entry is missing an evolution's form.
|
||||
- Fixed the Pokédex evolution tree crashing with a stack overflow on evolutions that loop back on themselves.
|
||||
- Fixed form-changing evolutions sometimes resolving to the source form in the Pokédex evolution tree.
|
||||
- Broken datapack evolutions are now logged and skipped in the Pokédex evolution tree instead of crashing.
|
||||
|
||||
### Developer
|
||||
|
||||
### Molang & Datapacks
|
||||
- Added `q.target_fainted` function to move action effects that checks if any opponents fainted from the move.
|
||||
|
||||
### Particles
|
||||
|
||||
#### New Move Animations
|
||||
|
||||
### Localization
|
||||
- Updated translations for:
|
||||
- Updated translations for:
|
||||
@@ -0,0 +1,107 @@
|
||||
# Changelog
|
||||
## [1.8.3 (October 25th, 2026)](#1-8-3)
|
||||
|
||||
### Additions
|
||||
- Added compatability with AppleSkin.
|
||||
|
||||
### New Rideable Pokémon
|
||||
- Vikavolt
|
||||
- Fearow
|
||||
|
||||
### Particles
|
||||
## New Move Animations
|
||||
- Water Shuriken
|
||||
|
||||
### Cries added/updated for the following Pokémon
|
||||
- Hoppip
|
||||
- Skiploom
|
||||
- Jumpluff
|
||||
- Houndour
|
||||
- Houndoom
|
||||
- Wurmple
|
||||
- Silcoon
|
||||
- Beautifly
|
||||
- Cascoon
|
||||
- Dustox
|
||||
- Surskit
|
||||
- Masquerain
|
||||
- Torkoal
|
||||
- Starly
|
||||
- Staravia
|
||||
- Staraptor
|
||||
- Combee
|
||||
- Vespiquen
|
||||
- Dusknoir
|
||||
- Helioptile
|
||||
- Heliolisk
|
||||
- Grubbin
|
||||
- Charjabug
|
||||
- Vikavolt
|
||||
- Applin (updated)
|
||||
- Flapple (updated)
|
||||
- Appletun
|
||||
- Runerigus
|
||||
- Dipplin
|
||||
|
||||
### Animation updates for the following Pokémon
|
||||
- Vikavolt
|
||||
- Magby
|
||||
- Magmar
|
||||
- Ninetales (+ Alolan)
|
||||
- Spearow
|
||||
- Fearow
|
||||
- Squawkabilly
|
||||
- Mudkip
|
||||
- Marshtomp
|
||||
- Swampert
|
||||
|
||||
### Changes
|
||||
- Changed the Misc icon in the Campfire Pot Recipe Book to Health Candy.
|
||||
- Moved EXP Candies from the Medicine recipe book category to the Misc category.
|
||||
- Removed Dynamic Lights data from the Magmarizer item for consistency with the block.
|
||||
- Added `doPokemonPredation` game rule, which controls aggressiveness of Pokémon with the `hate_entity` brain task defined.
|
||||
- Added `predation_chance` server config value, which controls the possibility of attacking the hated entity found in `hate_entity` brain tasks.
|
||||
- Prehistoric Eroded Pillar generates slightly more frequently.
|
||||
- Togekiss was changed from a jet-style mount to bird-style.
|
||||
|
||||
### Fixes
|
||||
- Fixed datapacks with item interaction evolutions that don't specify an item crashing the world on load.
|
||||
- Fixed the Pokédex evolution tree crashing when a datapack's dex entry is missing an evolution's form.
|
||||
- Fixed the Pokédex evolution tree crashing with a stack overflow on evolutions that loop back on themselves.
|
||||
- Fixed the Pokédex evolution tree crashing when looking at a dex that is not part of the "National Dex" aggregate.
|
||||
- Fixed some display names in the Pokédex evolution tree having unintended font colours.
|
||||
- Fixed evolution trees not building properly when a Pokémon has several Pokédex entries for different regions.
|
||||
- Fixed form-changing evolutions sometimes resolving to the source form in the Pokédex evolution tree.
|
||||
- Broken datapack evolutions are now logged and skipped in the Pokédex evolution tree instead of crashing.
|
||||
- Fixed the `alpha` property having no tab completion in commands such as `/pokespawn`, `/pokegive` and `/pokeedit`, and added the missing `dmax_level`, `gmax_factor` and `tradable` aliases to tab completion.
|
||||
- Fixed friendship booster items not being recognised as such.
|
||||
- Fixed conflicts with other mods that would make use of recipe books in certain ways (Farmer's Delight Cooking Pot).
|
||||
- Fixed Pokémon battles stalling when a sidemod cancels the `THROWN_POKEBALL_HIT` hit event.
|
||||
- Fixed choice feature tab completion in `spawnpokemon/pokegive/pokeedit` commands.
|
||||
- Fixed MoLang that's targeting players intermittedly failing when they have died, requiring them to relog.
|
||||
- Fixed a NeoForge bug where none of the Cobblemon plants/berries could be placed into pots.
|
||||
- Fixed party overlay not hiding when the player opens the Pokédex scanner.
|
||||
- Fixed `hate_entity` task focusing on its own entity, therefore enabling deadly warfare between Zangoose and Seviper.
|
||||
- Prehistoric Frozen Pond, Prehistoric Frozen Spike, and Prehistoric Lush Den now actually generate (oops).
|
||||
- Fixed Frogadier floating in its `battle_idle` animation.
|
||||
- Fixed absence or incorrect mergers in spawning conditions, causing the max height/depth of conditions to use the min value instead.
|
||||
- Added stricter riding checks on server side to prevent possible packet forgery when a player tries to ride Pokémon.
|
||||
- Fixed Pokémon cries and animation sounds played from GUIs, such as the starter selection screen and the Pokédex, being tied to the Master volume slider instead of Friendly Creatures.
|
||||
- Fixed Archeops T-posing during its `air_cry` animation.
|
||||
|
||||
### Developer
|
||||
- Bumped NeoForge to `21.1.195` to get access to MixinExtras `0.5` and the expressions annotation.
|
||||
- New Platform Event `PLAYER_RESPAWN` which is fired when a player respawns (either through death or returning from the end).
|
||||
- Platform Events `SERVER_PLAYER_TICK_PRE` and `SERVER_PLAYER_TICK_POST` no longer fire when the player is dead.
|
||||
- It is now tied much closer to the actual entity rather than the player or their connection.
|
||||
|
||||
### Molang & Datapacks
|
||||
- Fixed `q.pokemon.nature` returning class instance instead of proper string value (`cobblemon:adamant`).
|
||||
- Fixed `q.entity.is_looking_at` result being always `1` for whatever entity passed as the target parameter.
|
||||
- Added hate chance optional parameter to `hate_entity` task. `1.0` will make an entity always attack the target.
|
||||
|
||||
### Localization
|
||||
- Updated translations for:
|
||||
- Russian
|
||||
- Japanese
|
||||
- Brazilian Portuguese
|
||||
+7
-17
@@ -16,6 +16,7 @@ import com.cobblemon.mod.common.item.crafting.CookingPotShapelessRecipe;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import net.minecraft.client.ClientRecipeBook;
|
||||
import net.minecraft.client.RecipeBookCategories;
|
||||
import net.minecraft.client.gui.screens.recipebook.RecipeCollection;
|
||||
@@ -63,23 +64,12 @@ public abstract class ClientRecipeBookMixin {
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "setupCollections", at = @At("RETURN"))
|
||||
private void addCustomAggregateCategories(Iterable<RecipeHolder<?>> recipes, RegistryAccess registryAccess, CallbackInfo ci) {
|
||||
Map<RecipeBookCategories, List<List<RecipeHolder<?>>>> map = categorizeAndGroupRecipes(recipes);
|
||||
Map<RecipeBookCategories, List<RecipeCollection>> map2 = Maps.newHashMap();
|
||||
ImmutableList.Builder<RecipeCollection> builder = ImmutableList.builder();
|
||||
|
||||
map.forEach((recipeBookCategories, list) -> {
|
||||
List<RecipeCollection> collections = list.stream()
|
||||
.map(listx -> new RecipeCollection(registryAccess, listx))
|
||||
.peek(builder::add)
|
||||
.collect(ImmutableList.toImmutableList());
|
||||
map2.put(recipeBookCategories, collections);
|
||||
});
|
||||
RecipeBookCategories.AGGREGATE_CATEGORIES.forEach((recipeBookCategories, list) -> map2.put(recipeBookCategories, (List) list.stream().flatMap((recipeBookCategoriesx) -> ((List) map2.getOrDefault(recipeBookCategoriesx, ImmutableList.of())).stream()).collect(ImmutableList.toImmutableList())));
|
||||
@Inject(method = "setupCollections",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lcom/google/common/collect/ImmutableMap;copyOf(Ljava/util/Map;)Lcom/google/common/collect/ImmutableMap;"
|
||||
))
|
||||
private void addCustomAggregateCategories(Iterable<RecipeHolder<?>> recipes, RegistryAccess registryAccess, CallbackInfo ci, @Local(name = "map2") Map<RecipeBookCategories, List<RecipeCollection>> map2) {
|
||||
CobblemonRecipeCategories.Companion.getCustomAggregateCategories().forEach((recipeBookCategories, list) -> map2.put(recipeBookCategories, (List) list.stream().flatMap((recipeBookCategoriesx) -> ((List) map2.getOrDefault(recipeBookCategoriesx, ImmutableList.of())).stream()).collect(ImmutableList.toImmutableList())));
|
||||
|
||||
this.collectionsByTab = ImmutableMap.copyOf(map2);
|
||||
this.allCollections = builder.build();
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,7 @@ import com.cobblemon.mod.common.ModAPI;
|
||||
import com.cobblemon.mod.common.item.PokeBallItem;
|
||||
import com.cobblemon.mod.common.item.PokedexItem;
|
||||
import com.cobblemon.mod.common.item.WearableItem;
|
||||
import com.cobblemon.mod.common.item.components.PokeBallComponent;
|
||||
import com.cobblemon.mod.common.item.components.TMMoveComponent;
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.ItemModelShaper;
|
||||
@@ -59,27 +57,11 @@ public abstract class ItemRendererMixin {
|
||||
cancellable = true
|
||||
)
|
||||
private void cobblemon$overrideItemModel(ItemStack stack, ItemDisplayContext renderMode, boolean leftHanded, PoseStack matrices, MultiBufferSource multiBufferSource, int light, int overlay, BakedModel model, CallbackInfo ci) {
|
||||
boolean shouldBe2d =
|
||||
renderMode == ItemDisplayContext.GUI
|
||||
|| renderMode == ItemDisplayContext.FIXED
|
||||
|| stack.getItem() == CobblemonItems.TECHNICAL_MACHINE;
|
||||
|
||||
boolean shouldBe3d =
|
||||
renderMode == ItemDisplayContext.FIRST_PERSON_LEFT_HAND
|
||||
|| renderMode == ItemDisplayContext.FIRST_PERSON_RIGHT_HAND
|
||||
|| renderMode == ItemDisplayContext.THIRD_PERSON_LEFT_HAND
|
||||
|| renderMode == ItemDisplayContext.THIRD_PERSON_RIGHT_HAND
|
||||
|| renderMode == ItemDisplayContext.GROUND
|
||||
|| renderMode == ItemDisplayContext.HEAD;
|
||||
|
||||
boolean shouldBe2d = renderMode == ItemDisplayContext.GUI || renderMode == ItemDisplayContext.FIXED || stack.getItem() == CobblemonItems.TECHNICAL_MACHINE;
|
||||
ResourceLocation resourceLocation = null;
|
||||
if (stack.getItem() instanceof PokeBallItem) {
|
||||
if (shouldBe2d) resourceLocation = PokeBallComponent.getPokeBall(stack).getModel2d();
|
||||
if (shouldBe3d) resourceLocation = PokeBallComponent.getPokeBall(stack).getModel3d();
|
||||
}
|
||||
|
||||
if (shouldBe2d) {
|
||||
if (stack.getItem() instanceof PokedexItem pokedexItem) resourceLocation = pokedexItem.getType().getItemSpritePath();
|
||||
if (stack.getItem() instanceof PokeBallItem pokeBallItem) resourceLocation = pokeBallItem.getPokeBall().getModel2d();
|
||||
else if (stack.getItem() instanceof PokedexItem pokedexItem) resourceLocation = pokedexItem.getType().getItemSpritePath();
|
||||
else if (stack.getItem() == CobblemonItems.TECHNICAL_MACHINE) {
|
||||
TMMoveComponent component = stack.get(CobblemonItemComponents.TM_MOVE);
|
||||
if (component != null) {
|
||||
@@ -101,21 +83,16 @@ public abstract class ItemRendererMixin {
|
||||
@Inject(method = "getModel", at = @At("HEAD"), cancellable = true)
|
||||
private void cobblemon$getItemModel(ItemStack stack, Level world, LivingEntity entity, int seed, CallbackInfoReturnable<BakedModel> cir) {
|
||||
ResourceLocation resourceLocation = null;
|
||||
switch (stack.getItem()) {
|
||||
case PokeBallItem ignored -> resourceLocation = PokeBallComponent.getPokeBall(stack).getModel3d();
|
||||
case PokedexItem pokedexItem -> {
|
||||
boolean isScanModel = entity instanceof Player && entity.getUseItem() == stack && entity.isUsingItem();
|
||||
boolean canOpenScreen = entity != null && ((entity.getOffhandItem() == stack && !(entity.getMainHandItem().getItem() instanceof PokedexItem)) || entity.getMainHandItem() == stack);
|
||||
resourceLocation = pokedexItem.getType().getItemModelPath(isScanModel ? "scanning" : (canOpenScreen ? null : "off"));
|
||||
}
|
||||
case WearableItem wearableItem -> resourceLocation = wearableItem.getModel3d();
|
||||
default -> {
|
||||
}
|
||||
if (stack.getItem() instanceof PokeBallItem pokeBallItem) resourceLocation = pokeBallItem.getPokeBall().getModel3d();
|
||||
else if (stack.getItem() instanceof PokedexItem pokedexItem) {
|
||||
boolean isScanModel = entity instanceof Player && entity.getUseItem() == stack && entity.isUsingItem();
|
||||
boolean canOpenScreen = entity != null && ((entity.getOffhandItem() == stack && !(entity.getMainHandItem().getItem() instanceof PokedexItem)) || entity.getMainHandItem() == stack);
|
||||
resourceLocation = pokedexItem.getType().getItemModelPath(isScanModel ? "scanning" : (canOpenScreen ? null : "off"));
|
||||
}
|
||||
else if (stack.getItem() instanceof WearableItem wearableItem) resourceLocation = wearableItem.getModel3d();
|
||||
|
||||
if (resourceLocation != null) {
|
||||
String modelPath = (stack.getItem() instanceof PokeBallItem && stack.has(CobblemonItemComponents.POKE_BALL)) ? "inventory" : MODEL_PATH;
|
||||
BakedModel model = this.itemModelShaper.getModelManager().getModel(new ModelResourceLocation(resourceLocation, modelPath));
|
||||
BakedModel model = this.itemModelShaper.getModelManager().getModel(new ModelResourceLocation(resourceLocation, MODEL_PATH));
|
||||
ClientLevel clientWorld = world instanceof ClientLevel ? (ClientLevel) world : null;
|
||||
BakedModel overriddenModel = model.getOverrides().resolve(model, stack, clientWorld, entity, seed);
|
||||
cir.setReturnValue(overriddenModel == null ? this.itemModelShaper.getModelManager().getMissingModel() : overriddenModel);
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
package com.cobblemon.mod.common.mixin.client;
|
||||
|
||||
import com.cobblemon.mod.common.client.CobblemonBakingOverrides;
|
||||
import com.cobblemon.mod.common.client.CobblemonClient;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.color.block.BlockColors;
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
@@ -20,7 +19,6 @@ import net.minecraft.client.resources.model.UnbakedModel;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.Resource;
|
||||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
@@ -31,7 +29,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Mixin(ModelBakery.class)
|
||||
public abstract class ModelLoaderMixin {
|
||||
@@ -41,10 +38,8 @@ public abstract class ModelLoaderMixin {
|
||||
|
||||
@Shadow protected abstract void loadItemModelAndDependencies(ResourceLocation resourceLocation);
|
||||
|
||||
@Shadow protected abstract void loadSpecialItemModelAndDependencies(ModelResourceLocation modelResourceLocation);
|
||||
|
||||
@Unique
|
||||
List<String> dynamicFolders = Arrays.asList("egg", "tm", "poke_ball");
|
||||
List<String> dynamicFolders = Arrays.asList("egg", "tm");
|
||||
|
||||
@Inject(
|
||||
method = "<init>",
|
||||
@@ -72,9 +67,6 @@ public abstract class ModelLoaderMixin {
|
||||
* hacky at the init stage and hacky at the render stage. Pretty cool in the gameplay stage though.
|
||||
*
|
||||
* - Hiro
|
||||
*
|
||||
* We also want to load different contexts (first/third person etc.) for poke ball models, so additional check was added for them.
|
||||
* - Gito
|
||||
*/
|
||||
|
||||
dynamicFolders.forEach(folder -> {
|
||||
@@ -82,15 +74,6 @@ public abstract class ModelLoaderMixin {
|
||||
map.forEach((key, value) -> {
|
||||
ResourceLocation resourceLocation = new ResourceLocation(key.getNamespace(), key.getPath().replace("models/item/", "").replace(".json", ""));
|
||||
this.loadItemModelAndDependencies(resourceLocation);
|
||||
|
||||
if (folder.equals("poke_ball")) {
|
||||
// also load variants for different display ctx
|
||||
Arrays.stream(ItemDisplayContext.values())
|
||||
.forEach(item -> {
|
||||
ModelResourceLocation model = new ModelResourceLocation(resourceLocation, item.getSerializedName());
|
||||
this.loadSpecialItemModelAndDependencies(model);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
+13
-43
@@ -9,55 +9,25 @@
|
||||
package com.cobblemon.mod.common.mixin.client;
|
||||
|
||||
import com.cobblemon.mod.common.CobblemonRecipeCategories;
|
||||
import net.minecraft.client.ClientRecipeBook;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import com.llamalad7.mixinextras.expression.Definition;
|
||||
import com.llamalad7.mixinextras.expression.Expression;
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import net.minecraft.client.RecipeBookCategories;
|
||||
import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent;
|
||||
import net.minecraft.client.gui.screens.recipebook.RecipeBookPage;
|
||||
import net.minecraft.client.gui.screens.recipebook.RecipeBookTabButton;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(RecipeBookComponent.class)
|
||||
public class RecipeBookComponentMixin {
|
||||
|
||||
@Shadow private ClientRecipeBook book;
|
||||
|
||||
@Shadow protected Minecraft minecraft;
|
||||
|
||||
@Shadow private int width;
|
||||
|
||||
@Shadow private int xOffset;
|
||||
|
||||
@Shadow private int height;
|
||||
|
||||
@Shadow @Final private RecipeBookPage recipeBookPage;
|
||||
|
||||
@Inject(method = "updateTabs", at = @At("HEAD"), cancellable = true)
|
||||
private void customUpdateTabs(CallbackInfo ci) {
|
||||
RecipeBookComponent instance = (RecipeBookComponent) (Object) this;
|
||||
int i = (width - 147) / 2 - xOffset - 30;
|
||||
int j = (height - 166) / 2 + 3;
|
||||
int k = 27;
|
||||
int l = 0;
|
||||
|
||||
for (RecipeBookTabButton recipeBookTabButton : instance.tabButtons) {
|
||||
RecipeBookCategories recipeBookCategories = recipeBookTabButton.getCategory();
|
||||
if (recipeBookCategories != RecipeBookCategories.CRAFTING_SEARCH && recipeBookCategories != RecipeBookCategories.FURNACE_SEARCH && recipeBookCategories != CobblemonRecipeCategories.COOKING_POT_SEARCH.toVanillaCategory()) {
|
||||
if (recipeBookTabButton.updateVisibility(book)) {
|
||||
recipeBookTabButton.setPosition(i, j + 27 * l++);
|
||||
recipeBookTabButton.startAnimation(minecraft);
|
||||
}
|
||||
} else {
|
||||
recipeBookTabButton.visible = true;
|
||||
recipeBookTabButton.setPosition(i, j + k * l++);
|
||||
}
|
||||
}
|
||||
|
||||
ci.cancel();
|
||||
@Definition(id = "recipeBookCategories", local = @Local(name = "recipeBookCategories"))
|
||||
@Definition(id = "FURNACE_SEARCH", field = "Lnet/minecraft/client/RecipeBookCategories;FURNACE_SEARCH:Lnet/minecraft/client/RecipeBookCategories;")
|
||||
@Expression("recipeBookCategories != FURNACE_SEARCH")
|
||||
@ModifyExpressionValue(
|
||||
method = "updateTabs",
|
||||
at = @At(value = "MIXINEXTRAS:EXPRESSION")
|
||||
)
|
||||
private boolean notCookingPotSearch(boolean original, @Local(name = "recipeBookCategories") RecipeBookCategories recipeBookCategories) {
|
||||
return original && recipeBookCategories != CobblemonRecipeCategories.COOKING_POT_SEARCH.toVanillaCategory();
|
||||
}
|
||||
}
|
||||
@@ -260,6 +260,9 @@ object Cobblemon {
|
||||
RequestManager.onLogoff(it.player)
|
||||
serverPlayerStructs.remove(it.player.uuid)
|
||||
}
|
||||
PlatformEvents.PLAYER_RESPAWN.subscribe {
|
||||
serverPlayerStructs.remove(it.player.uuid)
|
||||
}
|
||||
PlatformEvents.PLAYER_DEATH.subscribe {
|
||||
PCLinkManager.removeLink(it.player.uuid)
|
||||
battleRegistry.getBattleByParticipatingPlayer(it.player)?.stop()
|
||||
|
||||
@@ -845,54 +845,35 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
|
||||
@JvmField
|
||||
val PEP_UP_FLOWER = this.create("pep_up_flower", FlowerBlock(MobEffects.LEVITATION, 10F, BlockBehaviour.Properties.of().mapColor(MapColor.PLANT).noCollission().instabreak().sound(SoundType.GRASS).offsetType(BlockBehaviour.OffsetType.XZ).pushReaction(PushReaction.DESTROY)))
|
||||
@JvmField
|
||||
val POTTED_PEP_UP_FLOWER = this.create("potted_pep_up_flower", BlocksInvoker.createFlowerPotBlock(PEP_UP_FLOWER))
|
||||
@JvmField
|
||||
val HEARTY_GRAINS = this.create("hearty_grains", HeartyGrainsBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).ignitedByLava().mapColor(MapColor.PLANT).noCollission().randomTicks().instabreak()))
|
||||
|
||||
@JvmField
|
||||
val GALARICA_NUT_BUSH = this.create("galarica_nut_bush", NutBushBlock(BlockBehaviour.Properties.of().mapColor(MapColor.PLANT).randomTicks().noCollission().sound(SoundType.SWEET_BERRY_BUSH).pushReaction(PushReaction.DESTROY)))
|
||||
|
||||
@JvmField
|
||||
val POTTED_RED_APRICORN_SAPLING = this.create("potted_red_apricorn_sapling", BlocksInvoker.createFlowerPotBlock(RED_APRICORN_SAPLING))
|
||||
@JvmField
|
||||
val POTTED_YELLOW_APRICORN_SAPLING = this.create("potted_yellow_apricorn_sapling", BlocksInvoker.createFlowerPotBlock(YELLOW_APRICORN_SAPLING))
|
||||
@JvmField
|
||||
val POTTED_GREEN_APRICORN_SAPLING = this.create("potted_green_apricorn_sapling", BlocksInvoker.createFlowerPotBlock(GREEN_APRICORN_SAPLING))
|
||||
@JvmField
|
||||
val POTTED_BLUE_APRICORN_SAPLING = this.create("potted_blue_apricorn_sapling", BlocksInvoker.createFlowerPotBlock(BLUE_APRICORN_SAPLING))
|
||||
@JvmField
|
||||
val POTTED_PINK_APRICORN_SAPLING = this.create("potted_pink_apricorn_sapling", BlocksInvoker.createFlowerPotBlock(PINK_APRICORN_SAPLING))
|
||||
@JvmField
|
||||
val POTTED_BLACK_APRICORN_SAPLING = this.create("potted_black_apricorn_sapling", BlocksInvoker.createFlowerPotBlock(BLACK_APRICORN_SAPLING))
|
||||
@JvmField
|
||||
val POTTED_WHITE_APRICORN_SAPLING = this.create("potted_white_apricorn_sapling", BlocksInvoker.createFlowerPotBlock(WHITE_APRICORN_SAPLING))
|
||||
@JvmField
|
||||
val POTTED_SACCHARINE_SAPLING = this.create("potted_saccharine_sapling", BlocksInvoker.createFlowerPotBlock(SACCHARINE_SAPLING))
|
||||
|
||||
@JvmField
|
||||
val RED_MINT_LEAF_LITTER = this.mintLitter("red_mint_leaf_litter", MapColor.COLOR_RED)
|
||||
@JvmField
|
||||
val POTTED_RED_MINT = this.pottedPlant("potted_red_mint", RED_MINT_LEAF_LITTER)
|
||||
val POTTED_RED_MINT = this.flowerPot("potted_red_mint", RED_MINT_LEAF_LITTER)
|
||||
@JvmField
|
||||
val BLUE_MINT_LEAF_LITTER = this.mintLitter("blue_mint_leaf_litter", MapColor.COLOR_BLUE)
|
||||
@JvmField
|
||||
val POTTED_BLUE_MINT = this.pottedPlant("potted_blue_mint", BLUE_MINT_LEAF_LITTER)
|
||||
val POTTED_BLUE_MINT = this.flowerPot("potted_blue_mint", BLUE_MINT_LEAF_LITTER)
|
||||
@JvmField
|
||||
val CYAN_MINT_LEAF_LITTER = this.mintLitter("cyan_mint_leaf_litter", MapColor.COLOR_CYAN)
|
||||
@JvmField
|
||||
val POTTED_CYAN_MINT = this.pottedPlant("potted_cyan_mint", CYAN_MINT_LEAF_LITTER)
|
||||
val POTTED_CYAN_MINT = this.flowerPot("potted_cyan_mint", CYAN_MINT_LEAF_LITTER)
|
||||
@JvmField
|
||||
val PINK_MINT_LEAF_LITTER = this.mintLitter("pink_mint_leaf_litter", MapColor.COLOR_PINK)
|
||||
@JvmField
|
||||
val POTTED_PINK_MINT = this.pottedPlant("potted_pink_mint", PINK_MINT_LEAF_LITTER)
|
||||
val POTTED_PINK_MINT = this.flowerPot("potted_pink_mint", PINK_MINT_LEAF_LITTER)
|
||||
@JvmField
|
||||
val GREEN_MINT_LEAF_LITTER = this.mintLitter("green_mint_leaf_litter", MapColor.COLOR_GREEN)
|
||||
@JvmField
|
||||
val POTTED_GREEN_MINT = this.pottedPlant("potted_green_mint", GREEN_MINT_LEAF_LITTER)
|
||||
val POTTED_GREEN_MINT = this.flowerPot("potted_green_mint", GREEN_MINT_LEAF_LITTER)
|
||||
@JvmField
|
||||
val WHITE_MINT_LEAF_LITTER = this.mintLitter("white_mint_leaf_litter", MapColor.SNOW)
|
||||
@JvmField
|
||||
val POTTED_WHITE_MINT = this.pottedPlant("potted_white_mint", WHITE_MINT_LEAF_LITTER)
|
||||
val POTTED_WHITE_MINT = this.flowerPot("potted_white_mint", WHITE_MINT_LEAF_LITTER)
|
||||
|
||||
@JvmField
|
||||
val LOBAILA = this.create("lobaila", LobailaFlowerBlock(BlockBehaviour.Properties.of().mapColor(MapColor.PLANT).noCollission().instabreak().sound(SoundType.GRASS).offsetType(BlockBehaviour.OffsetType.XZ).ignitedByLava().pushReaction(PushReaction.DESTROY)))
|
||||
@@ -1104,145 +1085,163 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
|
||||
//val BINDING_SOIL = this.create("binding_soil", BindingSoilBlock(BlockBehaviour.Properties.of()))
|
||||
|
||||
@JvmField
|
||||
val POTTED_AGUAV_BERRY = this.create("potted_aguav_berry", BlocksInvoker.createFlowerPotBlock(AGUAV_BERRY))
|
||||
val POTTED_AGUAV_BERRY = this.flowerPot("potted_aguav_berry", AGUAV_BERRY)
|
||||
@JvmField
|
||||
val POTTED_APICOT_BERRY = this.create("potted_apicot_berry", BlocksInvoker.createFlowerPotBlock(APICOT_BERRY))
|
||||
val POTTED_APICOT_BERRY = this.flowerPot("potted_apicot_berry", APICOT_BERRY)
|
||||
@JvmField
|
||||
val POTTED_ASPEAR_BERRY = this.create("potted_aspear_berry", BlocksInvoker.createFlowerPotBlock(ASPEAR_BERRY))
|
||||
val POTTED_ASPEAR_BERRY = this.flowerPot("potted_aspear_berry", ASPEAR_BERRY)
|
||||
@JvmField
|
||||
val POTTED_BABIRI_BERRY = this.create("potted_babiri_berry", BlocksInvoker.createFlowerPotBlock(BABIRI_BERRY))
|
||||
val POTTED_BABIRI_BERRY = this.flowerPot("potted_babiri_berry", BABIRI_BERRY)
|
||||
@JvmField
|
||||
val POTTED_BELUE_BERRY = this.create("potted_belue_berry", BlocksInvoker.createFlowerPotBlock(BELUE_BERRY))
|
||||
val POTTED_BELUE_BERRY = this.flowerPot("potted_belue_berry", BELUE_BERRY)
|
||||
@JvmField
|
||||
val POTTED_BLUK_BERRY = this.create("potted_bluk_berry", BlocksInvoker.createFlowerPotBlock(BLUK_BERRY))
|
||||
val POTTED_BLUK_BERRY = this.flowerPot("potted_bluk_berry", BLUK_BERRY)
|
||||
@JvmField
|
||||
val POTTED_CHARTI_BERRY = this.create("potted_charti_berry", BlocksInvoker.createFlowerPotBlock(CHARTI_BERRY))
|
||||
val POTTED_CHARTI_BERRY = this.flowerPot("potted_charti_berry", CHARTI_BERRY)
|
||||
@JvmField
|
||||
val POTTED_CHERI_BERRY = this.create("potted_cheri_berry", BlocksInvoker.createFlowerPotBlock(CHERI_BERRY))
|
||||
val POTTED_CHERI_BERRY = this.flowerPot("potted_cheri_berry", CHERI_BERRY)
|
||||
@JvmField
|
||||
val POTTED_CHESTO_BERRY = this.create("potted_chesto_berry", BlocksInvoker.createFlowerPotBlock(CHESTO_BERRY))
|
||||
val POTTED_CHESTO_BERRY = this.flowerPot("potted_chesto_berry", CHESTO_BERRY)
|
||||
@JvmField
|
||||
val POTTED_CHILAN_BERRY = this.create("potted_chilan_berry", BlocksInvoker.createFlowerPotBlock(CHILAN_BERRY))
|
||||
val POTTED_CHILAN_BERRY = this.flowerPot("potted_chilan_berry", CHILAN_BERRY)
|
||||
@JvmField
|
||||
val POTTED_CHOPLE_BERRY = this.create("potted_chople_berry", BlocksInvoker.createFlowerPotBlock(CHOPLE_BERRY))
|
||||
val POTTED_CHOPLE_BERRY = this.flowerPot("potted_chople_berry", CHOPLE_BERRY)
|
||||
@JvmField
|
||||
val POTTED_COBA_BERRY = this.create("potted_coba_berry", BlocksInvoker.createFlowerPotBlock(COBA_BERRY))
|
||||
val POTTED_COBA_BERRY = this.flowerPot("potted_coba_berry", COBA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_COLBUR_BERRY = this.create("potted_colbur_berry", BlocksInvoker.createFlowerPotBlock(COLBUR_BERRY))
|
||||
val POTTED_COLBUR_BERRY = this.flowerPot("potted_colbur_berry", COLBUR_BERRY)
|
||||
@JvmField
|
||||
val POTTED_CORNN_BERRY = this.create("potted_cornn_berry", BlocksInvoker.createFlowerPotBlock(CORNN_BERRY))
|
||||
val POTTED_CORNN_BERRY = this.flowerPot("potted_cornn_berry", CORNN_BERRY)
|
||||
@JvmField
|
||||
val POTTED_CUSTAP_BERRY = this.create("potted_custap_berry", BlocksInvoker.createFlowerPotBlock(CUSTAP_BERRY))
|
||||
val POTTED_CUSTAP_BERRY = this.flowerPot("potted_custap_berry", CUSTAP_BERRY)
|
||||
@JvmField
|
||||
val POTTED_DURIN_BERRY = this.create("potted_durin_berry", BlocksInvoker.createFlowerPotBlock(DURIN_BERRY))
|
||||
val POTTED_DURIN_BERRY = this.flowerPot("potted_durin_berry", DURIN_BERRY)
|
||||
@JvmField
|
||||
val POTTED_EGGANT_BERRY = this.create("potted_eggant_berry", BlocksInvoker.createFlowerPotBlock(EGGANT_BERRY))
|
||||
val POTTED_EGGANT_BERRY = this.flowerPot("potted_eggant_berry", EGGANT_BERRY)
|
||||
@JvmField
|
||||
val POTTED_ENIGMA_BERRY = this.create("potted_enigma_berry", BlocksInvoker.createFlowerPotBlock(ENIGMA_BERRY))
|
||||
val POTTED_ENIGMA_BERRY = this.flowerPot("potted_enigma_berry", ENIGMA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_FIGY_BERRY = this.create("potted_figy_berry", BlocksInvoker.createFlowerPotBlock(FIGY_BERRY))
|
||||
val POTTED_FIGY_BERRY = this.flowerPot("potted_figy_berry", FIGY_BERRY)
|
||||
@JvmField
|
||||
val POTTED_GANLON_BERRY = this.create("potted_ganlon_berry", BlocksInvoker.createFlowerPotBlock(GANLON_BERRY))
|
||||
val POTTED_GANLON_BERRY = this.flowerPot("potted_ganlon_berry", GANLON_BERRY)
|
||||
@JvmField
|
||||
val POTTED_GREPA_BERRY = this.create("potted_grepa_berry", BlocksInvoker.createFlowerPotBlock(GREPA_BERRY))
|
||||
val POTTED_GREPA_BERRY = this.flowerPot("potted_grepa_berry", GREPA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_HABAN_BERRY = this.create("potted_haban_berry", BlocksInvoker.createFlowerPotBlock(HABAN_BERRY))
|
||||
val POTTED_HABAN_BERRY = this.flowerPot("potted_haban_berry", HABAN_BERRY)
|
||||
@JvmField
|
||||
val POTTED_HONDEW_BERRY = this.create("potted_hondew_berry", BlocksInvoker.createFlowerPotBlock(HONDEW_BERRY))
|
||||
val POTTED_HONDEW_BERRY = this.flowerPot("potted_hondew_berry", HONDEW_BERRY)
|
||||
@JvmField
|
||||
val POTTED_HOPO_BERRY = this.create("potted_hopo_berry", BlocksInvoker.createFlowerPotBlock(HOPO_BERRY))
|
||||
val POTTED_HOPO_BERRY = this.flowerPot("potted_hopo_berry", HOPO_BERRY)
|
||||
@JvmField
|
||||
val POTTED_IAPAPA_BERRY = this.create("potted_iapapa_berry", BlocksInvoker.createFlowerPotBlock(IAPAPA_BERRY))
|
||||
val POTTED_IAPAPA_BERRY = this.flowerPot("potted_iapapa_berry", IAPAPA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_JABOCA_BERRY = this.create("potted_jaboca_berry", BlocksInvoker.createFlowerPotBlock(JABOCA_BERRY))
|
||||
val POTTED_JABOCA_BERRY = this.flowerPot("potted_jaboca_berry", JABOCA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_KASIB_BERRY = this.create("potted_kasib_berry", BlocksInvoker.createFlowerPotBlock(KASIB_BERRY))
|
||||
val POTTED_KASIB_BERRY = this.flowerPot("potted_kasib_berry", KASIB_BERRY)
|
||||
@JvmField
|
||||
val POTTED_KEBIA_BERRY = this.create("potted_kebia_berry", BlocksInvoker.createFlowerPotBlock(KEBIA_BERRY))
|
||||
val POTTED_KEBIA_BERRY = this.flowerPot("potted_kebia_berry", KEBIA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_KEE_BERRY = this.create("potted_kee_berry", BlocksInvoker.createFlowerPotBlock(KEE_BERRY))
|
||||
val POTTED_KEE_BERRY = this.flowerPot("potted_kee_berry", KEE_BERRY)
|
||||
@JvmField
|
||||
val POTTED_KELPSY_BERRY = this.create("potted_kelpsy_berry", BlocksInvoker.createFlowerPotBlock(KELPSY_BERRY))
|
||||
val POTTED_KELPSY_BERRY = this.flowerPot("potted_kelpsy_berry", KELPSY_BERRY)
|
||||
@JvmField
|
||||
val POTTED_LANSAT_BERRY = this.create("potted_lansat_berry", BlocksInvoker.createFlowerPotBlock(LANSAT_BERRY))
|
||||
val POTTED_LANSAT_BERRY = this.flowerPot("potted_lansat_berry", LANSAT_BERRY)
|
||||
@JvmField
|
||||
val POTTED_LEPPA_BERRY = this.create("potted_leppa_berry", BlocksInvoker.createFlowerPotBlock(LEPPA_BERRY))
|
||||
val POTTED_LEPPA_BERRY = this.flowerPot("potted_leppa_berry", LEPPA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_LIECHI_BERRY = this.create("potted_liechi_berry", BlocksInvoker.createFlowerPotBlock(LIECHI_BERRY))
|
||||
val POTTED_LIECHI_BERRY = this.flowerPot("potted_liechi_berry", LIECHI_BERRY)
|
||||
@JvmField
|
||||
val POTTED_LUM_BERRY = this.create("potted_lum_berry", BlocksInvoker.createFlowerPotBlock(LUM_BERRY))
|
||||
val POTTED_LUM_BERRY = this.flowerPot("potted_lum_berry", LUM_BERRY)
|
||||
@JvmField
|
||||
val POTTED_MAGO_BERRY = this.create("potted_mago_berry", BlocksInvoker.createFlowerPotBlock(MAGO_BERRY))
|
||||
val POTTED_MAGO_BERRY = this.flowerPot("potted_mago_berry", MAGO_BERRY)
|
||||
@JvmField
|
||||
val POTTED_MAGOST_BERRY = this.create("potted_magost_berry", BlocksInvoker.createFlowerPotBlock(MAGOST_BERRY))
|
||||
val POTTED_MAGOST_BERRY = this.flowerPot("potted_magost_berry", MAGOST_BERRY)
|
||||
@JvmField
|
||||
val POTTED_MARANGA_BERRY = this.create("potted_maranga_berry", BlocksInvoker.createFlowerPotBlock(MARANGA_BERRY))
|
||||
val POTTED_MARANGA_BERRY = this.flowerPot("potted_maranga_berry", MARANGA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_MICLE_BERRY = this.create("potted_micle_berry", BlocksInvoker.createFlowerPotBlock(MICLE_BERRY))
|
||||
val POTTED_MICLE_BERRY = this.flowerPot("potted_micle_berry", MICLE_BERRY)
|
||||
@JvmField
|
||||
val POTTED_NANAB_BERRY = this.create("potted_nanab_berry", BlocksInvoker.createFlowerPotBlock(NANAB_BERRY))
|
||||
val POTTED_NANAB_BERRY = this.flowerPot("potted_nanab_berry", NANAB_BERRY)
|
||||
@JvmField
|
||||
val POTTED_NOMEL_BERRY = this.create("potted_nomel_berry", BlocksInvoker.createFlowerPotBlock(NOMEL_BERRY))
|
||||
val POTTED_NOMEL_BERRY = this.flowerPot("potted_nomel_berry", NOMEL_BERRY)
|
||||
@JvmField
|
||||
val POTTED_OCCA_BERRY = this.create("potted_occa_berry", BlocksInvoker.createFlowerPotBlock(OCCA_BERRY))
|
||||
val POTTED_OCCA_BERRY = this.flowerPot("potted_occa_berry", OCCA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_ORAN_BERRY = this.create("potted_oran_berry", BlocksInvoker.createFlowerPotBlock(ORAN_BERRY))
|
||||
val POTTED_ORAN_BERRY = this.flowerPot("potted_oran_berry", ORAN_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PAMTRE_BERRY = this.create("potted_pamtre_berry", BlocksInvoker.createFlowerPotBlock(PAMTRE_BERRY))
|
||||
val POTTED_PAMTRE_BERRY = this.flowerPot("potted_pamtre_berry", PAMTRE_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PASSHO_BERRY = this.create("potted_passho_berry", BlocksInvoker.createFlowerPotBlock(PASSHO_BERRY))
|
||||
val POTTED_PASSHO_BERRY = this.flowerPot("potted_passho_berry", PASSHO_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PAYAPA_BERRY = this.create("potted_payapa_berry", BlocksInvoker.createFlowerPotBlock(PAYAPA_BERRY))
|
||||
val POTTED_PAYAPA_BERRY = this.flowerPot("potted_payapa_berry", PAYAPA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PECHA_BERRY = this.create("potted_pecha_berry", BlocksInvoker.createFlowerPotBlock(PECHA_BERRY))
|
||||
val POTTED_PECHA_BERRY = this.flowerPot("potted_pecha_berry", PECHA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PERSIM_BERRY = this.create("potted_persim_berry", BlocksInvoker.createFlowerPotBlock(PERSIM_BERRY))
|
||||
val POTTED_PERSIM_BERRY = this.flowerPot("potted_persim_berry", PERSIM_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PETAYA_BERRY = this.create("potted_petaya_berry", BlocksInvoker.createFlowerPotBlock(PETAYA_BERRY))
|
||||
val POTTED_PETAYA_BERRY = this.flowerPot("potted_petaya_berry", PETAYA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PINAP_BERRY = this.create("potted_pinap_berry", BlocksInvoker.createFlowerPotBlock(PINAP_BERRY))
|
||||
val POTTED_PINAP_BERRY = this.flowerPot("potted_pinap_berry", PINAP_BERRY)
|
||||
@JvmField
|
||||
val POTTED_POMEG_BERRY = this.create("potted_pomeg_berry", BlocksInvoker.createFlowerPotBlock(POMEG_BERRY))
|
||||
val POTTED_POMEG_BERRY = this.flowerPot("potted_pomeg_berry", POMEG_BERRY)
|
||||
@JvmField
|
||||
val POTTED_QUALOT_BERRY = this.create("potted_qualot_berry", BlocksInvoker.createFlowerPotBlock(QUALOT_BERRY))
|
||||
val POTTED_QUALOT_BERRY = this.flowerPot("potted_qualot_berry", QUALOT_BERRY)
|
||||
@JvmField
|
||||
val POTTED_RABUTA_BERRY = this.create("potted_rabuta_berry", BlocksInvoker.createFlowerPotBlock(RABUTA_BERRY))
|
||||
val POTTED_RABUTA_BERRY = this.flowerPot("potted_rabuta_berry", RABUTA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_RAWST_BERRY = this.create("potted_rawst_berry", BlocksInvoker.createFlowerPotBlock(RAWST_BERRY))
|
||||
val POTTED_RAWST_BERRY = this.flowerPot("potted_rawst_berry", RAWST_BERRY)
|
||||
@JvmField
|
||||
val POTTED_RAZZ_BERRY = this.create("potted_razz_berry", BlocksInvoker.createFlowerPotBlock(RAZZ_BERRY))
|
||||
val POTTED_RAZZ_BERRY = this.flowerPot("potted_razz_berry", RAZZ_BERRY)
|
||||
@JvmField
|
||||
val POTTED_RINDO_BERRY = this.create("potted_rindo_berry", BlocksInvoker.createFlowerPotBlock(RINDO_BERRY))
|
||||
val POTTED_RINDO_BERRY = this.flowerPot("potted_rindo_berry", RINDO_BERRY)
|
||||
@JvmField
|
||||
val POTTED_ROSELI_BERRY = this.create("potted_roseli_berry", BlocksInvoker.createFlowerPotBlock(ROSELI_BERRY))
|
||||
val POTTED_ROSELI_BERRY = this.flowerPot("potted_roseli_berry", ROSELI_BERRY)
|
||||
@JvmField
|
||||
val POTTED_ROWAP_BERRY = this.create("potted_rowap_berry", BlocksInvoker.createFlowerPotBlock(ROWAP_BERRY))
|
||||
val POTTED_ROWAP_BERRY = this.flowerPot("potted_rowap_berry", ROWAP_BERRY)
|
||||
@JvmField
|
||||
val POTTED_SALAC_BERRY = this.create("potted_salac_berry", BlocksInvoker.createFlowerPotBlock(SALAC_BERRY))
|
||||
val POTTED_SALAC_BERRY = this.flowerPot("potted_salac_berry", SALAC_BERRY)
|
||||
@JvmField
|
||||
val POTTED_SHUCA_BERRY = this.create("potted_shuca_berry", BlocksInvoker.createFlowerPotBlock(SHUCA_BERRY))
|
||||
val POTTED_SHUCA_BERRY = this.flowerPot("potted_shuca_berry", SHUCA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_SITRUS_BERRY = this.create("potted_sitrus_berry", BlocksInvoker.createFlowerPotBlock(SITRUS_BERRY))
|
||||
val POTTED_SITRUS_BERRY = this.flowerPot("potted_sitrus_berry", SITRUS_BERRY)
|
||||
@JvmField
|
||||
val POTTED_SPELON_BERRY = this.create("potted_spelon_berry", BlocksInvoker.createFlowerPotBlock(SPELON_BERRY))
|
||||
val POTTED_SPELON_BERRY = this.flowerPot("potted_spelon_berry", SPELON_BERRY)
|
||||
@JvmField
|
||||
val POTTED_STARF_BERRY = this.create("potted_starf_berry", BlocksInvoker.createFlowerPotBlock(STARF_BERRY))
|
||||
val POTTED_STARF_BERRY = this.flowerPot("potted_starf_berry", STARF_BERRY)
|
||||
@JvmField
|
||||
val POTTED_TAMATO_BERRY = this.create("potted_tamato_berry", BlocksInvoker.createFlowerPotBlock(TAMATO_BERRY))
|
||||
val POTTED_TAMATO_BERRY = this.flowerPot("potted_tamato_berry", TAMATO_BERRY)
|
||||
@JvmField
|
||||
val POTTED_TANGA_BERRY = this.create("potted_tanga_berry", BlocksInvoker.createFlowerPotBlock(TANGA_BERRY))
|
||||
val POTTED_TANGA_BERRY = this.flowerPot("potted_tanga_berry", TANGA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_TOUGA_BERRY = this.create("potted_touga_berry", BlocksInvoker.createFlowerPotBlock(TOUGA_BERRY))
|
||||
val POTTED_TOUGA_BERRY = this.flowerPot("potted_touga_berry", TOUGA_BERRY)
|
||||
@JvmField
|
||||
val POTTED_WACAN_BERRY = this.create("potted_wacan_berry", BlocksInvoker.createFlowerPotBlock(WACAN_BERRY))
|
||||
val POTTED_WACAN_BERRY = this.flowerPot("potted_wacan_berry", WACAN_BERRY)
|
||||
@JvmField
|
||||
val POTTED_WATMEL_BERRY = this.create("potted_watmel_berry", BlocksInvoker.createFlowerPotBlock(WATMEL_BERRY))
|
||||
val POTTED_WATMEL_BERRY = this.flowerPot("potted_watmel_berry", WATMEL_BERRY)
|
||||
@JvmField
|
||||
val POTTED_WEPEAR_BERRY = this.create("potted_wepear_berry", BlocksInvoker.createFlowerPotBlock(WEPEAR_BERRY))
|
||||
val POTTED_WEPEAR_BERRY = this.flowerPot("potted_wepear_berry", WEPEAR_BERRY)
|
||||
@JvmField
|
||||
val POTTED_WIKI_BERRY = this.create("potted_wiki_berry", BlocksInvoker.createFlowerPotBlock(WIKI_BERRY))
|
||||
val POTTED_WIKI_BERRY = this.flowerPot("potted_wiki_berry", WIKI_BERRY)
|
||||
@JvmField
|
||||
val POTTED_YACHE_BERRY = this.create("potted_yache_berry", BlocksInvoker.createFlowerPotBlock(YACHE_BERRY))
|
||||
val POTTED_YACHE_BERRY = this.flowerPot("potted_yache_berry", YACHE_BERRY)
|
||||
@JvmField
|
||||
val POTTED_PEP_UP_FLOWER = this.flowerPot("potted_pep_up_flower", PEP_UP_FLOWER)
|
||||
@JvmField
|
||||
val POTTED_RED_APRICORN_SAPLING = this.flowerPot("potted_red_apricorn_sapling", RED_APRICORN_SAPLING)
|
||||
@JvmField
|
||||
val POTTED_YELLOW_APRICORN_SAPLING = this.flowerPot("potted_yellow_apricorn_sapling", YELLOW_APRICORN_SAPLING)
|
||||
@JvmField
|
||||
val POTTED_GREEN_APRICORN_SAPLING = this.flowerPot("potted_green_apricorn_sapling", GREEN_APRICORN_SAPLING)
|
||||
@JvmField
|
||||
val POTTED_BLUE_APRICORN_SAPLING = this.flowerPot("potted_blue_apricorn_sapling", BLUE_APRICORN_SAPLING)
|
||||
@JvmField
|
||||
val POTTED_PINK_APRICORN_SAPLING = this.flowerPot("potted_pink_apricorn_sapling", PINK_APRICORN_SAPLING)
|
||||
@JvmField
|
||||
val POTTED_BLACK_APRICORN_SAPLING = this.flowerPot("potted_black_apricorn_sapling", BLACK_APRICORN_SAPLING)
|
||||
@JvmField
|
||||
val POTTED_WHITE_APRICORN_SAPLING = this.flowerPot("potted_white_apricorn_sapling", WHITE_APRICORN_SAPLING)
|
||||
@JvmField
|
||||
val POTTED_SACCHARINE_SAPLING = this.flowerPot("potted_saccharine_sapling", SACCHARINE_SAPLING)
|
||||
|
||||
init {
|
||||
/**
|
||||
@@ -1346,7 +1345,16 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
|
||||
|
||||
fun typeGemClusters() = typeGemClusters.toMap()
|
||||
|
||||
private fun pottedPlant(name: String, flower: Block) = this.create(name, BlocksInvoker.createFlowerPotBlock(flower))
|
||||
private fun flowerPot(name: String, flower: Block) = this.create(
|
||||
name,
|
||||
FlowerPotBlock(
|
||||
flower,
|
||||
BlockBehaviour.Properties.of()
|
||||
.instabreak()
|
||||
.noOcclusion()
|
||||
.pushReaction(PushReaction.DESTROY)
|
||||
)
|
||||
)
|
||||
|
||||
private fun mintLitter(name: String, color: MapColor) = this.create(
|
||||
name,
|
||||
|
||||
@@ -47,7 +47,7 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, ResourceKey
|
||||
@JvmField
|
||||
val EMPTY_POKEBALL: EntityType<EmptyPokeBallEntity> = this.create(
|
||||
EMPTY_POKEBALL_KEY.path,
|
||||
EntityType.Builder.of({ _, world -> EmptyPokeBallEntity(PokeBalls.STRANGE_BALL, world) }, MobCategory.MISC)
|
||||
EntityType.Builder.of({ _, world -> EmptyPokeBallEntity(PokeBalls.POKE_BALL, world) }, MobCategory.MISC)
|
||||
.build(EMPTY_POKEBALL_KEY.toString())
|
||||
)
|
||||
|
||||
@@ -99,4 +99,4 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, ResourceKey
|
||||
consumer(POKEMON, PokemonEntity.createAttributes())
|
||||
consumer(NPC, NPCEntity.createAttributes())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,12 +99,6 @@ object CobblemonItemComponents : PlatformRegistry<Registry<DataComponentType<*>>
|
||||
.networkSynchronized(ByteBufCodecs.BOOL)
|
||||
.build())
|
||||
|
||||
@JvmField
|
||||
val POKE_BALL: DataComponentType<PokeBallComponent> = create("poke_ball", DataComponentType.builder<PokeBallComponent>()
|
||||
.persistent(PokeBallComponent.CODEC)
|
||||
.networkSynchronized(PokeBallComponent.PACKET_CODEC)
|
||||
.build())
|
||||
|
||||
fun register() {
|
||||
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:pokemon_item"), POKEMON_ITEM)
|
||||
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:bait"), BAIT)
|
||||
@@ -118,10 +112,9 @@ object CobblemonItemComponents : PlatformRegistry<Registry<DataComponentType<*>>
|
||||
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:food"), FOOD)
|
||||
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:mob_effects"), MOB_EFFECTS)
|
||||
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:held_item_effect"), HELD_ITEM_EFFECT)
|
||||
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:poke_ball"), POKE_BALL)
|
||||
}
|
||||
|
||||
override val registry = BuiltInRegistries.DATA_COMPONENT_TYPE
|
||||
override val resourceKey = Registries.DATA_COMPONENT_TYPE
|
||||
|
||||
}
|
||||
}
|
||||
@@ -172,8 +172,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
val ANCIENT_GIGATON_BALL = pokeBallItem(PokeBalls.ANCIENT_GIGATON_BALL)
|
||||
@JvmField
|
||||
val ANCIENT_ORIGIN_BALL = pokeBallItem(PokeBalls.ANCIENT_ORIGIN_BALL)
|
||||
@JvmField
|
||||
val STRANGE_BALL = pokeBallItem(PokeBalls.STRANGE_BALL)
|
||||
|
||||
val pokedexes = mutableListOf<PokedexItem>()
|
||||
@JvmField
|
||||
@@ -1593,7 +1591,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
|
||||
private fun pokeBallItem(pokeBall: PokeBall): PokeBallItem {
|
||||
val item = create(pokeBall.name.path, PokeBallItem(pokeBall))
|
||||
pokeBall.stack = item.defaultInstance
|
||||
pokeBall.item = item
|
||||
pokeBalls.add(item)
|
||||
return item
|
||||
}
|
||||
|
||||
+31
-7
@@ -9,6 +9,7 @@
|
||||
package com.cobblemon.mod.common.api.ai.config.task
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
|
||||
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
|
||||
@@ -17,6 +18,7 @@ import com.cobblemon.mod.common.util.asExpression
|
||||
import com.cobblemon.mod.common.util.mainThreadRuntime
|
||||
import com.cobblemon.mod.common.util.resolveBoolean
|
||||
import com.cobblemon.mod.common.util.withQueryValue
|
||||
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
|
||||
import com.mojang.datafixers.util.Either
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.entity.ai.behavior.BehaviorControl
|
||||
@@ -34,6 +36,8 @@ import net.minecraft.world.entity.ai.sensing.SensorType
|
||||
class HateEntityTaskConfig : SingleTaskConfig {
|
||||
val entityCondition: Expression = "true".asExpression()
|
||||
val range: ExpressionOrEntityVariable = Either.left("24".asExpression())
|
||||
val chance: Float = Cobblemon.config.predationChance
|
||||
private val coercedChance = chance.coerceIn(0f, 1f)
|
||||
|
||||
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
|
||||
override fun createTask(
|
||||
@@ -43,24 +47,44 @@ class HateEntityTaskConfig : SingleTaskConfig {
|
||||
val range = range.resolveFloat(behaviourConfigurationContext.runtime)
|
||||
behaviourConfigurationContext.addMemories(
|
||||
MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES,
|
||||
MemoryModuleType.ANGRY_AT
|
||||
MemoryModuleType.ANGRY_AT,
|
||||
MemoryModuleType.ATTACK_TARGET
|
||||
)
|
||||
behaviourConfigurationContext.addSensors(SensorType.NEAREST_LIVING_ENTITIES)
|
||||
return BehaviorBuilder.create { instance ->
|
||||
instance.group(
|
||||
instance.present(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES),
|
||||
instance.registered(MemoryModuleType.ANGRY_AT)
|
||||
).apply(instance) { entities, angryAt ->
|
||||
instance.registered(MemoryModuleType.ANGRY_AT),
|
||||
instance.registered(MemoryModuleType.ATTACK_TARGET),
|
||||
).apply(instance) { entities, angryAt, attackTarget ->
|
||||
Trigger { world, entity, _ ->
|
||||
val target = instance.get(entities).findClosest {
|
||||
mainThreadRuntime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
|
||||
// bail if gamerule is disabled
|
||||
if (!world.gameRules.getBoolean(CobblemonGameRules.DO_POKEMON_PREDATION)) return@Trigger false
|
||||
val target = instance.get(entities).findClosest { hated ->
|
||||
mainThreadRuntime.withQueryValue("entity", hated.asMostSpecificMoLangValue())
|
||||
return@findClosest mainThreadRuntime.resolveBoolean(entityCondition)
|
||||
}.orElse(null)
|
||||
|
||||
var shouldTrigger = false
|
||||
if (target != null && target.distanceTo(entity) <= range) {
|
||||
angryAt.set(target.uuid)
|
||||
shouldTrigger = when {
|
||||
// set always attacking if activity chance is equal to 1.0
|
||||
coercedChance == 1f -> {
|
||||
angryAt.set(target.uuid)
|
||||
attackTarget.set(target)
|
||||
true
|
||||
}
|
||||
// roll the dice in other way
|
||||
coercedChance != 1f && world.random.nextFloat() < coercedChance -> {
|
||||
angryAt.set(target.uuid)
|
||||
attackTarget.set(target)
|
||||
true
|
||||
}
|
||||
// fallback to peaceful behavior in unattended cases
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
return@Trigger true
|
||||
return@Trigger shouldTrigger
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -25,7 +25,6 @@ data class PokemonCapturedEvent (
|
||||
"pokemon" to pokemon.struct,
|
||||
"player" to player.asMoLangValue(),
|
||||
"poke_ball" to pokeBallEntity.struct,
|
||||
"item" to player.level().itemRegistry.wrapAsHolder(pokeBallEntity.pokeBall.item()).asMoLangValue(Registries.ITEM),
|
||||
"stack" to pokeBallEntity.pokeBall.stack.asMoLangValue(player.level().registryAccess())
|
||||
"item" to player.level().itemRegistry.wrapAsHolder(pokeBallEntity.pokeBall.item).asMoLangValue(Registries.ITEM)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,6 @@ import com.cobblemon.mod.common.api.molang.function.NPCMoLangFunctions
|
||||
import com.cobblemon.mod.common.api.molang.function.PCMoLangFunctions
|
||||
import com.cobblemon.mod.common.api.molang.function.PartyMoLangFunctions
|
||||
import com.cobblemon.mod.common.api.molang.function.PlayerMoLangFunctions
|
||||
import com.cobblemon.mod.common.api.molang.function.PokeBallMoLangFunctions
|
||||
import com.cobblemon.mod.common.api.molang.function.PokedexMoLangFunctions
|
||||
import com.cobblemon.mod.common.api.molang.function.PokemonEntityMoLangFunctions
|
||||
import com.cobblemon.mod.common.api.molang.function.PokemonMoLangFunctions
|
||||
@@ -57,7 +56,6 @@ import com.cobblemon.mod.common.api.storage.party.PartyStore
|
||||
import com.cobblemon.mod.common.api.storage.pc.PCStore
|
||||
import com.cobblemon.mod.common.entity.npc.NPCEntity
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.pokemon.Species
|
||||
import com.cobblemon.mod.common.util.effectiveName
|
||||
@@ -264,18 +262,6 @@ object MoLangFunctions {
|
||||
return value
|
||||
}
|
||||
|
||||
fun PokeBall.asMoLangValue(): ObjectValue<PokeBall> {
|
||||
val value =
|
||||
ObjectValue(
|
||||
obj = this,
|
||||
stringify = { it.name.toString() }
|
||||
)
|
||||
|
||||
value.addFunctions(PokeBallMoLangFunctions.attach(this))
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
fun Vec3.asMoLangValue(): ObjectValue<Vec3> {
|
||||
val value =
|
||||
ObjectValue(
|
||||
@@ -403,12 +389,6 @@ object MoLangFunctions {
|
||||
return this
|
||||
}
|
||||
|
||||
fun QueryStruct.addPokeBallFunctions(ball: PokeBall): QueryStruct {
|
||||
val addedFunctions = PokeBallMoLangFunctions.attach(ball)
|
||||
addFunctions(addedFunctions)
|
||||
return this
|
||||
}
|
||||
|
||||
fun <T : QueryStruct> T.addFunctions(functions: Map<String, Function<MoParams, Any>>): T {
|
||||
this.functions.putAll(functions)
|
||||
return this
|
||||
|
||||
-10
@@ -23,7 +23,6 @@ import com.cobblemon.mod.common.api.scheduling.Schedulable
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.entity.MoLangScriptingEntity
|
||||
import com.cobblemon.mod.common.entity.PosableEntity
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
|
||||
import com.cobblemon.mod.common.net.messages.client.animation.PlayPosableAnimationPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormEntityParticlePacket
|
||||
import com.cobblemon.mod.common.util.asArrayValue
|
||||
@@ -308,15 +307,6 @@ object EntityMoLangFunctions : AbstractMoLangFunctionHolder<Entity>() {
|
||||
functions["face"] = { params ->
|
||||
ObjectValue(ReferenceDialogueFaceProvider(entity.id, params.getBooleanOrNull(0) != false))
|
||||
}
|
||||
|
||||
// EmptyPokeBallEntity is a subclass of PosableEntity
|
||||
// meaning we need to add a condition here to attach our func
|
||||
// only to instance of EmptyPokeBallEntity
|
||||
if (entity is EmptyPokeBallEntity) {
|
||||
functions["capture_state"] = {
|
||||
StringValue(entity.captureState.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is Schedulable -> {
|
||||
|
||||
+2
-2
@@ -98,14 +98,14 @@ object LivingEntityMoLangFunctions : AbstractMoLangFunctionHolder<LivingEntity>(
|
||||
val targetEntity = params.get<MoValue>(0)
|
||||
val maxDistance = params.getDoubleOrNull(1)?.toFloat() ?: 2.0F
|
||||
|
||||
val entity =
|
||||
val target =
|
||||
if (targetEntity is ObjectValue<*> && targetEntity.obj is Entity) {
|
||||
targetEntity.obj as Entity
|
||||
} else {
|
||||
return@isLookingAt DoubleValue.ZERO
|
||||
}
|
||||
|
||||
DoubleValue(entity.isLookingAt(entity, maxDistance))
|
||||
DoubleValue(entity.isLookingAt(target, maxDistance))
|
||||
}
|
||||
functions["is_living_entity"] = { DoubleValue.ONE }
|
||||
functions["is_flying"] = { DoubleValue(entity.isFallFlying) }
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.molang.function
|
||||
|
||||
import com.bedrockk.molang.runtime.MoParams
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.cobblemon.mod.common.util.getStringOrNull
|
||||
|
||||
object PokeBallMoLangFunctions : AbstractMoLangFunctionHolder<PokeBall>() {
|
||||
override fun PokeBall.moLangFunctions(): MutableMap<String, (MoParams) -> Any> {
|
||||
val ball = this
|
||||
val functions = hashMapOf<String, (MoParams) -> Any>()
|
||||
|
||||
|
||||
return functions
|
||||
}
|
||||
}
|
||||
+1
-6
@@ -47,10 +47,6 @@ object PokemonMoLangFunctions : AbstractMoLangFunctionHolder<Pokemon>() {
|
||||
functions["max_hp"] = { DoubleValue(pokemon.maxHealth.toDouble()) }
|
||||
functions["current_hp"] = { DoubleValue(pokemon.currentHealth.toDouble()) }
|
||||
functions["friendship"] = { DoubleValue(pokemon.friendship.toDouble()) }
|
||||
functions["set_friendship"] = { params ->
|
||||
val amount = params.getDouble(0)
|
||||
pokemon.setFriendship(amount.toInt())
|
||||
}
|
||||
functions["max_fullness"] = { DoubleValue(pokemon.getMaxFullness().toDouble()) }
|
||||
functions["fullness"] = { DoubleValue(pokemon.currentFullness.toDouble()) }
|
||||
functions["lose_fullness"] = { params ->
|
||||
@@ -216,7 +212,7 @@ object PokemonMoLangFunctions : AbstractMoLangFunctionHolder<Pokemon>() {
|
||||
// Lol. Lmao, even.
|
||||
// TO-DO: Subscribe to [PokemonSpecies.observable].
|
||||
functions["pre_evolution"] = { pokemon.species.preEvolution ?: DoubleValue.ZERO }
|
||||
functions["nature"] = { StringValue(pokemon.nature.toString()) }
|
||||
functions["nature"] = { StringValue(pokemon.nature.name.toString()) }
|
||||
functions["is_wild"] = { DoubleValue(pokemon.entity?.let { it.ownerUUID == null } == true) }
|
||||
functions["is_shiny"] = { DoubleValue(pokemon.shiny) }
|
||||
functions["is_in_party"] = { DoubleValue(pokemon.storeCoordinates.get()?.store is PartyStore) }
|
||||
@@ -456,7 +452,6 @@ object PokemonMoLangFunctions : AbstractMoLangFunctionHolder<Pokemon>() {
|
||||
functions["entity"] = { pokemon.entity?.asMoLangValue() ?: DoubleValue.ZERO }
|
||||
functions["is_alpha"] = { DoubleValue(pokemon.isAlpha) }
|
||||
functions["size_category"] = { StringValue(pokemon.getSizeCategory().name) }
|
||||
functions["full_heal"] = { pokemon.heal() }
|
||||
|
||||
return functions
|
||||
}
|
||||
|
||||
@@ -8,47 +8,27 @@
|
||||
|
||||
package com.cobblemon.mod.common.api.pokeball
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.Priority
|
||||
import com.cobblemon.mod.common.api.data.JsonDataRegistry
|
||||
import com.cobblemon.mod.common.api.events.CobblemonEvents
|
||||
import com.cobblemon.mod.common.api.molang.ExpressionLike
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CaptureEffect
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.effects.CaptureEffects
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.effects.FriendshipEarningBoostEffect
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.BaseStatModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.CatchRateModifiers
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.DynamicMultiplierModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.GuaranteedModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.MultiplierModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.*
|
||||
import com.cobblemon.mod.common.api.pokemon.labels.CobblemonPokemonLabels
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.Stats
|
||||
import com.cobblemon.mod.common.api.pokemon.status.Statuses
|
||||
import com.cobblemon.mod.common.api.reactive.SimpleObservable
|
||||
import com.cobblemon.mod.common.api.types.ElementalTypes
|
||||
import com.cobblemon.mod.common.item.components.PokeBallComponent
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.cobblemon.mod.common.util.adapters.CobblemonCaptureEffectAdapter
|
||||
import com.cobblemon.mod.common.util.adapters.CobblemonCatchRateModifierAdapter
|
||||
import com.cobblemon.mod.common.util.adapters.ExpressionAdapter
|
||||
import com.cobblemon.mod.common.util.adapters.ExpressionLikeAdapter
|
||||
import com.cobblemon.mod.common.util.adapters.FloatNumberRangeAdapter
|
||||
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
|
||||
import com.cobblemon.mod.common.util.adapters.IntRangeAdapter
|
||||
import com.cobblemon.mod.common.util.adapters.LiteralHexColorAdapter
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import net.minecraft.advancements.critereon.MinMaxBounds
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.server.packs.PackType
|
||||
import net.minecraft.util.LowerCaseEnumTypeAdapterFactory
|
||||
import java.awt.Color
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
@@ -63,15 +43,6 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
|
||||
// ToDo once datapack pokeball is implemented add required adapters here
|
||||
override val gson: Gson = GsonBuilder()
|
||||
.registerTypeAdapter(ResourceLocation::class.java, IdentifierAdapter)
|
||||
.registerTypeAdapter(Expression::class.java, ExpressionAdapter)
|
||||
.registerTypeAdapter(ExpressionLike::class.java, ExpressionLikeAdapter)
|
||||
.registerTypeAdapter(IntRange::class.java, IntRangeAdapter)
|
||||
.registerTypeAdapter(MinMaxBounds.Doubles::class.java, FloatNumberRangeAdapter)
|
||||
.registerTypeAdapter(CatchRateModifier::class.java, CobblemonCatchRateModifierAdapter)
|
||||
.registerTypeAdapter(CaptureEffect::class.java, CobblemonCaptureEffectAdapter)
|
||||
.registerTypeAdapter(Color::class.java, LiteralHexColorAdapter)
|
||||
.registerTypeAdapterFactory(LowerCaseEnumTypeAdapterFactory())
|
||||
.disableHtmlEscaping()
|
||||
.setPrettyPrinting()
|
||||
.create()
|
||||
@@ -79,8 +50,8 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
override val resourcePath = "pokeballs"
|
||||
|
||||
private val defaults = hashMapOf<ResourceLocation, PokeBall>()
|
||||
|
||||
val custom = hashMapOf<ResourceLocation, PokeBall>()
|
||||
// ToDo datapack pokeball type here instead
|
||||
private val custom = hashMapOf<ResourceLocation, PokeBall>()
|
||||
|
||||
@JvmStatic
|
||||
@get:JvmName("getPokeBall")
|
||||
@@ -274,10 +245,6 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
@get:JvmName("getAncientOriginBall")
|
||||
val ANCIENT_ORIGIN_BALL
|
||||
get() = this.byName("ancient_origin_ball")
|
||||
@JvmStatic
|
||||
@get:JvmName("getStrangeBall")
|
||||
val STRANGE_BALL
|
||||
get() = this.byName("strange_ball")
|
||||
|
||||
init {
|
||||
createDefault("poke_ball")
|
||||
@@ -290,12 +257,12 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
createDefault("ultra_ball", MultiplierModifier(2F))
|
||||
createDefault("master_ball", GuaranteedModifier())
|
||||
createDefault("safari_ball", CatchRateModifiers.SAFARI)
|
||||
createDefault("fast_ball", BaseStatModifier(Stats.SPEED, 100, BaseStatModifier.Comparator.GTE, 4F))
|
||||
createDefault("fast_ball", BaseStatModifier(Stats.SPEED, { it >= 100 }, 4F))
|
||||
createDefault("level_ball", CatchRateModifiers.LEVEL)
|
||||
createDefault("lure_ball", CatchRateModifiers.LURE)
|
||||
createDefault("heavy_ball", CatchRateModifiers.WEIGHT_BASED)
|
||||
createDefault("love_ball", CatchRateModifiers.LOVE)
|
||||
createDefault("friend_ball", effects = listOf("q.pokemon.set_friendship(150.0)".asExpressionLike()))
|
||||
createDefault("friend_ball", effects = listOf(CaptureEffects.friendshipSetter(150)))
|
||||
createDefault("moon_ball", CatchRateModifiers.MOON_PHASES)
|
||||
createDefault("sport_ball", MultiplierModifier(1.5F))
|
||||
createDefault("net_ball", CatchRateModifiers.typeBoosting(3F, ElementalTypes.BUG, ElementalTypes.WATER))
|
||||
@@ -303,10 +270,10 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
createDefault("nest_ball", CatchRateModifiers.NEST)
|
||||
createDefault("repeat_ball", CatchRateModifiers.REPEAT)
|
||||
createDefault("timer_ball", CatchRateModifiers.turnBased { turn -> (1F + turn * (1229F / 4096F)).coerceAtMost(4F) })
|
||||
createDefault("luxury_ball", /*effects = listOf(FriendshipEarningBoostEffect(2F))*/)
|
||||
createDefault("luxury_ball", effects = listOf(FriendshipEarningBoostEffect(2F)))
|
||||
createDefault("premier_ball")
|
||||
createDefault("dusk_ball", CatchRateModifiers.LIGHT_LEVEL)
|
||||
createDefault("heal_ball", effects = listOf("q.pokemon.heal()".asExpressionLike()))
|
||||
createDefault("heal_ball", effects = listOf(CaptureEffects.FULL_RESTORE))
|
||||
createDefault("quick_ball", CatchRateModifiers.turnBased { turn -> if (turn == 1) 5F else 1F })
|
||||
createDefault("cherish_ball")
|
||||
createDefault("park_ball", CatchRateModifiers.PARK)
|
||||
@@ -328,9 +295,6 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
createDefault("ancient_wing_ball", MultiplierModifier(1.5F), throwPower = 2.5f, ancient = true)
|
||||
createDefault("ancient_jet_ball", MultiplierModifier(2F), throwPower = 2.5f, ancient = true)
|
||||
createDefault("ancient_origin_ball", GuaranteedModifier(), ancient = true)
|
||||
// for customs
|
||||
createDefault("strange_ball")
|
||||
|
||||
// Luxury ball effect, low priority as it must be triggered before soothe bell as of gen 4
|
||||
CobblemonEvents.FRIENDSHIP_UPDATED.subscribe(priority = Priority.LOW) { event ->
|
||||
if (!event.earned) {
|
||||
@@ -347,20 +311,8 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
}
|
||||
|
||||
override fun reload(data: Map<ResourceLocation, PokeBall>) {
|
||||
data.entries.forEach { it.value.name = it.key }
|
||||
this.custom.clear()
|
||||
|
||||
data.forEach { (location, ball) ->
|
||||
if (defaults.containsKey(location)) {
|
||||
ball.stack = defaults[location]!!.stack
|
||||
} else {
|
||||
ball.stack = PokeBallComponent.createStack(ball)
|
||||
}
|
||||
|
||||
this.custom[location] = ball
|
||||
}
|
||||
|
||||
Cobblemon.LOGGER.info("Loaded ${data.size} custom poke balls.")
|
||||
// ToDo once datapack pokeball is implemented load them here, we will want datapacks to be able to override our default pokeballs too, however they will never be able to disable them
|
||||
}
|
||||
|
||||
override fun sync(player: ServerPlayer) {
|
||||
@@ -369,11 +321,10 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
|
||||
/**
|
||||
* Gets a Pokeball from registry name.
|
||||
* @return the pokeball object if found otherwise strange ball.
|
||||
* @return the pokeball object if found otherwise null.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getPokeBall(name : ResourceLocation): PokeBall =
|
||||
this.custom[name] ?: this.defaults[name] ?: STRANGE_BALL
|
||||
fun getPokeBall(name : ResourceLocation): PokeBall? = this.custom[name] ?: this.defaults[name]
|
||||
|
||||
@JvmStatic
|
||||
fun all() = this.defaults.filterKeys { !this.custom.containsKey(it) }.values + this.custom.values
|
||||
@@ -381,22 +332,213 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
|
||||
private fun createDefault(
|
||||
name: String,
|
||||
modifier: CatchRateModifier = MultiplierModifier(1F) { _, _ -> true },
|
||||
effects: List<ExpressionLike> = emptyList(),
|
||||
effects: List<CaptureEffect> = emptyList(),
|
||||
waterDragValue: Float = 0.8F,
|
||||
model2d: ResourceLocation = cobblemonResource(name),
|
||||
model3d: ResourceLocation = cobblemonResource("item/${name}_model"),
|
||||
throwPower: Float = 1.25f,
|
||||
ancient: Boolean = false,
|
||||
color: Color = Color.decode("#ff1111")
|
||||
ancient: Boolean = false
|
||||
): PokeBall {
|
||||
val identifier = cobblemonResource(name)
|
||||
val pokeball = PokeBall(identifier, modifier, effects, PokeBall.PokeBallProperties(), waterDragValue, model2d, model3d, throwPower, ancient, color)
|
||||
val pokeball = PokeBall(identifier, modifier, effects, waterDragValue, model2d, model3d, throwPower, ancient)
|
||||
this.defaults[identifier] = pokeball
|
||||
return pokeball
|
||||
}
|
||||
|
||||
fun byName(name: String): PokeBall {
|
||||
private fun byName(name: String): PokeBall {
|
||||
val identifier = cobblemonResource(name)
|
||||
return this.custom[identifier] ?: this.defaults[identifier]!!
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Backwards compatibility getters
|
||||
*/
|
||||
@JvmName("getPOKE_BALL")
|
||||
@Deprecated("Use PokeBalls.getPokeBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getPOKE_BALL() = POKE_BALL
|
||||
|
||||
@JvmName("getSLATE_BALL")
|
||||
@Deprecated("Use PokeBalls.getSlateBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getSLATE_BALL() = SLATE_BALL
|
||||
|
||||
@JvmName("getAZURE_BALL")
|
||||
@Deprecated("Use PokeBalls.getAzureBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getAZURE_BALL() = AZURE_BALL
|
||||
|
||||
@JvmName("getVERDANT_BALL")
|
||||
@Deprecated("Use PokeBalls.getVerdantBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getVERDANT_BALL() = VERDANT_BALL
|
||||
|
||||
@JvmName("getROSEATE_BALL")
|
||||
@Deprecated("Use PokeBalls.getRoseateBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getROSEATE_BALL() = ROSEATE_BALL
|
||||
|
||||
@JvmName("getCITRINE_BALL")
|
||||
@Deprecated("Use PokeBalls.getCitrineBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getCITRINE_BALL() = CITRINE_BALL
|
||||
|
||||
@JvmName("getGREAT_BALL")
|
||||
@Deprecated("Use PokeBalls.getGreatBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getGREAT_BALL() = GREAT_BALL
|
||||
|
||||
@JvmName("getULTRA_BALL")
|
||||
@Deprecated("Use PokeBalls.getUltraBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getULTRA_BALL() = ULTRA_BALL
|
||||
|
||||
@JvmName("getMASTER_BALL")
|
||||
@Deprecated("Use PokeBalls.getMasterBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getMASTER_BALL() = MASTER_BALL
|
||||
|
||||
@JvmName("getSAFARI_BALL")
|
||||
@Deprecated("Use PokeBalls.getSafariBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getSAFARI_BALL() = SAFARI_BALL
|
||||
|
||||
@JvmName("getFAST_BALL")
|
||||
@Deprecated("Use PokeBalls.getFastBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getFAST_BALL() = FAST_BALL
|
||||
|
||||
@JvmName("getLEVEL_BALL")
|
||||
@Deprecated("Use PokeBalls.getLevelBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getLEVEL_BALL() = LEVEL_BALL
|
||||
|
||||
@JvmName("getLURE_BALL")
|
||||
@Deprecated("Use PokeBalls.getLureBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getLURE_BALL() = LURE_BALL
|
||||
|
||||
@JvmName("getHEAVY_BALL")
|
||||
@Deprecated("Use PokeBalls.getHeavyBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getHEAVY_BALL() = HEAVY_BALL
|
||||
|
||||
@JvmName("getLOVE_BALL")
|
||||
@Deprecated("Use PokeBalls.getLoveBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getLOVE_BALL() = LOVE_BALL
|
||||
|
||||
@JvmName("getFRIEND_BALL")
|
||||
@Deprecated("Use PokeBalls.getFriendBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getFRIEND_BALL() = FRIEND_BALL
|
||||
|
||||
@JvmName("getMOON_BALL")
|
||||
@Deprecated("Use PokeBalls.getMoonBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getMOON_BALL() = MOON_BALL
|
||||
|
||||
@JvmName("getSPORT_BALL")
|
||||
@Deprecated("Use PokeBalls.getSportBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getSPORT_BALL() = SPORT_BALL
|
||||
|
||||
@JvmName("getNET_BALL")
|
||||
@Deprecated("Use PokeBalls.getNetBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getNET_BALL() = NET_BALL
|
||||
|
||||
@JvmName("getNEST_BALL")
|
||||
@Deprecated("Use PokeBalls.getNestBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getNEST_BALL() = NEST_BALL
|
||||
|
||||
@JvmName("getREPEAT_BALL")
|
||||
@Deprecated("Use PokeBalls.getRepeatBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getREPEAT_BALL() = REPEAT_BALL
|
||||
|
||||
@JvmName("getTIMER_BALL")
|
||||
@Deprecated("Use PokeBalls.getTimerBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getTIMER_BALL() = TIMER_BALL
|
||||
|
||||
@JvmName("getLUXURY_BALL")
|
||||
@Deprecated("Use PokeBalls.getLuxuryBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getLUXURY_BALL() = LUXURY_BALL
|
||||
|
||||
@JvmName("getPREMIER_BALL")
|
||||
@Deprecated("Use PokeBalls.getPremierBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getPREMIER_BALL() = PREMIER_BALL
|
||||
|
||||
@JvmName("getDUSK_BALL")
|
||||
@Deprecated("Use PokeBalls.getDuskBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getDUSK_BALL() = DUSK_BALL
|
||||
|
||||
@JvmName("getHEAL_BALL")
|
||||
@Deprecated("Use PokeBalls.getHealBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getHEAL_BALL() = HEAL_BALL
|
||||
|
||||
@JvmName("getQUICK_BALL")
|
||||
@Deprecated("Use PokeBalls.getQuickBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getQUICK_BALL() = QUICK_BALL
|
||||
|
||||
@JvmName("getCHERISH_BALL")
|
||||
@Deprecated("Use PokeBalls.getCherishBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getCHERISH_BALL() = CHERISH_BALL
|
||||
|
||||
@JvmName("getPARK_BALL")
|
||||
@Deprecated("Use PokeBalls.getParkBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getPARK_BALL() = PARK_BALL
|
||||
|
||||
@JvmName("getDREAM_BALL")
|
||||
@Deprecated("Use PokeBalls.getDreamBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getDREAM_BALL() = DREAM_BALL
|
||||
|
||||
@JvmName("getBEAST_BALL")
|
||||
@Deprecated("Use PokeBalls.getBeastBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getBEAST_BALL() = BEAST_BALL
|
||||
|
||||
@JvmName("getANCIENT_POKE_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientPokeBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_POKE_BALL() = ANCIENT_POKE_BALL
|
||||
|
||||
@JvmName("getANCIENT_CITRINE_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientCitrineBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_CITRINE_BALL() = ANCIENT_CITRINE_BALL
|
||||
|
||||
@JvmName("getANCIENT_VERDANT_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientVerdantBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_VERDANT_BALL() = ANCIENT_VERDANT_BALL
|
||||
|
||||
@JvmName("getANCIENT_AZURE_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientAzureBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_AZURE_BALL() = ANCIENT_AZURE_BALL
|
||||
|
||||
@JvmName("getANCIENT_ROSEATE_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientRoseateBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_ROSEATE_BALL() = ANCIENT_ROSEATE_BALL
|
||||
|
||||
@JvmName("getANCIENT_SLATE_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientSlateBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_SLATE_BALL() = ANCIENT_SLATE_BALL
|
||||
|
||||
@JvmName("getANCIENT_IVORY_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientIvoryBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_IVORY_BALL() = ANCIENT_IVORY_BALL
|
||||
|
||||
@JvmName("getANCIENT_GREAT_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientGreatBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_GREAT_BALL() = ANCIENT_GREAT_BALL
|
||||
|
||||
@JvmName("getANCIENT_ULTRA_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientUltraBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_ULTRA_BALL() = ANCIENT_ULTRA_BALL
|
||||
|
||||
@JvmName("getANCIENT_HEAVY_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientHeavyBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_HEAVY_BALL() = ANCIENT_HEAVY_BALL
|
||||
|
||||
@JvmName("getANCIENT_LEADEN_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientLeadenBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_LEADEN_BALL() = ANCIENT_LEADEN_BALL
|
||||
|
||||
@JvmName("getANCIENT_GIGATON_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientGigatonBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_GIGATON_BALL() = ANCIENT_GIGATON_BALL
|
||||
|
||||
@JvmName("getANCIENT_FEATHER_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientFeatherBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_FEATHER_BALL() = ANCIENT_FEATHER_BALL
|
||||
|
||||
@JvmName("getANCIENT_WING_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientWingBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_WING_BALL() = ANCIENT_WING_BALL
|
||||
|
||||
@JvmName("getANCIENT_JET_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientJetBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_JET_BALL() = ANCIENT_JET_BALL
|
||||
|
||||
@JvmName("getANCIENT_ORIGIN_BALL")
|
||||
@Deprecated("Use PokeBalls.getAncientOriginBall(), provided for backwards compatibility until Cobblemon 1.8.")
|
||||
fun getANCIENT_ORIGIN_BALL() = ANCIENT_ORIGIN_BALL
|
||||
|
||||
}
|
||||
+2
-6
@@ -18,10 +18,6 @@ import net.minecraft.world.entity.LivingEntity
|
||||
*
|
||||
* @property multiplier The multiplier for friendship gains
|
||||
*/
|
||||
data class FriendshipEarningBoostEffect(val multiplier: Float) : CaptureEffect {
|
||||
companion object {
|
||||
const val VARIANT = "friendship_boost"
|
||||
}
|
||||
|
||||
class FriendshipEarningBoostEffect(val multiplier: Float) : CaptureEffect {
|
||||
override fun apply(thrower: LivingEntity, pokemon: Pokemon) {}
|
||||
}
|
||||
}
|
||||
+4
-36
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.api.pokeball.catching.modifiers
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.Stat
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import net.minecraft.util.StringRepresentable
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
|
||||
/**
|
||||
@@ -27,13 +26,9 @@ import net.minecraft.world.entity.LivingEntity
|
||||
*/
|
||||
class BaseStatModifier(
|
||||
val stat: Stat,
|
||||
val value: Int,
|
||||
val comparator: Comparator,
|
||||
val multiplier: Float,
|
||||
val comparator: (value: Int) -> Boolean,
|
||||
val multiplier: Float
|
||||
) : CatchRateModifier {
|
||||
companion object {
|
||||
const val VARIANT = "bst"
|
||||
}
|
||||
|
||||
init {
|
||||
if (stat.type != Stat.Type.PERMANENT) {
|
||||
@@ -49,36 +44,9 @@ class BaseStatModifier(
|
||||
|
||||
override fun isValid(thrower: LivingEntity, pokemon: Pokemon): Boolean {
|
||||
val valStat = pokemon.form.baseStats[this.stat] ?: return false
|
||||
return when (comparator) {
|
||||
Comparator.GT -> value > valStat
|
||||
Comparator.LT -> value < valStat
|
||||
Comparator.GTE -> value >= valStat
|
||||
Comparator.LTE -> value <= valStat
|
||||
Comparator.EQ -> value == valStat
|
||||
Comparator.NOT -> value != valStat
|
||||
}
|
||||
return comparator(valStat)
|
||||
}
|
||||
|
||||
override fun modifyCatchRate(
|
||||
currentCatchRate: Float,
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon,
|
||||
): Float = this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
override fun modifyCatchRate(currentCatchRate: Float, thrower: LivingEntity, pokemon: Pokemon): Float = this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
|
||||
enum class Comparator : StringRepresentable {
|
||||
@JvmField
|
||||
GT,
|
||||
@JvmField
|
||||
LT,
|
||||
@JvmField
|
||||
GTE,
|
||||
@JvmField
|
||||
LTE,
|
||||
@JvmField
|
||||
EQ,
|
||||
@JvmField
|
||||
NOT,
|
||||
;
|
||||
override fun getSerializedName(): String = this.name.lowercase()
|
||||
}
|
||||
}
|
||||
|
||||
-78
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.pokeball.catching.modifiers
|
||||
|
||||
import com.bedrockk.molang.runtime.MoLangRuntime
|
||||
import com.cobblemon.mod.common.api.molang.ExpressionLike
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asBiomeMoLangValue
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asStruct
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asWorldMoLangValue
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import com.cobblemon.mod.common.util.toBlockPos
|
||||
import com.cobblemon.mod.common.util.withPlayerValue
|
||||
import com.cobblemon.mod.common.util.withQueryValue
|
||||
import net.minecraft.core.registries.Registries
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
|
||||
class ExpressionModifier(
|
||||
val query: ExpressionLike = "1.0".asExpressionLike(),
|
||||
) : CatchRateModifier {
|
||||
companion object {
|
||||
const val VARIANT = "expression"
|
||||
val runtime = MoLangRuntime().setup()
|
||||
}
|
||||
|
||||
override fun isGuaranteed(): Boolean = false
|
||||
|
||||
override fun value(
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): Float {
|
||||
val worldValue =
|
||||
thrower
|
||||
.level()
|
||||
.registryAccess()
|
||||
.registryOrThrow(Registries.DIMENSION)
|
||||
.wrapAsHolder(thrower.level())
|
||||
.asWorldMoLangValue()
|
||||
|
||||
val biomeValue = thrower.level().getBiome(thrower.position().toBlockPos()).asBiomeMoLangValue()
|
||||
|
||||
var ballRuntime = runtime
|
||||
.withQueryValue("world", worldValue)
|
||||
.withQueryValue("biome", biomeValue)
|
||||
.withQueryValue("pokemon", pokemon.asStruct())
|
||||
|
||||
if (thrower is ServerPlayer) {
|
||||
ballRuntime = ballRuntime.withPlayerValue("player", thrower)
|
||||
}
|
||||
|
||||
return query.resolveFloat(ballRuntime)
|
||||
}
|
||||
|
||||
override fun behavior(
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): CatchRateModifier.Behavior = CatchRateModifier.Behavior.MULTIPLY
|
||||
|
||||
override fun isValid(
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): Boolean = true
|
||||
|
||||
override fun modifyCatchRate(
|
||||
currentCatchRate: Float,
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): Float = this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
}
|
||||
+2
-4
@@ -19,13 +19,11 @@ import net.minecraft.world.entity.LivingEntity
|
||||
* @since August 9th, 2022
|
||||
*/
|
||||
class GuaranteedModifier : CatchRateModifier {
|
||||
companion object {
|
||||
const val VARIANT = "guaranteed"
|
||||
}
|
||||
|
||||
override fun isGuaranteed() = true
|
||||
override fun value(thrower: LivingEntity, pokemon: Pokemon): Float = 255F
|
||||
override fun behavior(thrower: LivingEntity, pokemon: Pokemon): CatchRateModifier.Behavior = CatchRateModifier.Behavior.MULTIPLY
|
||||
override fun isValid(thrower: LivingEntity, pokemon: Pokemon): Boolean = true
|
||||
override fun modifyCatchRate(currentCatchRate: Float, thrower: LivingEntity, pokemon: Pokemon): Float = this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
|
||||
}
|
||||
}
|
||||
+9
-11
@@ -22,22 +22,20 @@ import net.minecraft.world.entity.LivingEntity
|
||||
* @property matching Will this multiplier should be applied if the labels match?
|
||||
* @property labels The literal labels being queried.
|
||||
*/
|
||||
data class LabelModifier(val multiplier: Float, val matching: Boolean, val labels: List<String>) : CatchRateModifier {
|
||||
companion object {
|
||||
const val VARIANT = "labels"
|
||||
}
|
||||
class LabelModifier(
|
||||
val multiplier: Float,
|
||||
val matching: Boolean,
|
||||
vararg val labels: String
|
||||
) : CatchRateModifier {
|
||||
|
||||
override fun isGuaranteed(): Boolean = false
|
||||
|
||||
override fun value(thrower: LivingEntity, pokemon: Pokemon): Float = this.multiplier
|
||||
|
||||
override fun behavior(thrower: LivingEntity, pokemon: Pokemon): CatchRateModifier.Behavior =
|
||||
CatchRateModifier.Behavior.MULTIPLY
|
||||
override fun behavior(thrower: LivingEntity, pokemon: Pokemon): CatchRateModifier.Behavior = CatchRateModifier.Behavior.MULTIPLY
|
||||
|
||||
override fun isValid(thrower: LivingEntity, pokemon: Pokemon): Boolean =
|
||||
if (this.matching) pokemon.hasLabels(*this.labels.toSet().toTypedArray()) else !pokemon.hasLabels(*this.labels.toSet().toTypedArray())
|
||||
override fun isValid(thrower: LivingEntity, pokemon: Pokemon): Boolean = if (this.matching) pokemon.hasLabels(*this.labels) else !pokemon.hasLabels(*this.labels)
|
||||
|
||||
override fun modifyCatchRate(currentCatchRate: Float, thrower: LivingEntity, pokemon: Pokemon): Float =
|
||||
this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
override fun modifyCatchRate(currentCatchRate: Float, thrower: LivingEntity, pokemon: Pokemon): Float = this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
|
||||
}
|
||||
}
|
||||
+6
-8
@@ -13,21 +13,19 @@ import com.cobblemon.mod.common.api.pokemon.PokemonProperties
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
|
||||
data class PropertyBasedModifier(val property: PokemonProperties, val multiplier: Float) : CatchRateModifier {
|
||||
companion object {
|
||||
const val VARIANT = "property"
|
||||
}
|
||||
class PropertyBasedModifier(
|
||||
val property: PokemonProperties,
|
||||
val multiplier: Float
|
||||
) : CatchRateModifier {
|
||||
|
||||
override fun isGuaranteed(): Boolean = false
|
||||
|
||||
override fun value(thrower: LivingEntity, pokemon: Pokemon): Float = this.multiplier
|
||||
|
||||
override fun behavior(thrower: LivingEntity, pokemon: Pokemon): CatchRateModifier.Behavior =
|
||||
CatchRateModifier.Behavior.MULTIPLY
|
||||
override fun behavior(thrower: LivingEntity, pokemon: Pokemon): CatchRateModifier.Behavior = CatchRateModifier.Behavior.MULTIPLY
|
||||
|
||||
override fun isValid(thrower: LivingEntity, pokemon: Pokemon): Boolean = this.property.matches(pokemon)
|
||||
|
||||
override fun modifyCatchRate(currentCatchRate: Float, thrower: LivingEntity, pokemon: Pokemon): Float =
|
||||
this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
override fun modifyCatchRate(currentCatchRate: Float, thrower: LivingEntity, pokemon: Pokemon): Float = this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
|
||||
}
|
||||
|
||||
-80
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.pokeball.catching.modifiers
|
||||
|
||||
import com.bedrockk.molang.runtime.MoLangRuntime
|
||||
import com.cobblemon.mod.common.api.molang.ExpressionLike
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asBiomeMoLangValue
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asStruct
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asWorldMoLangValue
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
|
||||
import com.cobblemon.mod.common.api.scripting.CobblemonScripts
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import com.cobblemon.mod.common.util.toBlockPos
|
||||
import com.cobblemon.mod.common.util.withPlayerValue
|
||||
import com.cobblemon.mod.common.util.withQueryValue
|
||||
import net.minecraft.core.registries.Registries
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
|
||||
class ScriptModifier(
|
||||
val location: ResourceLocation
|
||||
) : CatchRateModifier {
|
||||
companion object {
|
||||
const val VARIANT = "script"
|
||||
val runtime = MoLangRuntime().setup()
|
||||
}
|
||||
|
||||
override fun isGuaranteed(): Boolean = false
|
||||
|
||||
override fun value(
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): Float {
|
||||
val worldValue =
|
||||
thrower
|
||||
.level()
|
||||
.registryAccess()
|
||||
.registryOrThrow(Registries.DIMENSION)
|
||||
.wrapAsHolder(thrower.level())
|
||||
.asWorldMoLangValue()
|
||||
|
||||
val biomeValue = thrower.level().getBiome(thrower.position().toBlockPos()).asBiomeMoLangValue()
|
||||
|
||||
var ballRuntime = runtime
|
||||
.withQueryValue("world", worldValue)
|
||||
.withQueryValue("biome", biomeValue)
|
||||
.withQueryValue("pokemon", pokemon.asStruct())
|
||||
|
||||
if (thrower is ServerPlayer) {
|
||||
ballRuntime = ballRuntime.withPlayerValue("player", thrower)
|
||||
}
|
||||
|
||||
return CobblemonScripts.run(location, ballRuntime)?.asDouble()?.toFloat() ?: 0.0f
|
||||
}
|
||||
|
||||
override fun behavior(
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): CatchRateModifier.Behavior = CatchRateModifier.Behavior.MULTIPLY
|
||||
|
||||
override fun isValid(
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): Boolean = true
|
||||
|
||||
override fun modifyCatchRate(
|
||||
currentCatchRate: Float,
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon
|
||||
): Float = this.behavior(thrower, pokemon).mutator(currentCatchRate, this.value(thrower, pokemon))
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.pokeball.catching.modifiers
|
||||
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
|
||||
data class SimpleModifier(val multiplier: Float) : CatchRateModifier {
|
||||
companion object {
|
||||
const val VARIANT = "simple"
|
||||
}
|
||||
|
||||
override fun isGuaranteed(): Boolean = false
|
||||
|
||||
override fun value(thrower: LivingEntity, pokemon: Pokemon): Float = this.multiplier
|
||||
|
||||
override fun behavior(thrower: LivingEntity, pokemon: Pokemon): CatchRateModifier.Behavior =
|
||||
CatchRateModifier.Behavior.MULTIPLY
|
||||
|
||||
override fun isValid(thrower: LivingEntity, pokemon: Pokemon): Boolean = true
|
||||
|
||||
override fun modifyCatchRate(
|
||||
currentCatchRate: Float,
|
||||
thrower: LivingEntity,
|
||||
pokemon: Pokemon,
|
||||
): Float = behavior(thrower, pokemon).mutator(currentCatchRate, value(thrower, pokemon))
|
||||
}
|
||||
@@ -10,9 +10,6 @@ package com.cobblemon.mod.common.api.pokedex
|
||||
|
||||
import com.cobblemon.mod.common.api.data.JsonDataRegistry
|
||||
import com.cobblemon.mod.common.api.pokedex.def.PokedexDef
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.PokedexEntry
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.PokedexForm
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies
|
||||
import com.cobblemon.mod.common.api.reactive.SimpleObservable
|
||||
import com.cobblemon.mod.common.net.messages.client.data.PokedexDexSyncPacket
|
||||
import com.cobblemon.mod.common.util.adapters.CodecBackedAdapter
|
||||
@@ -64,14 +61,6 @@ object Dexes : JsonDataRegistry<PokedexDef> {
|
||||
PokedexDexSyncPacket(dexEntryMap.values).sendToPlayer(player)
|
||||
}
|
||||
|
||||
fun findDexEntryBySpeciesId(regionId: ResourceLocation, speciesId: ResourceLocation): PokedexEntry? {
|
||||
return dexEntryMap[regionId]?.getEntries()?.firstOrNull { it -> it.speciesId == speciesId }
|
||||
}
|
||||
|
||||
fun findDexEntryBySpeciesId(speciesId: ResourceLocation): PokedexEntry? {
|
||||
return findDexEntryBySpeciesId(cobblemonResource("national"), speciesId)
|
||||
}
|
||||
|
||||
fun getFormEquivalents(formName: String): List<String> {
|
||||
val key = equivalentFormsLookup[formName.lowercase()]
|
||||
return equivalentForms[key] ?: listOf(formName.lowercase())
|
||||
|
||||
+6
-6
@@ -88,7 +88,7 @@ fun getToolTipHeaderIcon(tradeEvolution: TradeEvolution): CobblemonDexEvolutionR
|
||||
lang("ui.pokedex.evolution.trade.tooltip.with_any_species")
|
||||
} else {
|
||||
PokemonSpecies.getByIdentifier(species.asIdentifierDefaultingNamespace())
|
||||
?.let { lang("ui.pokedex.evolution.trade.tooltip.with_species", it.translatedName.green()) }
|
||||
?.let { lang("ui.pokedex.evolution.trade.tooltip.with_species", it.translatedName.plainCopy().green()) }
|
||||
?: lang("ui.pokedex.evolution.trade.tooltip.with_any_species")
|
||||
}
|
||||
return CobblemonDexEvolutionRequirementDisplay(CobblemonItems.LINK_CABLE, tooltip)
|
||||
@@ -282,7 +282,7 @@ fun buildLevelRequirement(levelRequirement: LevelRequirement): DexEvolutionRequi
|
||||
|
||||
fun buildMoonPhaseRequirement(moonPhaseRequirement: MoonPhaseRequirement): DexEvolutionRequirementDisplay {
|
||||
val icon = Items.CLOCK
|
||||
val moonPhaseComponent = moonPhaseRequirement.moonPhase.displayName().green()
|
||||
val moonPhaseComponent = moonPhaseRequirement.moonPhase.displayName().plainCopy().green()
|
||||
val tooltip = lang("ui.pokedex.requirement.moon_phase.tooltip", moonPhaseComponent)
|
||||
|
||||
return CobblemonDexEvolutionRequirementDisplay(icon, tooltip)
|
||||
@@ -290,7 +290,7 @@ fun buildMoonPhaseRequirement(moonPhaseRequirement: MoonPhaseRequirement): DexEv
|
||||
|
||||
fun buildMoveSetRequirement(moveSetRequirement: MoveSetRequirement): DexEvolutionRequirementDisplay {
|
||||
val icon = CobblemonItems.TECHNICAL_MACHINE
|
||||
val tooltip = lang("ui.pokedex.requirement.has_move.tooltip", moveSetRequirement.move.displayName.green())
|
||||
val tooltip = lang("ui.pokedex.requirement.has_move.tooltip", moveSetRequirement.move.displayName.plainCopy().green())
|
||||
|
||||
return CobblemonDexEvolutionRequirementDisplay(icon, tooltip)
|
||||
}
|
||||
@@ -319,7 +319,7 @@ fun buildMoveTypeRequirement(moveTypeRequirement: MoveTypeRequirement): DexEvolu
|
||||
else -> CobblemonItems.NORMAL_GEM
|
||||
}
|
||||
|
||||
val tooltip = lang("ui.pokedex.requirement.has_move_type.tooltip", moveTypeRequirement.type.displayName.green())
|
||||
val tooltip = lang("ui.pokedex.requirement.has_move_type.tooltip", moveTypeRequirement.type.displayName.plainCopy().green())
|
||||
|
||||
return CobblemonDexEvolutionRequirementDisplay(icon, tooltip)
|
||||
}
|
||||
@@ -437,7 +437,7 @@ fun buildStructureRequirement(structureRequirement: StructureRequirement, negate
|
||||
|
||||
fun buildTimeRangeRequirement(timeRangeRequirement: TimeRangeRequirement): DexEvolutionRequirementDisplay? {
|
||||
val icon = Items.CLOCK
|
||||
val timeRangeComponent = timeRangeRequirement.range.displayName() ?: return null
|
||||
val timeRangeComponent = timeRangeRequirement.range.displayName()?.plainCopy() ?: return null
|
||||
val tooltip = lang("ui.pokedex.requirement.time_range.tooltip", timeRangeComponent.green())
|
||||
|
||||
return CobblemonDexEvolutionRequirementDisplay(icon, tooltip)
|
||||
@@ -445,7 +445,7 @@ fun buildTimeRangeRequirement(timeRangeRequirement: TimeRangeRequirement): DexEv
|
||||
|
||||
fun buildUseMoveRequirement(useMoveRequirement: UseMoveRequirement): DexEvolutionRequirementDisplay {
|
||||
val icon = CobblemonItems.CHOICE_BAND
|
||||
val tooltip = lang("ui.pokedex.requirement.use_move.tooltip", useMoveRequirement.move.displayName.green())
|
||||
val tooltip = lang("ui.pokedex.requirement.use_move.tooltip", useMoveRequirement.move.displayName.plainCopy().green())
|
||||
|
||||
return CobblemonDexEvolutionRequirementDisplay(icon, tooltip)
|
||||
}
|
||||
|
||||
@@ -25,9 +25,7 @@ import com.cobblemon.mod.common.api.pokemon.requirement.Requirement
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.item.PokeBallItem
|
||||
import com.cobblemon.mod.common.item.components.PokeBallComponent
|
||||
import com.cobblemon.mod.common.net.messages.client.animation.PlayPosableAnimationPacket
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.pokemon.activestate.ShoulderedState
|
||||
import com.cobblemon.mod.common.pokemon.evolution.variants.ItemInteractionEvolution
|
||||
@@ -140,7 +138,7 @@ interface Evolution : EvolutionLike {
|
||||
val shedPokemon = pokemon.clone(registryAccess = owner.registryAccess())
|
||||
shedPokemon.removeHeldItem()
|
||||
innerShedder.apply(shedPokemon)
|
||||
shedPokemon.caughtBall = pokeballStack?.let { PokeBallComponent.getPokeBall(it) } ?: CobblemonItems.STRANGE_BALL.pokeBall
|
||||
shedPokemon.caughtBall = ((pokeballStack?.item ?: CobblemonItems.POKE_BALL) as PokeBallItem).pokeBall
|
||||
pokemon.storeCoordinates.get()?.store?.add(shedPokemon)
|
||||
CobblemonCriteria.EVOLVE_POKEMON.trigger(owner, EvolvePokemonContext(pokemon.preEvolution!!.species.resourceIdentifier, shedPokemon.species.resourceIdentifier, playerDataManager.getGenericData(owner).advancementData.totalEvolvedCount))
|
||||
// Consume one of the balls (if the player isn't creative)
|
||||
|
||||
+2
-2
@@ -42,8 +42,8 @@ abstract class AreaTypeSpawningCondition<T : AreaSpawnablePosition> : SpawningCo
|
||||
override fun copyFrom(other: SpawningCondition<*>, merger: Merger) {
|
||||
super.copyFrom(other, merger)
|
||||
if (other is AreaTypeSpawningCondition) {
|
||||
merger.mergeSingle(minHeight, other.minHeight)
|
||||
merger.mergeSingle(maxHeight, other.maxHeight)
|
||||
minHeight = merger.mergeSingle(minHeight, other.minHeight)
|
||||
maxHeight = merger.mergeSingle(maxHeight, other.maxHeight)
|
||||
neededNearbyBlocks = merger.merge(neededNearbyBlocks, other.neededNearbyBlocks)?.toMutableList()
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ abstract class SubmergedTypeSpawningCondition<T : SubmergedSpawnablePosition> :
|
||||
super.copyFrom(other, merger)
|
||||
if (other is SubmergedTypeSpawningCondition) {
|
||||
minDepth = merger.mergeSingle(minDepth, other.minDepth)
|
||||
maxDepth = merger.mergeSingle(minDepth, other.minDepth)
|
||||
maxDepth = merger.mergeSingle(maxDepth, other.maxDepth)
|
||||
fluidIsSource = merger.mergeSingle(fluidIsSource, other.fluidIsSource)
|
||||
fluid = merger.mergeSingle(fluid, other.fluid)
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ abstract class SurfaceTypeSpawningCondition<T : SurfaceSpawnablePosition> : Area
|
||||
super.copyFrom(other, merger)
|
||||
if (other is SurfaceTypeSpawningCondition) {
|
||||
minDepth = merger.mergeSingle(minDepth, other.minDepth)
|
||||
maxDepth = merger.mergeSingle(minDepth, other.minDepth)
|
||||
maxDepth = merger.mergeSingle(maxDepth, other.maxDepth)
|
||||
fluid = merger.mergeSingle(fluid, other.fluid)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -145,7 +145,7 @@ class ReforgedConversion(val base: Path) : CobblemonConverter<CompoundTag> {
|
||||
// result.nickname = this.find(nbt, "Nickname", NbtCompound::getString)
|
||||
|
||||
val ball = this.find(nbt, "CaughtBall", CompoundTag::getString)
|
||||
result.caughtBall = if(ball != null) PokeBalls.getPokeBall(ResourceLocation.parse(ball)) else PokeBalls.STRANGE_BALL
|
||||
result.caughtBall = if(ball != null) PokeBalls.getPokeBall(ResourceLocation.parse(ball)) ?: PokeBalls.POKE_BALL else PokeBalls.POKE_BALL
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -190,4 +190,4 @@ class ReforgedConversion(val base: Path) : CobblemonConverter<CompoundTag> {
|
||||
CAREFUL,
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ object CobblemonItemTags {
|
||||
@JvmField val DESTINY_KNOT = create("held/destiny_knot")
|
||||
@JvmField val EVERSTONE = create("held/everstone")
|
||||
@JvmField val EXPERIENCE_SHARE = create("held/experience_share")
|
||||
@JvmField val IS_FRIENDSHIP_BOOSTER = create("is_friendship_booster")
|
||||
@JvmField val IS_FRIENDSHIP_BOOSTER = create("held/is_friendship_booster")
|
||||
@JvmField val ANY_HELD_ITEM = create("held/is_held_item")
|
||||
@JvmField val BLACKLISTED_ITEMS_TO_HOLD = create("held/blacklisted_items_to_hold")
|
||||
@JvmField val WHITELISTED_ITEMS_TO_HOLD = create("held/whitelisted_items_to_hold")
|
||||
|
||||
+11
-2
@@ -37,7 +37,6 @@ import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
|
||||
import com.cobblemon.mod.common.util.battleLang
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
|
||||
/**
|
||||
* Format: |move|POKEMON|MOVE|TARGET
|
||||
@@ -77,7 +76,7 @@ class MoveInstruction(
|
||||
val pokemonName = userPokemon.getName()
|
||||
ShowdownInterpreter.lastCauser[battle.battleId] = message
|
||||
// For Spread targets the message data only gives the pnx strings. So we can't know what pokemon are actually targeted until the previous messages have been interpreted
|
||||
val spreadTargetPokemon = spreadTargets.map { battle.activePokemon.firstOrNull() { poke -> poke.getPNX() == it }?.battlePokemon }
|
||||
val spreadTargetPokemon = spreadTargets.map { battle.activePokemon.firstOrNull { poke -> poke.getPNX() == it }?.battlePokemon }
|
||||
|
||||
val targetPokemonEntity = targetPokemon?.entity
|
||||
if (targetPokemonEntity != null) {
|
||||
@@ -137,10 +136,20 @@ class MoveInstruction(
|
||||
|
||||
val subsequentInstructions = instructionSet.findInstructionsCausedBy(this)
|
||||
val missedTargets = subsequentInstructions.filterIsInstance<MissInstruction>().mapNotNull { it.target }
|
||||
val faintedTargets = subsequentInstructions.filterIsInstance<FaintInstruction>().map { it.faintingPokemon }
|
||||
val failed = subsequentInstructions.any { it is FailInstruction }
|
||||
val failedTargets = subsequentInstructions.filterIsInstance<FailInstruction>().mapNotNull { it.target }
|
||||
val hitCountInstruction = subsequentInstructions.filterIsInstance<HitCountInstruction>().firstOrNull()
|
||||
|
||||
runtime.environment.query.addFunction("target_fainted") { params ->
|
||||
if (params.params.size == 0) {
|
||||
return@addFunction DoubleValue(faintedTargets.isNotEmpty())
|
||||
} else {
|
||||
val entityUUID = params.getString(0)
|
||||
return@addFunction DoubleValue(faintedTargets.any { it.entity?.stringUUID == entityUUID })
|
||||
}
|
||||
}
|
||||
|
||||
runtime.environment.query.addFunction("missed") { params ->
|
||||
if (params.params.size == 0) {
|
||||
return@addFunction DoubleValue(missedTargets.isNotEmpty())
|
||||
|
||||
+1
-7
@@ -16,9 +16,7 @@ import com.cobblemon.mod.common.client.render.pokeball.PokeBallPosableState
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity.CaptureState
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity.CaptureState.NOT
|
||||
import com.cobblemon.mod.common.util.toRGBA
|
||||
import net.minecraft.network.syncher.EntityDataAccessor
|
||||
import org.joml.Vector4f
|
||||
|
||||
class EmptyPokeBallClientDelegate : PokeBallPosableState(), EntitySideDelegate<EmptyPokeBallEntity> {
|
||||
override val stateEmitter: SettableObservable<CaptureState> = SettableObservable(NOT)
|
||||
@@ -54,8 +52,4 @@ class EmptyPokeBallClientDelegate : PokeBallPosableState(), EntitySideDelegate<E
|
||||
EmptyPokeBallEntity.ASPECTS -> currentAspects = currentEntity.aspects
|
||||
}
|
||||
}
|
||||
|
||||
fun getBeamColor(): Vector4f {
|
||||
return currentEntity.pokeBall.beamColor.rgb.toRGBA()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,6 +85,7 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
if (HidePartyBinding.shouldHide) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -558,4 +559,4 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-20
@@ -9,19 +9,11 @@
|
||||
package com.cobblemon.mod.common.client.gui.pokedex.widgets
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.api.gui.*
|
||||
import com.cobblemon.mod.common.api.pokedex.Dexes
|
||||
import com.cobblemon.mod.common.api.pokedex.PokedexEntryProgress
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.CobblemonBiomeDexEvolutionRequirementDisplay
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.DexEntries
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.DexEvolutionDisplay
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.DexEvolutionRequirementDisplay
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.PokedexEntry
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.PokedexForm
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
|
||||
import com.cobblemon.mod.common.api.pokedex.entry.*
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies
|
||||
import com.cobblemon.mod.common.api.pokemon.evolution.Evolution
|
||||
import com.cobblemon.mod.common.api.text.add
|
||||
import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.api.text.green
|
||||
@@ -41,16 +33,15 @@ import com.cobblemon.mod.common.client.render.renderScaledGuiItemIcon
|
||||
import com.cobblemon.mod.common.pokemon.FormData
|
||||
import com.cobblemon.mod.common.pokemon.Gender
|
||||
import com.cobblemon.mod.common.pokemon.RenderablePokemon
|
||||
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.core.registries.Registries
|
||||
import net.minecraft.locale.Language
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.network.chat.MutableComponent
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.tags.TagKey
|
||||
|
||||
class EvolutionTreeWidget(
|
||||
@@ -168,7 +159,8 @@ class EvolutionTreeWidget(
|
||||
// Stop at whatever the dex can't resolve, and at cycles (datapacks)
|
||||
val visited = mutableSetOf(rootSpecies.speciesId to rootForm.displayForm)
|
||||
while (preEvolution != null) {
|
||||
val preEvolutionSpecies = Dexes.findDexEntryBySpeciesId(preEvolution.fromSpecies) ?: break
|
||||
val preEvolutionSpecies = DexEntries.entries.values.firstOrNull { it.speciesId == preEvolution.fromSpecies &&
|
||||
it.forms.any {form -> form.displayForm.equals(preEvolution.fromForm, ignoreCase = true)}} ?: break
|
||||
val preEvolutionForm = preEvolutionSpecies.forms.firstOrNull { it.displayForm.equals(preEvolution.fromForm, ignoreCase = true) } ?: break
|
||||
if (!visited.add(preEvolutionSpecies.speciesId to preEvolutionForm.displayForm)) break
|
||||
rootSpecies = preEvolutionSpecies
|
||||
@@ -176,19 +168,16 @@ class EvolutionTreeWidget(
|
||||
preEvolution = findPreEvolution(rootSpecies, rootForm)
|
||||
}
|
||||
|
||||
val entry = Dexes.findDexEntryBySpeciesId(rootSpecies.speciesId)
|
||||
?: throw RuntimeException("Root dex entry not found")
|
||||
|
||||
val viewedFormEquivalents = Dexes.getFormEquivalents(pokedexForm.displayForm)
|
||||
viewedForm = PokemonSpecies.getByIdentifier(pokedexEntry.speciesId)
|
||||
?.forms?.firstOrNull { viewedFormEquivalents.contains(it.name.lowercase()) }
|
||||
|
||||
val formEquivalents = Dexes.getFormEquivalents(rootForm.displayForm)
|
||||
val form =
|
||||
entry.forms.firstOrNull { formEquivalents.contains(it.displayForm.lowercase()) } ?:
|
||||
entry.forms.first { it.displayForm.equals("Normal", ignoreCase = true) }
|
||||
rootSpecies.forms.firstOrNull { formEquivalents.contains(it.displayForm.lowercase()) } ?:
|
||||
rootSpecies.forms.first { it.displayForm.equals("Normal", ignoreCase = true) }
|
||||
|
||||
val rootEvolutionNode = buildEvolutionTree(entry, form)
|
||||
val rootEvolutionNode = buildEvolutionTree(rootSpecies, form)
|
||||
|
||||
// val isSameEntry = previousRootPokedexEntry != null && pokedexEntry?.id == previousRootPokedexEntry?.id
|
||||
// val isSameForm =
|
||||
@@ -214,7 +203,7 @@ class EvolutionTreeWidget(
|
||||
|
||||
/** The evolution leading to [form]; the standard form falls back to any form of the species (no evolution leads to regular Vivillon). */
|
||||
private fun findPreEvolution(entry: PokedexEntry, form: PokedexForm): DexEvolutionDisplay? {
|
||||
return DexEntries.evolutionDisplays.firstOrNull { it.toSpecies == entry.speciesId && it.toForm == form.displayForm }
|
||||
return DexEntries.evolutionDisplays.firstOrNull { it.toSpecies == entry.speciesId && form.displayForm.equals(it.toForm, ignoreCase = true) }
|
||||
?: DexEntries.evolutionDisplays.takeIf { form.displayForm.equals("Normal", ignoreCase = true) }
|
||||
?.firstOrNull { it.toSpecies == entry.speciesId }
|
||||
}
|
||||
@@ -246,7 +235,8 @@ class EvolutionTreeWidget(
|
||||
val evolutions = DexEntries.evolutionDisplays.filter { it.fromSpecies == pokedexEntry.speciesId && formEquivalents.contains(it.fromForm.lowercase()) }
|
||||
|
||||
val children = evolutions.mapNotNull {
|
||||
val childPokedexEntry = Dexes.findDexEntryBySpeciesId(it.toSpecies)
|
||||
val childPokedexEntry = DexEntries.entries.values.firstOrNull { entry -> entry.speciesId == it.toSpecies &&
|
||||
entry.forms.any {form -> form.displayForm.equals(it.toForm, ignoreCase = true)}}
|
||||
if (childPokedexEntry == null) {
|
||||
Cobblemon.LOGGER.warn("Dex entry not found for species: ${it.toSpecies}")
|
||||
return@mapNotNull null
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ object BattleCaptureStartHandler : ClientNetworkPacketHandler<BattleCaptureStart
|
||||
val battle = CobblemonClient.battle ?: return
|
||||
val targetPokemon = battle.getPokemonFromPNX(packet.targetPNX)
|
||||
val tile = targetPokemon.second
|
||||
val pokeBall = PokeBalls.getPokeBall(packet.pokeBallType)
|
||||
val pokeBall = PokeBalls.getPokeBall(packet.pokeBallType) ?: PokeBalls.POKE_BALL
|
||||
tile.ballCapturing = ClientBallDisplay(pokeBall, packet.aspects).also { it.start() }
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -133,11 +133,11 @@ class PokeBobberEntityRenderer(context: EntityRendererProvider.Context?) : Entit
|
||||
val pokeBobberBaitItemStack = fishingBobberEntity.entityData.get(PokeRodFishingBobberEntity.POKEBOBBER_BAIT)
|
||||
val pokeRodId = ResourceLocation.tryParse(pokeRodIdStr)
|
||||
val pokeRod = PokeRods.getPokeRod(pokeRodId!!)
|
||||
val ballItem = PokeBalls.getPokeBall(pokeRod?.pokeBallId!!)!!.stack
|
||||
val ballItem = PokeBalls.getPokeBall(pokeRod?.pokeBallId!!)!!.item
|
||||
|
||||
// render the pokebobber
|
||||
Minecraft.getInstance().itemRenderer.renderStatic(
|
||||
ballItem,
|
||||
ballItem.defaultInstance,
|
||||
ItemDisplayContext.GROUND,
|
||||
light,
|
||||
OverlayTexture.NO_OVERLAY,
|
||||
|
||||
+2
-2
@@ -34,6 +34,7 @@ import com.cobblemon.mod.common.client.render.models.blockbench.bedrock.animatio
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.quirk.ModelQuirk
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.quirk.QuirkData
|
||||
import com.cobblemon.mod.common.client.sound.instances.UIEntitySoundInstance
|
||||
import com.cobblemon.mod.common.entity.PosableEntity
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
@@ -44,7 +45,6 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException
|
||||
import java.util.concurrent.ConcurrentLinkedQueue
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.multiplayer.ClientLevel
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance
|
||||
import net.minecraft.commands.arguments.item.ItemParser
|
||||
import net.minecraft.sounds.SoundEvent
|
||||
import net.minecraft.world.entity.Entity
|
||||
@@ -289,7 +289,7 @@ abstract class PosableState : Schedulable {
|
||||
entity.level().playLocalSound(entity, soundEvent, entity.soundSource, volume, pitch)
|
||||
}
|
||||
} else {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(soundEvent, volume, pitch))
|
||||
Minecraft.getInstance().soundManager.play(UIEntitySoundInstance(soundEvent, volume, pitch))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,6 +19,7 @@ import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Bone
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
|
||||
import com.cobblemon.mod.common.client.sound.instances.AlphaCrySoundInstance
|
||||
import com.cobblemon.mod.common.client.sound.instances.UIEntitySoundInstance
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.util.effectiveName
|
||||
import com.cobblemon.mod.common.util.genericRuntime
|
||||
@@ -31,7 +32,6 @@ import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.client.multiplayer.ClientLevel
|
||||
import net.minecraft.client.resources.sounds.EntityBoundSoundInstance
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.sounds.SoundEvent
|
||||
import net.minecraft.world.entity.Entity
|
||||
@@ -121,7 +121,7 @@ class BedrockSoundKeyframe(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(soundEvent, 1F, 1F))
|
||||
Minecraft.getInstance().soundManager.play(UIEntitySoundInstance(soundEvent))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokeball
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.ModelFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Bone
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
|
||||
open class PokeBallPosableModel(root: Bone) : PosableModel(root), ModelFrame {
|
||||
@Transient
|
||||
override val rootPart =
|
||||
(root as ModelPart)
|
||||
.children.entries
|
||||
.first()
|
||||
.let { root.registerChildWithAllChildren(it.key) }
|
||||
|
||||
val rootBone: String = (root as ModelPart).children.entries.first().key
|
||||
}
|
||||
+2
-2
@@ -13,11 +13,11 @@ import com.cobblemon.mod.common.client.render.models.blockbench.repository.Rende
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
|
||||
import net.minecraft.world.entity.Entity
|
||||
|
||||
class PosablePokeBallEntityModel : PosableEntityModel<EmptyPokeBallEntity>() {
|
||||
class PosablePokeBallModel : PosableEntityModel<EmptyPokeBallEntity>() {
|
||||
override fun setupEntityTypeContext(entity: Entity?) {
|
||||
super.setupEntityTypeContext(entity)
|
||||
if (entity is EmptyPokeBallEntity) {
|
||||
context.put(RenderContext.ASPECTS, entity.aspects)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -29,8 +29,8 @@ class FarfetchdGalarianModel(root: ModelPart) : PokemonPosableModel(root), Heade
|
||||
override var portraitScale = 2.6F
|
||||
override var portraitTranslation = Vec3(-0.2, -1.0, 0.0)
|
||||
|
||||
override var profileScale = 1.1F
|
||||
override var profileTranslation = Vec3(-0.1, 0.1, 0.0)
|
||||
override var profileScale = 0.93F
|
||||
override var profileTranslation = Vec3(-0.1, 0.36, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@ class FarfetchdModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame,
|
||||
override var portraitScale = 2.6F
|
||||
override var portraitTranslation = Vec3(-0.2, -1.0, 0.0)
|
||||
|
||||
override var profileScale = 1.1F
|
||||
override var profileTranslation = Vec3(-0.1, 0.1, 0.0)
|
||||
override var profileScale = 0.93F
|
||||
override var profileTranslation = Vec3(-0.1, 0.36, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ class KabutoModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
override var portraitScale = 3.3F
|
||||
override var portraitTranslation = Vec3(0.0, -3.3, 0.0)
|
||||
|
||||
override var profileScale = 1.6F
|
||||
override var profileTranslation = Vec3(0.0, -0.6, 0.0)
|
||||
override var profileScale = 1.25F
|
||||
override var profileTranslation = Vec3(0.0, -0.17, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ class HoothootModel (root: ModelPart) : PokemonPosableModel(root) {
|
||||
|
||||
override var portraitScale = 2.2F
|
||||
override var portraitTranslation = Vec3(-0.25, -0.9, 0.0)
|
||||
override var profileScale = 1.0F
|
||||
override var profileTranslation = Vec3(0.0, 0.3, 0.0)
|
||||
override var profileScale = 0.82F
|
||||
override var profileTranslation = Vec3(0.0, 0.53, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ class WooperModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.15, -0.65, 0.0)
|
||||
|
||||
override var profileScale = 0.9F
|
||||
override var profileTranslation = Vec3(0.0, 0.4, 0.0)
|
||||
override var profileScale = 0.75F
|
||||
override var profileTranslation = Vec3(0.0, 0.6, 0.0)
|
||||
|
||||
lateinit var shoulderLeft: Pose
|
||||
lateinit var shoulderRight: Pose
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ class WooperPaldeanModel(root: ModelPart) : PokemonPosableModel(root), HeadedFra
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.15, -0.65, 0.0)
|
||||
|
||||
override var profileScale = 0.9F
|
||||
override var profileTranslation = Vec3(0.0, 0.4, 0.0)
|
||||
override var profileScale = 0.75F
|
||||
override var profileTranslation = Vec3(0.0, 0.6, 0.0)
|
||||
|
||||
lateinit var shoulderLeft: Pose
|
||||
lateinit var shoulderRight: Pose
|
||||
|
||||
+3
@@ -12,6 +12,7 @@ import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonP
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
@@ -28,6 +29,8 @@ class MasquerainModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame
|
||||
lateinit var walk: Pose
|
||||
lateinit var standing: Pose
|
||||
override fun registerPoses() {
|
||||
animations["cry"] = "q.bedrock_stateful('masquerain', 'cry')".asExpressionLike()
|
||||
|
||||
val blink = quirk { bedrockStateful("masquerain", "blink") }
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
|
||||
+3
@@ -14,6 +14,7 @@ import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonP
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import com.cobblemon.mod.common.util.isInWater
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
@@ -36,6 +37,8 @@ class SurskitModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
val wateroffset = -8
|
||||
|
||||
override fun registerPoses() {
|
||||
animations["cry"] = "q.bedrock_stateful('surskit', 'cry')".asExpressionLike()
|
||||
|
||||
val blink = quirk { bedrockStateful("surskit", "blink") }
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
|
||||
+3
@@ -14,6 +14,7 @@ import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonP
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
@@ -36,6 +37,8 @@ class CombeeModel (root: ModelPart) : PokemonPosableModel(root) {
|
||||
val shoulderZOffset = 8
|
||||
|
||||
override fun registerPoses() {
|
||||
animations["cry"] = "q.bedrock_stateful('combee', 'cry')".asExpressionLike()
|
||||
|
||||
val blink1 = quirk { bedrockStateful("combee", "blink_right") }
|
||||
val blink2 = quirk { bedrockStateful("combee", "blink_gender") }
|
||||
val blink3 = quirk { bedrockStateful("combee", "blink_left") }
|
||||
|
||||
+3
@@ -12,6 +12,7 @@ import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonP
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
@@ -30,6 +31,8 @@ class VespiquenModel (root: ModelPart) : PokemonPosableModel(root) {
|
||||
lateinit var standing: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
animations["cry"] = "q.bedrock_stateful('vespiquen', 'cry')".asExpressionLike()
|
||||
|
||||
val blink1 = quirk { bedrockStateful("vespiquen", "blink") }
|
||||
val wingsleep = quirk { bedrockStateful("vespiquen", "sleep_flap") }
|
||||
|
||||
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen5
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class SerperiorModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("serperior")
|
||||
override val head = getPart("head_ai")
|
||||
|
||||
override var portraitScale = 2.5F
|
||||
override var portraitTranslation = Vec3(-0.3, 1.25, 0.0)
|
||||
|
||||
override var profileScale = 0.6F
|
||||
override var profileTranslation = Vec3(0.0, 0.8, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
lateinit var sleep: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("serperior", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("serperior", "blink") }
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("serperior", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("serperior", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("serperior", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen5
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class ServineModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("servine")
|
||||
override val head = getPart("head_ai")
|
||||
override val rightArm = getPart("arm_right")
|
||||
override val leftArm = getPart("arm_left")
|
||||
override val rightLeg = getPart("leg_right")
|
||||
override val leftLeg = getPart("leg_left")
|
||||
|
||||
override var portraitScale = 2.6F
|
||||
override var portraitTranslation = Vec3(-0.15, 0.75, 0.0)
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.55, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("servine", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("servine", "blink") }
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(bedrock("servine", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("servine", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walking",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("servine", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen5
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class SnivyModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("snivy")
|
||||
override val head = getPart("head_ai")
|
||||
override val rightArm = getPart("arm_right")
|
||||
override val leftArm = getPart("arm_left")
|
||||
override val rightLeg = getPart("leg_right")
|
||||
override val leftLeg = getPart("leg_left")
|
||||
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.15, 0.32, 0.0)
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.55, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("snivy", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("snivy", "blink") }
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(bedrock("snivy", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("snivy", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walking",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("snivy", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -23,7 +23,7 @@ class CarbinkModel (root: ModelPart) : PokemonPosableModel(root) {
|
||||
override var portraitScale = 1.8F
|
||||
override var portraitTranslation = Vec3(0.0, 0.2, 0.0)
|
||||
|
||||
override var profileScale = 0.85F
|
||||
override var profileScale = 0.68F
|
||||
override var profileTranslation = Vec3(0.0, 0.7, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen6
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class GourgeistModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("gourgeist")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 4.0F
|
||||
override var portraitTranslation = Vec3(-0.1, 0.6, 0.0)
|
||||
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.55, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
lateinit var hovering: Pose
|
||||
lateinit var fly: Pose
|
||||
lateinit var sleep: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("gourgeist", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("gourgeist", "blink") }
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.UI_POSES + PoseType.STAND,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("gourgeist", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseType = PoseType.WALK,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("gourgeist", "ground_walk")
|
||||
)
|
||||
)
|
||||
|
||||
hovering = registerPose(
|
||||
poseName = "hovering",
|
||||
poseType = PoseType.HOVER,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("gourgeist", "air_idle")
|
||||
)
|
||||
)
|
||||
|
||||
fly = registerPose(
|
||||
poseName = "fly",
|
||||
poseType = PoseType.FLY,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("gourgeist", "air_fly")
|
||||
)
|
||||
)
|
||||
|
||||
sleep = registerPose(
|
||||
poseName = "sleep",
|
||||
poseType = PoseType.SLEEP,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("gourgeist", "sleep")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
-77
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen6
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class PumpkabooModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("pumpkaboo")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 3.5F
|
||||
override var portraitTranslation = Vec3(0.0, -1.5, 0.0)
|
||||
|
||||
override var profileScale = 1.0F
|
||||
override var profileTranslation = Vec3(0.0, 0.25, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
lateinit var battleidle: CobblemonPose
|
||||
lateinit var sleep: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("pumpkaboo", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("pumpkaboo", "blink") }
|
||||
val quirk = quirk { bedrockStateful("pumpkaboo", "quirk_idle") }
|
||||
|
||||
sleep = registerPose(
|
||||
poseName = "sleep",
|
||||
poseType = PoseType.SLEEP,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("pumpkaboo", "sleep")
|
||||
)
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
quirks = arrayOf(blink, quirk),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("pumpkaboo", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("pumpkaboo", "ground_walk")
|
||||
)
|
||||
)
|
||||
|
||||
battleidle = registerPose(
|
||||
poseName = "battleidle",
|
||||
poseTypes = PoseType.STATIONARY_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("pumpkaboo", "battle_idle")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -26,8 +26,8 @@ class ScatterbugModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame
|
||||
override var portraitScale = 2.6F
|
||||
override var portraitTranslation = Vec3(-0.2, -1.9, 0.0)
|
||||
|
||||
override var profileScale = 1.2F
|
||||
override var profileTranslation = Vec3(0.0, 0.05, 0.0)
|
||||
override var profileScale = 0.98F
|
||||
override var profileTranslation = Vec3(0.0, 0.28, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ class CharcadetModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame,
|
||||
override var portraitScale = 1.7F
|
||||
override var portraitTranslation = Vec3(-0.15, 0.08, 0.0)
|
||||
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.6, 0.0)
|
||||
override var profileScale = 0.58F
|
||||
override var profileTranslation = Vec3(0.0, 0.91, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walking: CobblemonPose
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ class QuaquavalModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame,
|
||||
override var portraitScale = 2.3F
|
||||
override var portraitTranslation = Vec3(-0.42, 3.7, 0.0)
|
||||
|
||||
override var profileScale = 0.32F
|
||||
override var profileTranslation = Vec3(0.0, 1.24, 0.0)
|
||||
override var profileScale = 0.36F
|
||||
override var profileTranslation = Vec3(0.0, 1.19, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var standing2: CobblemonPose
|
||||
|
||||
-208
@@ -1,208 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen9
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.WingFlapIdleAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BiWingedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.parabolaFunction
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.sineFunction
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.math.geometry.toRadians
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class SquawkabillyModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BiWingedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("squawkabilly")
|
||||
override val head = getPart("head")
|
||||
override val leftWing = getPart("wing_left")
|
||||
override val rightWing = getPart("wing_right")
|
||||
override val leftLeg = getPart("leg_left")
|
||||
override val rightLeg = getPart("leg_right")
|
||||
private val tail = getPart("tail")
|
||||
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.2, -0.2, 0.0)
|
||||
|
||||
override var profileScale = 0.85F
|
||||
override var profileTranslation = Vec3(0.0, 0.51, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
lateinit var hovering: Pose
|
||||
lateinit var flying: Pose
|
||||
lateinit var shoulderLeft: Pose
|
||||
lateinit var shoulderRight: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("squawkabilly", "cry") }
|
||||
|
||||
val shoulderOffsetX = -1.0
|
||||
val shoulderOffsetY = 0
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("squawkabilly", "blink") }
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
quirks = arrayOf(blink),
|
||||
poseTypes = PoseType.UI_POSES + PoseType.STAND,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("squawkabilly", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
quirks = arrayOf(blink),
|
||||
poseType = PoseType.WALK,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("squawkabilly", "ground_idle"),
|
||||
rootPart.translation(
|
||||
function = parabolaFunction(
|
||||
peak = -4F,
|
||||
period = 0.4F
|
||||
),
|
||||
timeVariable = { state, _, _ -> state.animationSeconds },
|
||||
axis = ModelPartTransformation.Y_AXIS
|
||||
),
|
||||
head.translation(
|
||||
function = sineFunction(
|
||||
amplitude = (-20F).toRadians(),
|
||||
period = 1F,
|
||||
verticalShift = (-10F).toRadians()
|
||||
),
|
||||
axis = ModelPartTransformation.X_AXIS,
|
||||
timeVariable = { state, _, _ -> state.animationSeconds }
|
||||
),
|
||||
leftLeg.rotation(
|
||||
function = parabolaFunction(
|
||||
tightness = -20F,
|
||||
phaseShift = 0F,
|
||||
verticalShift = (30F).toRadians()
|
||||
),
|
||||
axis = ModelPartTransformation.X_AXIS,
|
||||
timeVariable = { _, _, ageInTicks -> ageInTicks / 20 },
|
||||
),
|
||||
rightLeg.rotation(
|
||||
function = parabolaFunction(
|
||||
tightness = -20F,
|
||||
phaseShift = 0F,
|
||||
verticalShift = (30F).toRadians()
|
||||
),
|
||||
axis = ModelPartTransformation.X_AXIS,
|
||||
timeVariable = { _, _, ageInTicks -> ageInTicks / 20 },
|
||||
),
|
||||
tail.rotation(
|
||||
function = sineFunction(
|
||||
amplitude = (-5F).toRadians(),
|
||||
period = 1F
|
||||
),
|
||||
axis = ModelPartTransformation.X_AXIS,
|
||||
timeVariable = { _, _, ageInTicks -> ageInTicks / 20 },
|
||||
),
|
||||
wingFlap(
|
||||
flapFunction = sineFunction(
|
||||
amplitude = (-5F).toRadians(),
|
||||
period = 0.4F,
|
||||
phaseShift = 0.00F,
|
||||
verticalShift = (-20F).toRadians()
|
||||
),
|
||||
timeVariable = { state, _, _ -> state.animationSeconds },
|
||||
axis = ModelPartTransformation.Z_AXIS
|
||||
),
|
||||
rightWing.translation(
|
||||
function = parabolaFunction(
|
||||
tightness = -10F,
|
||||
phaseShift = 30F,
|
||||
verticalShift = (25F).toRadians()
|
||||
),
|
||||
axis = ModelPartTransformation.Y_AXIS,
|
||||
timeVariable = { _, _, ageInTicks -> ageInTicks / 20 },
|
||||
),
|
||||
leftWing.translation(
|
||||
function = parabolaFunction(
|
||||
tightness = -10F,
|
||||
phaseShift = 30F,
|
||||
verticalShift = (25F).toRadians()
|
||||
),
|
||||
axis = ModelPartTransformation.Y_AXIS,
|
||||
timeVariable = { _, _, ageInTicks -> ageInTicks / 20 },
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
hovering = registerPose(
|
||||
poseName = "hovering",
|
||||
quirks = arrayOf(blink),
|
||||
poseTypes = setOf(PoseType.FLOAT, PoseType.HOVER),
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
WingFlapIdleAnimation(this,
|
||||
flapFunction = sineFunction(verticalShift = -10F.toRadians(), period = 0.9F, amplitude = 0.9F),
|
||||
timeVariable = { state, _, _ -> state.animationSeconds },
|
||||
axis = ModelPartTransformation.Z_AXIS
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
flying = registerPose(
|
||||
poseName = "flying",
|
||||
quirks = arrayOf(blink),
|
||||
poseTypes = setOf(PoseType.FLY, PoseType.SWIM),
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
WingFlapIdleAnimation(this,
|
||||
flapFunction = sineFunction(verticalShift = -14F.toRadians(), period = 0.9F, amplitude = 0.9F),
|
||||
timeVariable = { state, _, _ -> state.animationSeconds },
|
||||
axis = ModelPartTransformation.Z_AXIS
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
shoulderLeft = registerPose(
|
||||
poseType = PoseType.SHOULDER_LEFT,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("squawkabilly", "ground_idle")
|
||||
),
|
||||
transformedParts = arrayOf(
|
||||
rootPart.createTransformation().addPosition(shoulderOffsetX, shoulderOffsetY, 0.0)
|
||||
)
|
||||
)
|
||||
|
||||
shoulderRight = registerPose(
|
||||
poseType = PoseType.SHOULDER_RIGHT,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("squawkabilly", "ground_idle")
|
||||
),
|
||||
transformedParts = arrayOf(
|
||||
rootPart.createTransformation().addPosition(-shoulderOffsetX, shoulderOffsetY, 0.0)
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isNotPosedIn(sleep)) bedrockStateful("squawkabilly", "faint") else null
|
||||
}
|
||||
+56
-12
@@ -20,7 +20,9 @@ import com.cobblemon.mod.common.client.render.models.blockbench.*
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.bedrock.animation.BedrockAnimationRepository
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.blockentity.BlockEntityModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.fossil.FossilModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.PokeBallPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.AncientPokeBallModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.BeastBallModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.PokeBallModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1.*
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen2.*
|
||||
@@ -86,7 +88,7 @@ object VaryingModelRepository {
|
||||
"bedrock/fossils/posers" to FossilModel::class.java,
|
||||
"bedrock/block_entities/posers" to BlockEntityModel::class.java,
|
||||
"bedrock/npcs/posers" to PosableModel::class.java,
|
||||
"bedrock/poke_balls/posers" to PokeBallPosableModel::class.java,
|
||||
"bedrock/poke_balls/posers" to PosableModel::class.java,
|
||||
"bedrock/generic/posers" to PosableModel::class.java,
|
||||
)
|
||||
|
||||
@@ -114,7 +116,6 @@ object VaryingModelRepository {
|
||||
.registerTypeAdapter(ExpressionLike::class.java, ExpressionLikeAdapter)
|
||||
.registerTypeAdapter(PosableModel::class.java, JsonModelAdapter(::PosableModel))
|
||||
.registerTypeAdapter(PokemonPosableModel::class.java, JsonModelAdapter(::PokemonPosableModel))
|
||||
.registerTypeAdapter(PokeBallPosableModel::class.java, JsonModelAdapter(::PokeBallPosableModel))
|
||||
.registerTypeAdapter(FossilModel::class.java, JsonModelAdapter(::FossilModel))
|
||||
.registerTypeAdapter(BlockEntityModel::class.java, JsonModelAdapter(::BlockEntityModel))
|
||||
.registerTypeAdapter(Pose::class.java, PoseAdapter { JsonModelAdapter.model!! })
|
||||
@@ -154,8 +155,8 @@ object VaryingModelRepository {
|
||||
return {
|
||||
var boneName = jsonObject.getAsJsonPrimitive("rootBone")
|
||||
JsonModelAdapter.modelPart = if (boneName != null && it.children[boneName.asString] != null) it.children[boneName.asString] else it.children[fileName] ?: it.children.entries.filter { LocatorAccess.PREFIX !in it.key }.first().value
|
||||
gson.fromJson(jsonObject, poserClass).also { model ->
|
||||
model.poses.forEach { (poseName, pose) -> pose.poseName = poseName }
|
||||
gson.fromJson(jsonObject, poserClass).also {
|
||||
it.poses.forEach { (poseName, pose) -> pose.poseName = poseName }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,6 +169,55 @@ object VaryingModelRepository {
|
||||
}
|
||||
|
||||
fun registerInBuiltPosers() {
|
||||
inbuilt("azure_ball", ::PokeBallModel)
|
||||
inbuilt("beast_ball", ::BeastBallModel)
|
||||
inbuilt("cherish_ball", ::PokeBallModel)
|
||||
inbuilt("citrine_ball", ::PokeBallModel)
|
||||
inbuilt("dive_ball", ::PokeBallModel)
|
||||
inbuilt("dream_ball", ::PokeBallModel)
|
||||
inbuilt("dusk_ball", ::PokeBallModel)
|
||||
inbuilt("fast_ball", ::PokeBallModel)
|
||||
inbuilt("friend_ball", ::PokeBallModel)
|
||||
inbuilt("great_ball", ::PokeBallModel)
|
||||
inbuilt("heal_ball", ::PokeBallModel)
|
||||
inbuilt("heavy_ball", ::PokeBallModel)
|
||||
inbuilt("level_ball", ::PokeBallModel)
|
||||
inbuilt("love_ball", ::PokeBallModel)
|
||||
inbuilt("lure_ball", ::PokeBallModel)
|
||||
inbuilt("luxury_ball", ::PokeBallModel)
|
||||
inbuilt("master_ball", ::PokeBallModel)
|
||||
inbuilt("moon_ball", ::PokeBallModel)
|
||||
inbuilt("nest_ball", ::PokeBallModel)
|
||||
inbuilt("net_ball", ::PokeBallModel)
|
||||
inbuilt("park_ball", ::PokeBallModel)
|
||||
inbuilt("poke_ball", ::PokeBallModel)
|
||||
inbuilt("premier_ball", ::PokeBallModel)
|
||||
inbuilt("quick_ball", ::PokeBallModel)
|
||||
inbuilt("repeat_ball", ::PokeBallModel)
|
||||
inbuilt("roseate_ball", ::PokeBallModel)
|
||||
inbuilt("safari_ball", ::PokeBallModel)
|
||||
inbuilt("slate_ball", ::PokeBallModel)
|
||||
inbuilt("sport_ball", ::PokeBallModel)
|
||||
inbuilt("strange_ball", ::PokeBallModel)
|
||||
inbuilt("timer_ball", ::PokeBallModel)
|
||||
inbuilt("ultra_ball", ::PokeBallModel)
|
||||
inbuilt("verdant_ball", ::PokeBallModel)
|
||||
inbuilt("ancient_poke_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_citrine_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_verdant_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_azure_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_roseate_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_slate_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_ivory_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_great_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_ultra_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_feather_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_wing_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_jet_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_heavy_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_leaden_ball", ::AncientPokeBallModel)
|
||||
inbuilt("ancient_gigaton_ball", ::AncientPokeBallModel)
|
||||
|
||||
inbuilt("squirtle", ::SquirtleModel)
|
||||
inbuilt("wartortle", ::WartortleModel)
|
||||
inbuilt("metapod", ::MetapodModel)
|
||||
@@ -272,8 +322,6 @@ object VaryingModelRepository {
|
||||
inbuilt("loudred", :: LoudredModel)
|
||||
inbuilt("exploud", :: ExploudModel)
|
||||
inbuilt("cryogonal", :: CryogonalModel)
|
||||
inbuilt("pumpkaboo", :: PumpkabooModel)
|
||||
inbuilt("gourgeist", :: GourgeistModel)
|
||||
inbuilt("eiscue", :: EiscueModel)
|
||||
inbuilt("wooloo", :: WoolooModel)
|
||||
inbuilt("dubwool", :: DubwoolModel)
|
||||
@@ -290,9 +338,6 @@ object VaryingModelRepository {
|
||||
inbuilt("thwackey", ::ThwackeyModel)
|
||||
inbuilt("rillaboom", ::RillaboomModel)
|
||||
inbuilt("samurott", ::SamurottModel)
|
||||
inbuilt("snivy", ::SnivyModel)
|
||||
inbuilt("servine", ::ServineModel)
|
||||
inbuilt("serperior", ::SerperiorModel)
|
||||
inbuilt("slugma", ::SlugmaModel)
|
||||
inbuilt("magcargo", ::MagcargoModel)
|
||||
inbuilt("slugma_shiny", ::SlugmaShinyModel)
|
||||
@@ -352,7 +397,6 @@ object VaryingModelRepository {
|
||||
inbuilt("bunnelby", ::BunnelbyModel)
|
||||
inbuilt("arrokuda", ::ArrokudaModel)
|
||||
inbuilt("barraskewda", ::BarraskewdaModel)
|
||||
inbuilt("squawkabilly", ::SquawkabillyModel)
|
||||
inbuilt("ponyta_galarian", ::PonytaGalarianModel)
|
||||
inbuilt("rapidash_galarian", ::RapidashGalarianModel)
|
||||
inbuilt("volbeat", ::VolbeatModel)
|
||||
@@ -622,4 +666,4 @@ object VaryingModelRepository {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-9
@@ -12,7 +12,8 @@ import com.cobblemon.mod.common.api.reactive.Observable
|
||||
import com.cobblemon.mod.common.api.reactive.SettableObservable
|
||||
import com.cobblemon.mod.common.api.scheduling.Schedulable
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.PokeBallPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.AncientPokeBallModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.PokeBallModel
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
|
||||
import kotlin.random.Random
|
||||
|
||||
@@ -20,21 +21,18 @@ import kotlin.random.Random
|
||||
abstract class PokeBallPosableState : PosableState(), Schedulable {
|
||||
abstract val stateEmitter: SettableObservable<EmptyPokeBallEntity.CaptureState>
|
||||
abstract val shakeEmitter: Observable<Unit>
|
||||
|
||||
protected open val group: String
|
||||
get() = if (this.currentModel is AncientPokeBallModel) "ancient_poke_ball" else "poke_ball"
|
||||
protected open var lastKnownState: EmptyPokeBallEntity.CaptureState? = null
|
||||
|
||||
open fun initSubscriptions() {
|
||||
stateEmitter.subscribe { state ->
|
||||
|
||||
// if we fail to cast, provide default bone name.
|
||||
val group = (currentModel as? PokeBallPosableModel)?.rootBone ?: "poke_ball"
|
||||
|
||||
when (state) {
|
||||
EmptyPokeBallEntity.CaptureState.HIT -> {
|
||||
doLater {
|
||||
val model = this.currentModel!!
|
||||
after(seconds = 0.2F) {
|
||||
if (model is PokeBallPosableModel && stateEmitter.get() == EmptyPokeBallEntity.CaptureState.HIT) {
|
||||
if (model is PokeBallModel && stateEmitter.get() == EmptyPokeBallEntity.CaptureState.HIT) {
|
||||
doLater latest@{
|
||||
model.moveToPose(this, model.poses["open"]!!)
|
||||
after(seconds = 1.75F) {
|
||||
@@ -62,7 +60,7 @@ abstract class PokeBallPosableState : PosableState(), Schedulable {
|
||||
shakeEmitter
|
||||
.pipe(Observable.emitWhile { stateEmitter.get() == EmptyPokeBallEntity.CaptureState.SHAKE })
|
||||
.subscribe {
|
||||
val bob = "bob${Random.nextInt(6) + 1}"
|
||||
val bob = "bob${Random.Default.nextInt(6) + 1}"
|
||||
doLater { setActiveAnimations(currentModel!!.bedrockStateful(group, bob)) }
|
||||
}
|
||||
}
|
||||
@@ -81,4 +79,4 @@ abstract class PokeBallPosableState : PosableState(), Schedulable {
|
||||
this.lastKnownState = state
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -9,7 +9,7 @@
|
||||
package com.cobblemon.mod.common.client.render.pokeball
|
||||
|
||||
import com.cobblemon.mod.common.client.entity.EmptyPokeBallClientDelegate
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.PosablePokeBallEntityModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokeball.PosablePokeBallModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.client.renderer.texture.OverlayTexture
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
|
||||
class PokeBallRenderer(context: EntityRendererProvider.Context) : EntityRenderer<EmptyPokeBallEntity>(context) {
|
||||
val model = PosablePokeBallEntityModel()
|
||||
val model = PosablePokeBallModel()
|
||||
|
||||
override fun getTextureLocation(pEntity: EmptyPokeBallEntity): ResourceLocation {
|
||||
return VaryingModelRepository.getTexture(pEntity.pokeBall.name, pEntity.delegate as EmptyPokeBallClientDelegate)
|
||||
@@ -58,4 +58,4 @@ class PokeBallRenderer(context: EntityRendererProvider.Context) : EntityRenderer
|
||||
poseStack.popPose()
|
||||
super.render(entity, yaw, partialTicks, poseStack, buffer, packedLight)
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-12
@@ -13,7 +13,6 @@ import com.cobblemon.mod.common.OrientationControllable
|
||||
import com.cobblemon.mod.common.api.pokedex.PokedexEntryProgress
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.battle.ClientBallDisplay
|
||||
import com.cobblemon.mod.common.client.entity.EmptyPokeBallClientDelegate
|
||||
import com.cobblemon.mod.common.client.entity.NPCClientDelegate
|
||||
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
|
||||
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate.Companion.BEAM_EXTEND_TIME
|
||||
@@ -44,7 +43,6 @@ import com.cobblemon.mod.common.util.lang
|
||||
import com.cobblemon.mod.common.util.math.DoubleRange
|
||||
import com.cobblemon.mod.common.util.math.geometry.toRadians
|
||||
import com.cobblemon.mod.common.util.math.remap
|
||||
import com.cobblemon.mod.common.util.toRGBA
|
||||
import com.mojang.blaze3d.vertex.PoseStack
|
||||
import com.mojang.math.Axis
|
||||
import net.minecraft.ChatFormatting
|
||||
@@ -66,7 +64,6 @@ import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import org.joml.*
|
||||
import java.lang.Integer
|
||||
import kotlin.math.*
|
||||
|
||||
class PokemonRenderer(
|
||||
@@ -323,11 +320,6 @@ class PokemonRenderer(
|
||||
val pokemonPosition = entity.position().add(0.0, entity.bbHeight / 2.0 * clientDelegate.activeSendoutScale.toDouble(), 0.0)
|
||||
val recallBallOrigin = (beamTarget as? Player)?.let { RecallArmAnimationTracker.get(it.uuid)?.beamOrigin }
|
||||
|
||||
val beamColorVec4f = when(beamTarget) {
|
||||
is EmptyPokeBallEntity -> (beamTarget.delegate as EmptyPokeBallClientDelegate).getBeamColor()
|
||||
else -> entity.pokemon.caughtBall.beamColor.rgb.toRGBA()
|
||||
}
|
||||
|
||||
val beamSourcePosition = when {
|
||||
// cover the recall ball origin presence
|
||||
recallBallOrigin != null -> recallBallOrigin
|
||||
@@ -393,10 +385,10 @@ class PokemonRenderer(
|
||||
partialTicks = partialTicks,
|
||||
totalLevelTime = entity.level().gameTime,
|
||||
height = pokemonPosition.distanceTo(beamSourcePosition.add(offset)).toFloat() * ratio,
|
||||
red = beamColorVec4f.x,
|
||||
green = beamColorVec4f.y,
|
||||
blue = beamColorVec4f.z,
|
||||
alpha = beamColorVec4f.w,
|
||||
red = recallBeamColour.x,
|
||||
green = recallBeamColour.y,
|
||||
blue = recallBeamColour.z,
|
||||
alpha = recallBeamColour.w,
|
||||
beamRadius = 0.03F,
|
||||
glowRadius = 0.07F,
|
||||
glowAlpha = 0.4F
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.sound.instances
|
||||
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance
|
||||
import net.minecraft.client.resources.sounds.SoundInstance
|
||||
import net.minecraft.sounds.SoundEvent
|
||||
import net.minecraft.sounds.SoundSource
|
||||
|
||||
/**
|
||||
* Plays a sound for a Pokémon rendered in a GUI, where there is no entity to take the sound source from.
|
||||
* Unlike [SimpleSoundInstance.forUI] this uses [SoundSource.NEUTRAL] so the Friendly Creatures slider applies.
|
||||
*/
|
||||
class UIEntitySoundInstance(sound: SoundEvent, volume: Float = 1F, pitch: Float = 1F) :
|
||||
SimpleSoundInstance(sound.location, SoundSource.NEUTRAL, volume, pitch, SoundInstance.createUnseededRandom(),
|
||||
false, 0, SoundInstance.Attenuation.NONE, 0.0, 0.0, 0.0, true)
|
||||
+3
-3
@@ -30,7 +30,7 @@ object FishingRodTooltipGenerator : TooltipGenerator() {
|
||||
val baitComponent = stack.get(CobblemonItemComponents.BAIT)
|
||||
|
||||
// Add the description of the Poke Ball used in the rod
|
||||
ball.stack.item.description.let {
|
||||
ball.item.description.let {
|
||||
val bobberDescription = Component.translatable(
|
||||
"cobblemon.pokerod.bobber",
|
||||
it.copy().gray()
|
||||
@@ -40,7 +40,7 @@ object FishingRodTooltipGenerator : TooltipGenerator() {
|
||||
|
||||
val client = Minecraft.getInstance()
|
||||
val itemRegistry = client.level?.registryAccess()?.registryOrThrow(Registries.ITEM)
|
||||
itemRegistry?.let {
|
||||
itemRegistry?.let { registry ->
|
||||
baitComponent?.stack?.item?.description
|
||||
?.let { // maybe this can be simplified to not use the FishingBaits to get the stack and just use PokerodItem to get the stack since we have it already
|
||||
val baitDescription = "cobblemon.pokerod.bait".asTranslated(it.copy().gray(), PokerodItem.getBaitStackOnRod(stack).count)
|
||||
@@ -77,4 +77,4 @@ object FishingRodTooltipGenerator : TooltipGenerator() {
|
||||
|
||||
return resultLines
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,6 +164,9 @@ class CobblemonConfig {
|
||||
@CobblemonConfigField(Category.Pokemon, lang = "experience_multiplier", SERVER)
|
||||
var experienceMultiplier = 2F
|
||||
|
||||
@CobblemonConfigField(Category.Pokemon, lang = "predation_chance", SERVER)
|
||||
var predationChance = 0.05F
|
||||
|
||||
@CobblemonConfigField(Category.Spawning, lang = "pokemon_per_chunk", SERVER)
|
||||
var pokemonPerChunk = 1F
|
||||
|
||||
|
||||
+19
-40
@@ -8,7 +8,6 @@
|
||||
|
||||
package com.cobblemon.mod.common.entity.pokeball
|
||||
|
||||
import com.bedrockk.molang.runtime.MoLangRuntime
|
||||
import com.bedrockk.molang.runtime.struct.QueryStruct
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.bedrockk.molang.runtime.value.StringValue
|
||||
@@ -19,9 +18,7 @@ import com.cobblemon.mod.common.api.events.CobblemonEvents
|
||||
import com.cobblemon.mod.common.api.events.pokeball.PokeBallCaptureCalculatedEvent
|
||||
import com.cobblemon.mod.common.api.events.pokeball.ThrownPokeballHitEvent
|
||||
import com.cobblemon.mod.common.api.events.pokemon.PokemonCapturedEvent
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMoLangValue
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
|
||||
import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
|
||||
import com.cobblemon.mod.common.api.net.serializers.Vec3DataSerializer
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
@@ -52,16 +49,7 @@ import com.cobblemon.mod.common.net.messages.client.spawn.SpawnPokeballPacket
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.cobblemon.mod.common.pokemon.ai.PokemonBrain
|
||||
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
|
||||
import com.cobblemon.mod.common.util.asArrayValue
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.isServerSide
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import com.cobblemon.mod.common.util.party
|
||||
import com.cobblemon.mod.common.util.playSoundServer
|
||||
import com.cobblemon.mod.common.util.sendParticlesServer
|
||||
import com.cobblemon.mod.common.util.setPositionSafely
|
||||
import com.cobblemon.mod.common.util.update
|
||||
import com.cobblemon.mod.common.util.withQueryValue
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.mojang.blaze3d.vertex.PoseStack
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.core.particles.ParticleTypes
|
||||
@@ -77,10 +65,7 @@ import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.sounds.SoundEvents
|
||||
import net.minecraft.util.Mth
|
||||
import net.minecraft.util.Mth.PI
|
||||
import net.minecraft.world.entity.EntityDimensions
|
||||
import net.minecraft.world.entity.EntityType
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.entity.Pose
|
||||
import net.minecraft.world.entity.*
|
||||
import net.minecraft.world.entity.decoration.LeashFenceKnotEntity
|
||||
import net.minecraft.world.entity.projectile.ThrowableItemProjectile
|
||||
import net.minecraft.world.item.Item
|
||||
@@ -112,9 +97,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
const val SECONDS_BETWEEN_SHAKES = 1.25F
|
||||
const val SECONDS_BEFORE_SHAKE = 1F
|
||||
|
||||
val DIMENSIONS: EntityDimensions = EntityDimensions.fixed(0.4F, 0.4F)
|
||||
|
||||
val runtime = MoLangRuntime().setup()
|
||||
val DIMENSIONS = EntityDimensions.fixed(0.4F, 0.4F)
|
||||
}
|
||||
|
||||
val dataTrackerEmitter = SimpleObservable<EntityDataAccessor<*>>()
|
||||
@@ -142,7 +125,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
.addFunction("thrower") { owner?.asMostSpecificMoLangValue() ?: DoubleValue.ZERO }
|
||||
|
||||
override fun defineSynchedData(builder: SynchedEntityData.Builder) {
|
||||
pokeBall = PokeBalls.STRANGE_BALL
|
||||
pokeBall = PokeBalls.POKE_BALL
|
||||
super.defineSynchedData(builder)
|
||||
builder.define(CAPTURE_STATE, CaptureState.NOT.ordinal.toByte())
|
||||
builder.define(ASPECTS, emptySet())
|
||||
@@ -175,7 +158,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
addPosableFunctions(struct)
|
||||
}
|
||||
|
||||
constructor(world: Level) : this(pokeBall = PokeBalls.STRANGE_BALL, world = world)
|
||||
constructor(world: Level) : this(pokeBall = PokeBalls.POKE_BALL, world = world)
|
||||
constructor(
|
||||
pokeBall: PokeBall,
|
||||
world: Level,
|
||||
@@ -193,7 +176,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
this.pokeBall = pokeBall
|
||||
}
|
||||
|
||||
var pokeBall: PokeBall = PokeBalls.STRANGE_BALL
|
||||
var pokeBall: PokeBall = PokeBalls.POKE_BALL
|
||||
|
||||
override fun onHitBlock(hitResult: BlockHitResult) {
|
||||
if (captureState == CaptureState.NOT) {
|
||||
@@ -204,7 +187,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
discard()
|
||||
val player = this.owner as? ServerPlayer
|
||||
if (player?.isCreative == false) {
|
||||
spawnAtLocation(pokeBall.stack())
|
||||
spawnAtLocation(defaultItem)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -262,7 +245,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
lang(
|
||||
"capture.attempted_capture",
|
||||
throwerActor.getName(),
|
||||
pokeBall.item().getDescriptionId(pokeBall.stack),
|
||||
pokeBall.item().description,
|
||||
pokemonEntity.exposedSpecies.translatedName
|
||||
).yellow()
|
||||
)
|
||||
@@ -286,6 +269,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
attemptCatch(pokemonEntity)
|
||||
},
|
||||
ifCanceled = {
|
||||
captureFuture.complete(false)
|
||||
drop()
|
||||
return
|
||||
}
|
||||
@@ -300,7 +284,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
val owner = owner
|
||||
discard()
|
||||
val player = owner?.takeIf { it is ServerPlayer } as? ServerPlayer
|
||||
if (player?.isCreative != true) spawnAtLocation(pokeBall.stack())
|
||||
if (player?.isCreative != true) spawnAtLocation(defaultItem)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -312,7 +296,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
delegate.tick(this)
|
||||
|
||||
if (level().isServerSide()) {
|
||||
|
||||
|
||||
|
||||
if (this.tickCount > 600 && this.capturingPokemon == null) {
|
||||
this.remove(RemovalReason.DISCARDED)
|
||||
@@ -362,8 +346,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
// Do a capture
|
||||
val pokemon = capturingPokemon ?: return
|
||||
val player = this.owner as? ServerPlayer ?: return
|
||||
|
||||
val captureTime = if (pokeBall.ancient) 1.8F else 1F
|
||||
val captureTime = if (pokeBall.ancient == true) 1.8F else 1F
|
||||
after(seconds = captureTime) {
|
||||
// Dupes occurred by double-adding Pokémon, this hopefully prevents it triple-condom style
|
||||
// wtf did I just read above me
|
||||
@@ -372,13 +355,8 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
discard()
|
||||
captureFuture.complete(true)
|
||||
val party = player.party()
|
||||
|
||||
val effectsRuntime = runtime
|
||||
.withQueryValue("pokeball", struct)
|
||||
.withQueryValue("pokemon", pokemon.asMoLangValue())
|
||||
|
||||
pokemon.pokemon.caughtBall = pokeBall
|
||||
pokeBall.effects.forEach { effect -> effect.resolve(effectsRuntime) }
|
||||
pokeBall.effects.forEach { effect -> effect.apply(player, pokemon.pokemon) }
|
||||
party.add(pokemon.pokemon)
|
||||
val leashHolder = pokemon.leashHolder
|
||||
|
||||
@@ -402,7 +380,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
}
|
||||
// Emits a shake by changing the value to the opposite of what it currently is. Sends an update to the client basically.
|
||||
// We could replace this with a packet, but it feels awfully excessive when we already have 5 bajillion packets.
|
||||
if (pokeBall.ancient) {
|
||||
if (this.pokeBall.ancient) {
|
||||
when (captureResult.numberOfShakes) {
|
||||
1 -> ancientBallShake(setOf("q.bedrock_stateful('ancient_poke_ball', 'weirdhop')"))
|
||||
2 -> ancientBallShake(setOf("q.bedrock_stateful('ancient_poke_ball', 'bighop')"))
|
||||
@@ -417,7 +395,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
private fun breakFree() {
|
||||
val pokemon = capturingPokemon ?: return
|
||||
pokemon.setPositionSafely(position())
|
||||
|
||||
|
||||
pokemon.beamMode = 2
|
||||
pokemon.isInvisible = false
|
||||
pokemon.isSilent = false
|
||||
@@ -447,7 +425,8 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
|
||||
after(seconds = 0.1F) {
|
||||
captureFuture.complete(false)
|
||||
val ballType = pokeBall.name.path.lowercase().replace("_", "")
|
||||
val ballType =
|
||||
this.pokeBall.name.path.lowercase().replace("_", "")
|
||||
val mode = "casual"
|
||||
val sendflash =
|
||||
BedrockParticleOptionsRepository.getEffect(cobblemonResource("${ballType}/${mode}/sendflash"))
|
||||
@@ -464,7 +443,7 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
|
||||
override fun getDefaultItem(): Item = pokeBall.item()
|
||||
|
||||
override fun getDimensions(pPose: Pose): EntityDimensions = DIMENSIONS
|
||||
override fun getDimensions(pPose: Pose) = DIMENSIONS
|
||||
|
||||
private fun attemptCatch(pokemonEntity: PokemonEntity) {
|
||||
pokemonEntity.busyLocks.add(this)
|
||||
@@ -572,4 +551,4 @@ class EmptyPokeBallEntity : ThrowableItemProjectile, PosableEntity, WaterDragMod
|
||||
|
||||
override fun waterDrag(): Float = this.pokeBall.waterDragValue
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1294,16 +1294,7 @@ open class PokemonEntity(
|
||||
}
|
||||
|
||||
private fun showInteractionWheel(player: ServerPlayer, itemStack: ItemStack) {
|
||||
val canRide = ifRidingAvailableSupply(false) { behaviour, settings, state ->
|
||||
if (platform != PlatformType.NONE) return@ifRidingAvailableSupply false
|
||||
if (tethering != null) return@ifRidingAvailableSupply false;
|
||||
if (seats.isEmpty()) return@ifRidingAvailableSupply false;
|
||||
if ((owner as? ServerPlayer)?.isInBattle() == true) return@ifRidingAvailableSupply false;
|
||||
if (this.owner != player && this.passengers.isEmpty()) return@ifRidingAvailableSupply false;
|
||||
if(pokemon.effectiveScale < Cobblemon.config.minimumRidingScale) return@ifRidingAvailableSupply false;
|
||||
if(beamMode == 3) return@ifRidingAvailableSupply false;
|
||||
return@ifRidingAvailableSupply behaviour.isActive(settings, state, this);
|
||||
}
|
||||
val canRide = isRideableFor(player)
|
||||
if (pokemon.getOwnerPlayer() == player) {
|
||||
val cosmeticItemDefinition = CobblemonCosmeticItems.findValidCosmeticForPokemonAndItem(
|
||||
player.level().registryAccess(),
|
||||
@@ -1325,6 +1316,18 @@ open class PokemonEntity(
|
||||
}
|
||||
}
|
||||
|
||||
fun isRideableFor(player: ServerPlayer): Boolean = ifRidingAvailableSupply(false) canRide@{ behaviour, settings, state ->
|
||||
if (!player.canInteractWithEntity(this, player.entityInteractionRange())) return@canRide false
|
||||
if (platform != PlatformType.NONE) return@canRide false
|
||||
if (tethering != null) return@canRide false
|
||||
if (seats.isEmpty()) return@canRide false
|
||||
if ((owner as? ServerPlayer)?.isInBattle() == true) return@canRide false
|
||||
if (this.owner != player && this.passengers.isEmpty()) return@canRide false
|
||||
if (pokemon.effectiveScale < Cobblemon.config.minimumRidingScale) return@canRide false
|
||||
if (beamMode == 3) return@canRide false
|
||||
return@canRide behaviour.isActive(settings, state, this)
|
||||
}
|
||||
|
||||
override fun getDimensions(pose: Pose): EntityDimensions {
|
||||
val scale = effects.mockEffect?.scale ?: (form.baseScale * pokemon.effectiveScale)
|
||||
var result = this.exposedForm.hitbox.scale(scale)
|
||||
@@ -1606,9 +1609,8 @@ open class PokemonEntity(
|
||||
|| stack.`is`(CobblemonItemTags.WHITELISTED_ITEMS_TO_HOLD)
|
||||
|
||||
fun tryRidingPokemon(player: ServerPlayer): Boolean {
|
||||
if (pokemon.effectiveScale < Cobblemon.config.minimumRidingScale) {
|
||||
return false
|
||||
}
|
||||
if (!isRideableFor(player)) return false
|
||||
|
||||
val event = RidePokemonEvent.Pre(player, this)
|
||||
CobblemonEvents.RIDE_EVENT_PRE.post(event)
|
||||
if (!event.isCanceled) {
|
||||
|
||||
@@ -8,31 +8,42 @@
|
||||
|
||||
package com.cobblemon.mod.common.item
|
||||
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
|
||||
import com.cobblemon.mod.common.item.components.PokeBallComponent
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.cobblemon.mod.common.util.isServerSide
|
||||
import com.cobblemon.mod.common.util.math.geometry.toRadians
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.InteractionHand
|
||||
import net.minecraft.world.InteractionResultHolder
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.Rarity
|
||||
import net.minecraft.world.level.Level
|
||||
import kotlin.math.cos
|
||||
|
||||
class PokeBallItem(val pokeBall: PokeBall) : CobblemonItem(pokeBall.itemProperties()) {
|
||||
class PokeBallItem(
|
||||
val pokeBall: PokeBall
|
||||
) : CobblemonItem(Properties().apply {
|
||||
when (pokeBall.name) {
|
||||
// Master balls are a netherite product and should be fire immune
|
||||
PokeBalls.MASTER_BALL.name -> fireResistant().rarity(Rarity.EPIC)
|
||||
PokeBalls.CHERISH_BALL.name -> rarity(Rarity.EPIC)
|
||||
PokeBalls.ANCIENT_ORIGIN_BALL.name -> rarity(Rarity.EPIC)
|
||||
PokeBalls.BEAST_BALL.name -> rarity(Rarity.RARE)
|
||||
}
|
||||
}) {
|
||||
|
||||
override fun use(world: Level, player: Player, usedHand: InteractionHand): InteractionResultHolder<ItemStack> {
|
||||
val itemStack = player.getItemInHand(usedHand)
|
||||
if (world.isServerSide()) {
|
||||
throwPokeBall(world, player as ServerPlayer, PokeBallComponent.getPokeBall(itemStack))
|
||||
throwPokeBall(world, player as ServerPlayer)
|
||||
}
|
||||
itemStack.consume(1, player)
|
||||
return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide)
|
||||
}
|
||||
|
||||
private fun throwPokeBall(world: Level, player: ServerPlayer, pokeBall: PokeBall) {
|
||||
private fun throwPokeBall(world: Level, player: ServerPlayer) {
|
||||
val pokeBallEntity = EmptyPokeBallEntity(pokeBall, player.level(), player).apply {
|
||||
val overhandFactor: Float = if (player.xRot < 0) {
|
||||
5f * cos(player.xRot.toRadians())
|
||||
@@ -46,7 +57,4 @@ class PokeBallItem(val pokeBall: PokeBall) : CobblemonItem(pokeBall.itemProperti
|
||||
}
|
||||
world.addFreshEntity(pokeBallEntity)
|
||||
}
|
||||
|
||||
override fun getDescriptionId(itemStack: ItemStack): String =
|
||||
PokeBallComponent.getPokeBall(itemStack).name.toLanguageKey("item")
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.item.components
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonItemComponents
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
import com.cobblemon.mod.common.item.PokeBallItem
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.mojang.serialization.Codec
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder
|
||||
import io.netty.buffer.ByteBuf
|
||||
import net.minecraft.network.codec.ByteBufCodecs
|
||||
import net.minecraft.network.codec.StreamCodec
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.world.item.ItemStack
|
||||
|
||||
data class PokeBallComponent(val name: ResourceLocation) {
|
||||
companion object {
|
||||
val CODEC: Codec<PokeBallComponent> = RecordCodecBuilder.create {
|
||||
it
|
||||
.group(ResourceLocation.CODEC.fieldOf("type").forGetter(PokeBallComponent::name))
|
||||
.apply(it, ::PokeBallComponent)
|
||||
}
|
||||
|
||||
val PACKET_CODEC: StreamCodec<ByteBuf, PokeBallComponent> = ByteBufCodecs.fromCodec(CODEC)
|
||||
|
||||
@JvmStatic
|
||||
fun getPokeBall(stack: ItemStack): PokeBall {
|
||||
return stack.get(CobblemonItemComponents.POKE_BALL)?.name?.let(PokeBalls::getPokeBall)
|
||||
?: (stack.item as? PokeBallItem)?.pokeBall
|
||||
?: PokeBalls.STRANGE_BALL
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setPokeBall(stack: ItemStack, ball: PokeBall): ItemStack {
|
||||
stack.set(CobblemonItemComponents.POKE_BALL, PokeBallComponent(ball.name))
|
||||
return stack
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun createStack(ball: PokeBall?): ItemStack {
|
||||
var result = PokeBalls.STRANGE_BALL
|
||||
if (ball == null) {
|
||||
Cobblemon.LOGGER.error("Attempted to create poke ball stack with null config, falling to strange ball.")
|
||||
} else {
|
||||
result = ball
|
||||
}
|
||||
val stack = ItemStack(CobblemonItems.STRANGE_BALL)
|
||||
return setPokeBall(stack, result)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val ball: PokeBall
|
||||
get() = PokeBalls.getPokeBall(name)
|
||||
}
|
||||
@@ -11,12 +11,10 @@ package com.cobblemon.mod.common.item.group
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonItemComponents
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
import com.cobblemon.mod.common.api.riding.stats.RidingStat
|
||||
import com.cobblemon.mod.common.api.tms.TechnicalMachines
|
||||
import com.cobblemon.mod.common.block.TypeGemClusterBlock
|
||||
import com.cobblemon.mod.common.item.AprijuiceItem
|
||||
import com.cobblemon.mod.common.item.components.PokeBallComponent
|
||||
import com.cobblemon.mod.common.item.components.RideBoostsComponent
|
||||
import com.cobblemon.mod.common.item.components.TMMoveComponent
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
@@ -945,11 +943,6 @@ object CobblemonItemGroups {
|
||||
|
||||
private fun utilityItemEntries(displayContext: ItemDisplayParameters, entries: Output) {
|
||||
CobblemonItems.pokeBalls.forEach(entries::accept)
|
||||
|
||||
PokeBalls.custom
|
||||
.filter { (_, value) -> CobblemonItems.pokeBalls.none { it.pokeBall.name == value.name } }
|
||||
.forEach { entries.accept(PokeBallComponent.createStack(it.value)) }
|
||||
|
||||
CobblemonItems.pokeRods.forEach(entries::accept)
|
||||
CobblemonItems.pokedexes.forEach(entries::accept)
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ class CaughtBallUpdatePacket(pokemon: () -> Pokemon?, value: PokeBall): SingleUp
|
||||
val ID = cobblemonResource("caught_ball_update")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): CaughtBallUpdatePacket {
|
||||
val pokemon = decodePokemon(buffer)
|
||||
val pokeBall = PokeBalls.getPokeBall(buffer.readIdentifier())
|
||||
val pokeBall = PokeBalls.getPokeBall(buffer.readIdentifier()) ?: PokeBalls.POKE_BALL
|
||||
return CaughtBallUpdatePacket(pokemon, pokeBall)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,8 @@ object PlatformEvents {
|
||||
@JvmField
|
||||
val CLIENT_PLAYER_LOGOUT = EventObservable<ClientPlayerEvent.Logout>()
|
||||
@JvmField
|
||||
val PLAYER_RESPAWN = EventObservable<ServerPlayerEvent.Respawn>()
|
||||
@JvmField
|
||||
val PLAYER_DEATH = CancelableObservable<ServerPlayerEvent.Death>()
|
||||
@JvmField
|
||||
val RIGHT_CLICK_BLOCK = CancelableObservable<ServerPlayerEvent.RightClickBlock>()
|
||||
|
||||
@@ -50,6 +50,11 @@ interface ServerPlayerEvent {
|
||||
*/
|
||||
data class Logout(override val player: ServerPlayer) : ServerPlayerEvent
|
||||
|
||||
/**
|
||||
* Fired when the [player] respawns (either by coming back from the end or dying).
|
||||
*/
|
||||
data class Respawn(override val player: ServerPlayer) : ServerPlayerEvent
|
||||
|
||||
/**
|
||||
* Fired when the [player] dies.
|
||||
* If canceled the death will be prevented but healing is required in order to not be stuck in a loop.
|
||||
|
||||
@@ -8,22 +8,18 @@
|
||||
|
||||
package com.cobblemon.mod.common.pokeball
|
||||
|
||||
import com.cobblemon.mod.common.api.molang.ExpressionLike
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addPokeBallFunctions
|
||||
import com.cobblemon.mod.common.api.molang.ObjectValue
|
||||
import com.bedrockk.molang.runtime.struct.QueryStruct
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.bedrockk.molang.runtime.value.StringValue
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CaptureEffect
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
|
||||
import com.cobblemon.mod.common.item.PokeBallItem
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.codec.CodecUtils
|
||||
import com.mojang.serialization.Codec
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.world.item.Item
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.Rarity
|
||||
import java.awt.Color
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
|
||||
/**
|
||||
* Base poke ball object
|
||||
@@ -35,51 +31,37 @@ import java.awt.Color
|
||||
* @property waterDragValue The value of the water drag modifier when the entity travels, default is 0.8.
|
||||
* @property model2d The identifier for the resource this Pokéball will use for the 2d model.
|
||||
* @property model3d The identifier for the resource this Pokéball will use for the 3d model.
|
||||
* @property ancient Marks this Pokéball as ancient, which makes it play different animations on catch hops
|
||||
* @property beamColor Defines the beam color of pokeball
|
||||
*/
|
||||
class PokeBall(
|
||||
@Transient // Assigns in PokeBalls.reload
|
||||
var name: ResourceLocation = cobblemonResource("strange_ball"),
|
||||
open class PokeBall(
|
||||
val name: ResourceLocation,
|
||||
val catchRateModifier: CatchRateModifier = CatchRateModifier.DUMMY,
|
||||
val effects: List<ExpressionLike> = listOf(),
|
||||
val itemProperties: PokeBallProperties = PokeBallProperties(),
|
||||
val effects: List<CaptureEffect> = listOf(),
|
||||
val waterDragValue: Float,
|
||||
val model2d: ResourceLocation,
|
||||
val model3d: ResourceLocation,
|
||||
val throwPower: Float,
|
||||
val ancient: Boolean = false,
|
||||
val beamColor: Color
|
||||
val ancient: Boolean
|
||||
) {
|
||||
@Transient
|
||||
val struct = ObjectValue(this)
|
||||
.addPokeBallFunctions(this)
|
||||
val struct = QueryStruct(hashMapOf())
|
||||
.addFunction("name") { StringValue(name.toString()) }
|
||||
.addFunction("water_drag_value") { DoubleValue(waterDragValue) }
|
||||
.addFunction("throw_power") { DoubleValue(throwPower) }
|
||||
.addFunction("is_ancient") { DoubleValue(ancient) }
|
||||
// .addFunction("item") { } // requires a registry which is hard
|
||||
|
||||
// This gets attached during item registry
|
||||
@Transient
|
||||
internal lateinit var stack: ItemStack
|
||||
internal lateinit var item: PokeBallItem
|
||||
|
||||
fun item(): PokeBallItem = this.stack.item as PokeBallItem
|
||||
fun item(): PokeBallItem = this.item
|
||||
|
||||
fun stack(count: Int = 1): ItemStack =
|
||||
ItemStack(this.item(), count)
|
||||
|
||||
fun itemProperties(): Item.Properties {
|
||||
var properties = Item.Properties().rarity(this.itemProperties.rarity)
|
||||
|
||||
if (this.itemProperties.fireResistant) {
|
||||
properties = properties.fireResistant()
|
||||
}
|
||||
|
||||
return properties
|
||||
}
|
||||
|
||||
@Deprecated("This is a temporary solution for the safari ball dilemma", ReplaceWith("target.currentHealth"))
|
||||
internal fun hpForCalculation(target: Pokemon): Int =
|
||||
if (this.name == PokeBalls.SAFARI_BALL.name) target.maxHealth else target.currentHealth
|
||||
internal fun hpForCalculation(target: Pokemon): Int = if (this.name == PokeBalls.SAFARI_BALL.name) target.maxHealth else target.currentHealth
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
val BY_IDENTIFIER_CODEC: Codec<PokeBall> = CodecUtils.createByIdentifierCodec(
|
||||
PokeBalls::getPokeBall,
|
||||
@@ -88,8 +70,4 @@ class PokeBall(
|
||||
|
||||
}
|
||||
|
||||
data class PokeBallProperties(
|
||||
val fireResistant: Boolean = false,
|
||||
val rarity: Rarity = Rarity.COMMON
|
||||
)
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -46,7 +46,7 @@ object Gen1CaptureCalculator : CaptureCalculator {
|
||||
}
|
||||
// This value can be reused when calculating the shakes in case of breakout.
|
||||
val nBound = when (pokeBall) {
|
||||
PokeBalls.POKE_BALL, PokeBalls.STRANGE_BALL -> 255
|
||||
PokeBalls.POKE_BALL -> 255
|
||||
PokeBalls.GREAT_BALL -> 200
|
||||
else -> 150
|
||||
}
|
||||
@@ -97,4 +97,4 @@ object Gen1CaptureCalculator : CaptureCalculator {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -642,16 +642,7 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
scaleModifier = 1F + (roundedPercent / 100F)
|
||||
}
|
||||
|
||||
var caughtBall: PokeBall = PokeBalls.STRANGE_BALL
|
||||
get() {
|
||||
return try {
|
||||
field
|
||||
} catch (_: Exception) {
|
||||
// account for possibility of ball removal (datapack disable/removal)
|
||||
CaughtBallUpdatePacket({ this }, PokeBalls.STRANGE_BALL)
|
||||
PokeBalls.STRANGE_BALL
|
||||
}
|
||||
}
|
||||
var caughtBall: PokeBall = PokeBalls.POKE_BALL
|
||||
set(value) {
|
||||
field = value
|
||||
onChange(CaughtBallUpdatePacket({ this }, field))
|
||||
|
||||
+12
-6
@@ -13,6 +13,7 @@ import com.cobblemon.mod.common.api.abilities.Abilities
|
||||
import com.cobblemon.mod.common.api.data.DataRegistry
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
import com.cobblemon.mod.common.api.pokemon.Natures
|
||||
import com.cobblemon.mod.common.api.pokemon.feature.AbstractChoiceSpeciesFeatureProvider
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.Stats
|
||||
import com.cobblemon.mod.common.api.pokemon.status.Statuses
|
||||
import com.cobblemon.mod.common.api.properties.CustomPokemonProperty
|
||||
@@ -134,17 +135,18 @@ internal object PropertiesCompletionProvider : DataRegistry {
|
||||
private fun addDefaults() {
|
||||
this.inject(setOf("level", "lvl", "l"), setOf("1", "${Cobblemon.config.maxPokemonLevel}") )
|
||||
this.inject(setOf("shiny", "s"), setOf("yes", "no"))
|
||||
this.inject(setOf("gender"), Gender.values().map { it.name.lowercase() })
|
||||
this.inject(setOf("alpha", "is_alpha"), setOf("yes", "no"))
|
||||
this.inject(setOf("gender"), Gender.entries.map { it.name.lowercase() })
|
||||
this.inject(setOf("friendship"), setOf("0", Cobblemon.config.maxPokemonFriendship.toString()))
|
||||
this.inject(setOf("fullness"), setOf("0", "255"))
|
||||
this.inject(setOf("pokeball"), PokeBalls.all().map { it.name.simplify() })
|
||||
this.inject(setOf("nature"), Natures.all().map { it.name.simplify() })
|
||||
this.inject(setOf("ability"), Abilities.all().map { if (it.name.asIdentifierDefaultingNamespace().namespace == Cobblemon.MODID) it.name.asIdentifierDefaultingNamespace().path else it.name })
|
||||
this.inject(setOf("dmax"), setOf("0", Cobblemon.config.maxDynamaxLevel.toString()))
|
||||
this.inject(setOf("gmax"), setOf("yes", "no"))
|
||||
this.inject(setOf("dmax_level", "dmax"), setOf("0", Cobblemon.config.maxDynamaxLevel.toString()))
|
||||
this.inject(setOf("gmax_factor", "gmax"), setOf("yes", "no"))
|
||||
this.inject(setOf("type", "elemental_type"), ElementalTypes.all().map { it.name })
|
||||
this.inject(setOf("tera_type", "tera"), TeraTypes.map { it.id.simplify() })
|
||||
this.inject(setOf("tradeable"), setOf("yes", "no"))
|
||||
this.inject(setOf("tradeable", "tradable"), setOf("yes", "no"))
|
||||
this.inject(setOf("originaltrainer", "ot"), setOf(""))
|
||||
this.inject(setOf("originaltrainertype", "ottype"), setOf("None", "Player", "NPC"))
|
||||
this.inject(setOf("nickname", "nick"), setOf(""))
|
||||
@@ -164,7 +166,11 @@ internal object PropertiesCompletionProvider : DataRegistry {
|
||||
private fun addCustom() {
|
||||
CustomPokemonProperty.properties.forEach { property ->
|
||||
// We won't tab complete properties that have no key attached to them as it would be fairly hard to determine which one to suggest
|
||||
if (property.needsKey) {
|
||||
if (property.needsKey && property !is AbstractChoiceSpeciesFeatureProvider<*>) {
|
||||
this.inject(property.keys, property.examples())
|
||||
}
|
||||
// Except choice features that fill examples with all available choices - Gito
|
||||
if (property is AbstractChoiceSpeciesFeatureProvider<*>) {
|
||||
this.inject(property.keys, property.examples())
|
||||
}
|
||||
}
|
||||
@@ -175,4 +181,4 @@ internal object PropertiesCompletionProvider : DataRegistry {
|
||||
val suggestions: Collection<String>
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-87
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.util.adapters
|
||||
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CaptureEffect
|
||||
import com.cobblemon.mod.common.util.readString
|
||||
import com.cobblemon.mod.common.util.writeString
|
||||
import com.google.common.collect.HashBiMap
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.google.gson.JsonDeserializationContext
|
||||
import com.google.gson.JsonDeserializer
|
||||
import com.google.gson.JsonElement
|
||||
import com.google.gson.JsonSerializationContext
|
||||
import com.google.gson.JsonSerializer
|
||||
import net.minecraft.network.FriendlyByteBuf
|
||||
import java.lang.reflect.Type
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
object CobblemonCaptureEffectAdapter : JsonDeserializer<CaptureEffect>, JsonSerializer<CaptureEffect> {
|
||||
private const val VARIANT = "variant"
|
||||
|
||||
private val types = HashBiMap.create<String, KClass<out CaptureEffect>>()
|
||||
|
||||
val gson: Gson by lazy {
|
||||
GsonBuilder()
|
||||
.registerTypeAdapter(CaptureEffect::class.java, CobblemonCaptureEffectAdapter)
|
||||
.setPrettyPrinting()
|
||||
.create()
|
||||
}
|
||||
|
||||
fun <T : CaptureEffect> registerType(id: String, type: KClass<T>) {
|
||||
this.types[id.lowercase()] = type
|
||||
}
|
||||
|
||||
override fun deserialize(
|
||||
json: JsonElement,
|
||||
typeOfT: Type,
|
||||
context: JsonDeserializationContext,
|
||||
): CaptureEffect {
|
||||
val variant =
|
||||
json.asJsonObject
|
||||
.get(VARIANT)
|
||||
.asString
|
||||
.lowercase()
|
||||
val type = getModifierType(variant)
|
||||
return context.deserialize(json, type.java)
|
||||
}
|
||||
|
||||
override fun serialize(
|
||||
effect: CaptureEffect,
|
||||
typeOfSrc: Type,
|
||||
context: JsonSerializationContext,
|
||||
): JsonElement {
|
||||
val json = context.serialize(effect, effect::class.java).asJsonObject
|
||||
val variant = getVariant(effect)
|
||||
json.addProperty(VARIANT, variant)
|
||||
return json
|
||||
}
|
||||
|
||||
fun encode(effect: CaptureEffect, buffer: FriendlyByteBuf) {
|
||||
buffer.writeString(gson.toJson(effect, CaptureEffect::class.java))
|
||||
}
|
||||
|
||||
fun decode(buffer: FriendlyByteBuf): CaptureEffect = gson.fromJson(buffer.readString(), CaptureEffect::class.java)
|
||||
|
||||
private fun getVariant(effect: CaptureEffect): String {
|
||||
val variant =
|
||||
this.types.inverse()[effect::class]
|
||||
?: throw IllegalArgumentException("Cannot resolve pokeball capture effect for type ${effect::class.qualifiedName}")
|
||||
|
||||
return variant
|
||||
}
|
||||
|
||||
private fun getModifierType(variant: String): KClass<out CaptureEffect> {
|
||||
val effectType =
|
||||
this.types[variant] ?: throw IllegalArgumentException("Cannot resolve pokeball capture effect type for variant $variant")
|
||||
|
||||
return effectType
|
||||
}
|
||||
}
|
||||
-113
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.util.adapters
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.cobblemon.mod.common.api.molang.ExpressionLike
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.BaseStatModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.CatchRateModifierAdapter
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.GuaranteedModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.LabelModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.ExpressionModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.PropertyBasedModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.ScriptModifier
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.modifiers.SimpleModifier
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
|
||||
import com.cobblemon.mod.common.util.readString
|
||||
import com.cobblemon.mod.common.util.writeString
|
||||
import com.google.common.collect.HashBiMap
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.google.gson.JsonDeserializationContext
|
||||
import com.google.gson.JsonElement
|
||||
import com.google.gson.JsonSerializationContext
|
||||
import net.minecraft.network.FriendlyByteBuf
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import java.lang.reflect.Type
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
object CobblemonCatchRateModifierAdapter : CatchRateModifierAdapter {
|
||||
private const val VARIANT = "variant"
|
||||
|
||||
private val types = HashBiMap.create<String, KClass<out CatchRateModifier>>()
|
||||
|
||||
init {
|
||||
this.registerType(SimpleModifier.VARIANT, SimpleModifier::class)
|
||||
this.registerType(BaseStatModifier.VARIANT, BaseStatModifier::class)
|
||||
this.registerType(GuaranteedModifier.VARIANT, GuaranteedModifier::class)
|
||||
this.registerType(PropertyBasedModifier.VARIANT, PropertyBasedModifier::class)
|
||||
this.registerType(LabelModifier.VARIANT, LabelModifier::class)
|
||||
this.registerType(ExpressionModifier.VARIANT, ExpressionModifier::class)
|
||||
this.registerType(ScriptModifier.VARIANT, ScriptModifier::class)
|
||||
}
|
||||
|
||||
val gson: Gson by lazy {
|
||||
GsonBuilder()
|
||||
.registerTypeAdapter(ResourceLocation::class.java, IdentifierAdapter)
|
||||
.registerTypeAdapter(Expression::class.java, ExpressionAdapter)
|
||||
.registerTypeAdapter(ExpressionLike::class.java, ExpressionLikeAdapter)
|
||||
.registerTypeAdapter(PokemonProperties::class.java, pokemonPropertiesShortAdapter)
|
||||
.registerTypeAdapter(CatchRateModifier::class.java, CobblemonCatchRateModifierAdapter)
|
||||
.setPrettyPrinting()
|
||||
.create()
|
||||
}
|
||||
|
||||
override fun <T : CatchRateModifier> registerType(id: String, type: KClass<T>) {
|
||||
this.types[id.lowercase()] = type
|
||||
}
|
||||
|
||||
override fun deserialize(
|
||||
json: JsonElement,
|
||||
typeOfT: Type,
|
||||
context: JsonDeserializationContext,
|
||||
): CatchRateModifier {
|
||||
val variant =
|
||||
json.asJsonObject
|
||||
.get(VARIANT)
|
||||
.asString
|
||||
.lowercase()
|
||||
val type = getModifierType(variant)
|
||||
return context.deserialize(json, type.java)
|
||||
}
|
||||
|
||||
override fun serialize(
|
||||
modifier: CatchRateModifier,
|
||||
typeOfSrc: Type,
|
||||
context: JsonSerializationContext,
|
||||
): JsonElement {
|
||||
val json = context.serialize(modifier, modifier::class.java).asJsonObject
|
||||
val variant = getVariant(modifier)
|
||||
json.addProperty(VARIANT, variant)
|
||||
return json
|
||||
}
|
||||
|
||||
fun encode(modifier: CatchRateModifier, buffer: FriendlyByteBuf) {
|
||||
buffer.writeString(gson.toJson(modifier, CatchRateModifier::class.java))
|
||||
}
|
||||
|
||||
fun decode(buffer: FriendlyByteBuf): CatchRateModifier =
|
||||
gson.fromJson(buffer.readString(), CatchRateModifier::class.java)
|
||||
|
||||
private fun getVariant(modifier: CatchRateModifier): String {
|
||||
val variant =
|
||||
this.types.inverse()[modifier::class]
|
||||
?: throw IllegalArgumentException("Cannot resolve pokeball catchrate modifier for type ${modifier::class.qualifiedName}")
|
||||
|
||||
return variant
|
||||
}
|
||||
|
||||
private fun getModifierType(variant: String): KClass<out CatchRateModifier> {
|
||||
val requirementType =
|
||||
this.types[variant]
|
||||
?: throw IllegalArgumentException("Cannot resolve pokeball catchrate modifier type for variant $variant")
|
||||
|
||||
return requirementType
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -26,5 +26,6 @@ object CobblemonGameRules {
|
||||
val SHINY_STARTERS: GameRules.Key<GameRules.BooleanValue> = Cobblemon.implementation.registerGameRule("doShinyStarters", GameRules.Category.MISC, BooleanRuleInvoker.`cobblemon$create`(false))
|
||||
@JvmField
|
||||
val HEALERS_HEAL_PC: GameRules.Key<GameRules.BooleanValue> = Cobblemon.implementation.registerGameRule("healersHealPC", GameRules.Category.MISC, BooleanRuleInvoker.`cobblemon$create`(false))
|
||||
|
||||
@JvmField
|
||||
val DO_POKEMON_PREDATION: GameRules.Key<GameRules.BooleanValue> = Cobblemon.implementation.registerGameRule("doPokemonPredation", GameRules.Category.MOBS, BooleanRuleInvoker.`cobblemon$create`(true))
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:watershuriken_actor",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_blend",
|
||||
"texture": "textures/particles/moves/watershuriken"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.rsize": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [0, 1, 1, 1, 1, 1, 1, 1]
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"trail": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_actortrail",
|
||||
"type": "particle"
|
||||
}
|
||||
},
|
||||
"hit": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_target",
|
||||
"type": "particle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_initialization": {
|
||||
"creation_expression": "v.target_deltaz=5;"
|
||||
},
|
||||
"minecraft:emitter_rate_instant": {
|
||||
"num_particles": 1
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 0.25
|
||||
},
|
||||
"minecraft:emitter_shape_disc": {
|
||||
"offset": [0, 0.02, 0.1],
|
||||
"radius": 0.5,
|
||||
"direction": "outwards"
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": 0.35
|
||||
},
|
||||
"minecraft:particle_lifetime_events": {
|
||||
"timeline": {
|
||||
"0.00": "trail",
|
||||
"0.06": "trail",
|
||||
"0.12": "trail",
|
||||
"0.18": "trail",
|
||||
"0.24": "trail",
|
||||
"0.30": "trail",
|
||||
"0.34": "hit"
|
||||
}
|
||||
},
|
||||
"minecraft:particle_initial_spin": {
|
||||
"rotation": "math.random_integer(0,3)*90"
|
||||
},
|
||||
"minecraft:particle_motion_parametric": {
|
||||
"relative_position": ["-v.target_deltax*(v.particle_age / v.particle_lifetime)", "(v.target_deltay*(v.particle_age / v.particle_lifetime))", "-v.target_deltaz*(v.particle_age / v.particle_lifetime)"]
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.4*v.rsize", "0.4*v.rsize"],
|
||||
"facing_camera_mode": "lookat_direction",
|
||||
"direction": {
|
||||
"mode": "custom",
|
||||
"custom_direction": [0, 0, -1]
|
||||
},
|
||||
"uv": {
|
||||
"texture_width": 60,
|
||||
"texture_height": 15,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 0],
|
||||
"size_UV": [15, 15],
|
||||
"step_UV": [15, 0],
|
||||
"frames_per_second": 24,
|
||||
"max_frame": 4,
|
||||
"loop": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:watershuriken_actoralt",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_blend",
|
||||
"texture": "textures/particles/moves/watershuriken"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.rsize": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [0, 1, 1, 1, 1, 1, 1, 1]
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"trail": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_actortrail",
|
||||
"type": "particle"
|
||||
}
|
||||
},
|
||||
"hit": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_target",
|
||||
"type": "particle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_initialization": {
|
||||
"creation_expression": "v.target_deltaz=5;"
|
||||
},
|
||||
"minecraft:emitter_rate_steady": {
|
||||
"spawn_rate": 7,
|
||||
"max_particles": 3
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 0.4
|
||||
},
|
||||
"minecraft:emitter_shape_disc": {
|
||||
"offset": [0, 0.02, 0.1],
|
||||
"radius": 0.5,
|
||||
"direction": "outwards"
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": 0.35
|
||||
},
|
||||
"minecraft:particle_lifetime_events": {
|
||||
"timeline": {
|
||||
"0.00": "trail",
|
||||
"0.06": "trail",
|
||||
"0.12": "trail",
|
||||
"0.18": "trail",
|
||||
"0.24": "trail",
|
||||
"0.30": "trail",
|
||||
"0.34": "hit"
|
||||
}
|
||||
},
|
||||
"minecraft:particle_initial_spin": {
|
||||
"rotation": "math.random_integer(0,3)*90"
|
||||
},
|
||||
"minecraft:particle_motion_parametric": {
|
||||
"relative_position": ["-(v.target_deltax+((v.particle_random_1-0.5)*2))*(v.particle_age / v.particle_lifetime)", "(v.target_deltay+((v.particle_random_2-0.5)*2))*(v.particle_age / v.particle_lifetime)", "-v.target_deltaz*(v.particle_age / v.particle_lifetime)"]
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.4*v.rsize", "0.4*v.rsize"],
|
||||
"facing_camera_mode": "lookat_direction",
|
||||
"direction": {
|
||||
"mode": "custom",
|
||||
"custom_direction": [0, 0, -1]
|
||||
},
|
||||
"uv": {
|
||||
"texture_width": 60,
|
||||
"texture_height": 15,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 0],
|
||||
"size_UV": [15, 15],
|
||||
"step_UV": [15, 0],
|
||||
"frames_per_second": 24,
|
||||
"max_frame": 4,
|
||||
"loop": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:watershuriken_actorhor",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_blend",
|
||||
"texture": "textures/particles/moves/watershuriken"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.rsize": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [0, 1, 1, 1, 1, 1, 1, 1]
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"trail": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_actortrail",
|
||||
"type": "particle"
|
||||
}
|
||||
},
|
||||
"hit": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_target",
|
||||
"type": "particle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_initialization": {
|
||||
"creation_expression": "v.target_deltaz=5;"
|
||||
},
|
||||
"minecraft:emitter_rate_instant": {
|
||||
"num_particles": 1
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 0.25
|
||||
},
|
||||
"minecraft:emitter_shape_disc": {
|
||||
"offset": [0, 0.02, 0.1],
|
||||
"radius": 0.5,
|
||||
"direction": "outwards"
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": 0.35
|
||||
},
|
||||
"minecraft:particle_lifetime_events": {
|
||||
"timeline": {
|
||||
"0.00": "trail",
|
||||
"0.06": "trail",
|
||||
"0.12": "trail",
|
||||
"0.18": "trail",
|
||||
"0.24": "trail",
|
||||
"0.30": "trail",
|
||||
"0.34": "hit"
|
||||
}
|
||||
},
|
||||
"minecraft:particle_initial_spin": {
|
||||
"rotation": "math.random_integer(0,3)*90"
|
||||
},
|
||||
"minecraft:particle_motion_parametric": {
|
||||
"relative_position": ["-v.target_deltax*(v.particle_age / v.particle_lifetime)", "(v.target_deltay*(v.particle_age / v.particle_lifetime))", "-v.target_deltaz*(v.particle_age / v.particle_lifetime)"]
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.4*v.rsize", "0.4*v.rsize"],
|
||||
"facing_camera_mode": "emitter_transform_xz",
|
||||
"uv": {
|
||||
"texture_width": 60,
|
||||
"texture_height": 15,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 0],
|
||||
"size_UV": [15, 15],
|
||||
"step_UV": [15, 0],
|
||||
"frames_per_second": 24,
|
||||
"max_frame": 4,
|
||||
"loop": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:watershuriken_actortrail",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_alpha",
|
||||
"texture": "textures/particles/generic/impact/impact_water"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.scale": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [1, 0]
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_rate_instant": {
|
||||
"num_particles": 1
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 1
|
||||
},
|
||||
"minecraft:emitter_shape_point": {
|
||||
"direction": ["v.particle_random_1-0.5", "v.particle_random_2-0.25", -3]
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": "math.random(0.3, 0.6)"
|
||||
},
|
||||
"minecraft:particle_initial_spin": {
|
||||
"rotation": "math.round(v.particle_random_4*3)*90"
|
||||
},
|
||||
"minecraft:particle_initial_speed": 8,
|
||||
"minecraft:particle_motion_dynamic": {
|
||||
"linear_acceleration": [0, -5, 0],
|
||||
"linear_drag_coefficient": 8
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.22 * variable.scale", "0.22 * variable.scale"],
|
||||
"facing_camera_mode": "rotate_xyz",
|
||||
"uv": {
|
||||
"texture_width": 8,
|
||||
"texture_height": 56,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 24],
|
||||
"size_UV": [8, 8],
|
||||
"step_UV": [0, 8],
|
||||
"frames_per_second": 16,
|
||||
"max_frame": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"minecraft:particle_motion_collision": {
|
||||
"collision_radius": 0.02
|
||||
},
|
||||
"minecraft:particle_appearance_tinting": {
|
||||
"color": [0.61176, 0.87451, 1, 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:watershuriken_actorvert",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_blend",
|
||||
"texture": "textures/particles/moves/watershuriken"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.rsize": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [0, 1, 1, 1, 1, 1, 1, 1]
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"trail": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_actortrail",
|
||||
"type": "particle"
|
||||
}
|
||||
},
|
||||
"hit": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_target",
|
||||
"type": "particle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_initialization": {
|
||||
"creation_expression": "v.target_deltaz=5;"
|
||||
},
|
||||
"minecraft:emitter_rate_instant": {
|
||||
"num_particles": 1
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 0.25
|
||||
},
|
||||
"minecraft:emitter_shape_disc": {
|
||||
"offset": [0, 0.02, 0.1],
|
||||
"radius": 0.5,
|
||||
"direction": "outwards"
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": 0.35
|
||||
},
|
||||
"minecraft:particle_lifetime_events": {
|
||||
"timeline": {
|
||||
"0.00": "trail",
|
||||
"0.06": "trail",
|
||||
"0.12": "trail",
|
||||
"0.18": "trail",
|
||||
"0.24": "trail",
|
||||
"0.30": "trail",
|
||||
"0.34": "hit"
|
||||
}
|
||||
},
|
||||
"minecraft:particle_initial_spin": {
|
||||
"rotation": "math.random_integer(0,3)*90"
|
||||
},
|
||||
"minecraft:particle_motion_parametric": {
|
||||
"relative_position": ["-v.target_deltax*(v.particle_age / v.particle_lifetime)", "(v.target_deltay*(v.particle_age / v.particle_lifetime))", "-v.target_deltaz*(v.particle_age / v.particle_lifetime)"]
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.4*v.rsize", "0.4*v.rsize"],
|
||||
"facing_camera_mode": "emitter_transform_yz",
|
||||
"uv": {
|
||||
"texture_width": 60,
|
||||
"texture_height": 15,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 0],
|
||||
"size_UV": [15, 15],
|
||||
"step_UV": [15, 0],
|
||||
"frames_per_second": 24,
|
||||
"max_frame": 4,
|
||||
"loop": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:watershuriken_target",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_alpha",
|
||||
"texture": "textures/particles/generic/impact/impact_water"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.scale": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [1, 0]
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"event": {
|
||||
"particle_effect": {
|
||||
"effect": "cobblemon:watershuriken_targetspark",
|
||||
"type": "particle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_rate_steady": {
|
||||
"spawn_rate": 240,
|
||||
"max_particles": 14
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 0.1
|
||||
},
|
||||
"minecraft:emitter_lifetime_events": {
|
||||
"creation_event": "event"
|
||||
},
|
||||
"minecraft:emitter_shape_point": {},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": "math.random(0.3, 0.6)"
|
||||
},
|
||||
"minecraft:particle_initial_spin": {
|
||||
"rotation": "math.round(v.particle_random_4*3)*90"
|
||||
},
|
||||
"minecraft:particle_initial_speed": "math.random(9,17)",
|
||||
"minecraft:particle_motion_dynamic": {
|
||||
"linear_drag_coefficient": 5
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.3 * variable.scale", "0.3 * variable.scale"],
|
||||
"facing_camera_mode": "rotate_xyz",
|
||||
"uv": {
|
||||
"texture_width": 8,
|
||||
"texture_height": 56,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 16],
|
||||
"size_UV": [8, 8],
|
||||
"step_UV": [0, 8],
|
||||
"frames_per_second": 16,
|
||||
"max_frame": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"minecraft:particle_appearance_tinting": {
|
||||
"color": [0.61176, 0.87451, 1, 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:watershuriken_targetspark",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_blend",
|
||||
"texture": "textures/particles/vanilla/critical_hit"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.bitespark": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [0, 1, 0.88, 0.66, 0.35, -0.05]
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_rate_instant": {
|
||||
"num_particles": 7
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 1
|
||||
},
|
||||
"minecraft:emitter_shape_point": {
|
||||
"offset": [0, 0, -0.25],
|
||||
"direction": ["v.particle_random_1-0.5", "v.particle_random_2-0.25", "v.particle_random_3-0.5"]
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": "0.5-(v.particle_random_4*0.1)"
|
||||
},
|
||||
"minecraft:particle_initial_speed": "math.random(1.75,3.55)*3",
|
||||
"minecraft:particle_motion_dynamic": {
|
||||
"linear_acceleration": [0, -5, 0],
|
||||
"linear_drag_coefficient": 4
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.125*v.bitespark", "0.125*v.bitespark"],
|
||||
"facing_camera_mode": "rotate_xyz",
|
||||
"uv": {
|
||||
"texture_width": 8,
|
||||
"texture_height": 8,
|
||||
"uv": [0, 0],
|
||||
"uv_size": [7, 7]
|
||||
}
|
||||
},
|
||||
"minecraft:particle_motion_collision": {
|
||||
"collision_radius": 0.01
|
||||
},
|
||||
"minecraft:particle_appearance_tinting": {
|
||||
"color": {
|
||||
"interpolant": "v.particle_age / v.particle_lifetime",
|
||||
"gradient": {
|
||||
"0.0": "#FF51D8FF",
|
||||
"1.0": "#FF0076FF"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"portraitScale": 1,
|
||||
"portraitTranslation": [0, 0, 0],
|
||||
"profileScale": 1,
|
||||
"profileTranslation": [0, 0, 0],
|
||||
"rootBone": "ancient_ball",
|
||||
"poses": {
|
||||
"flying": {
|
||||
"poseTypes": ["NONE"],
|
||||
"condition": "q.capture_state() == 'NOT'",
|
||||
"animations": ["q.bedrock('ancient_ball', 'throw')"],
|
||||
"transitions": {
|
||||
"open": "q.bedrock_stateful('ancient_ball', 'open')"
|
||||
}
|
||||
},
|
||||
"open": {
|
||||
"poseTypes": ["NONE", "PORTRAIT"],
|
||||
"animations": ["q.bedrock('ancient_ball', 'open_idle')"],
|
||||
"transitions": {
|
||||
"shut": "q.bedrock_stateful('ancient_ball', 'shut')"
|
||||
}
|
||||
},
|
||||
"shut": {
|
||||
"poseTypes": ["NONE", "PORTRAIT"],
|
||||
"animations": [
|
||||
"q.bedrock('ancient_ball', 'shut_idle')"
|
||||
],
|
||||
"transitions": {
|
||||
"open": "q.bedrock_stateful('ancient_ball', 'open')"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"portraitScale": 1,
|
||||
"portraitTranslation": [0, 0, 0],
|
||||
"profileScale": 1,
|
||||
"profileTranslation": [0, 0, 0],
|
||||
"rootBone": "poke_ball",
|
||||
"poses": {
|
||||
"flying": {
|
||||
"poseTypes": ["NONE"],
|
||||
"condition": "q.capture_state() == 'NOT'",
|
||||
"animations": ["q.bedrock('poke_ball', 'throw')"],
|
||||
"transitions": {
|
||||
"open": "q.bedrock_stateful('poke_ball', 'open')"
|
||||
}
|
||||
},
|
||||
"open": {
|
||||
"poseTypes": ["NONE", "PORTRAIT"],
|
||||
"animations": ["q.bedrock('poke_ball', 'open_idle')"],
|
||||
"transitions": {
|
||||
"shut": "q.bedrock_stateful('poke_ball', 'shut')"
|
||||
}
|
||||
},
|
||||
"shut": {
|
||||
"poseTypes": ["NONE", "PORTRAIT"],
|
||||
"animations": [
|
||||
"q.bedrock('poke_ball', 'shut_idle')"
|
||||
],
|
||||
"transitions": {
|
||||
"open": "q.bedrock_stateful('poke_ball', 'open')"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+611
-9
@@ -37,10 +37,10 @@
|
||||
"rotation": [0, -7.5, 0]
|
||||
},
|
||||
"tail2": {
|
||||
"rotation": [30, 0, 0]
|
||||
"rotation": ["30-math.sin(q.anim_time*90*2-60)*-3", 0, 0]
|
||||
},
|
||||
"tail3": {
|
||||
"rotation": [12.5, 0, 0]
|
||||
"rotation": ["12.5-math.sin(q.anim_time*90*2-120)*-3", 0, 0]
|
||||
},
|
||||
"leg_right": {
|
||||
"rotation": [0, 5, 0]
|
||||
@@ -53,6 +53,22 @@
|
||||
},
|
||||
"wings_open": {
|
||||
"scale": 0
|
||||
},
|
||||
"torso": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*2-90)*1", 0, "math.sin(q.anim_time*90*1-90)*1"],
|
||||
"position": [0, "math.sin(q.anim_time*90*2)*0.1", 0]
|
||||
},
|
||||
"wing_closed_left": {
|
||||
"rotation": ["-0-math.sin(q.anim_time*90*2-150)*1", 0, 0]
|
||||
},
|
||||
"wing_closed_right": {
|
||||
"rotation": ["-0-math.sin(q.anim_time*90*2-150)*1", 0, 0]
|
||||
},
|
||||
"neck": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*2-180)*1", 0, 0]
|
||||
},
|
||||
"head": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*2-90)*-2", 0, "math.sin(q.anim_time*90*1-60)*-1"]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -111,6 +127,30 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"torso": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.3333": {
|
||||
"post": [5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.5833": {
|
||||
"post": [2.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.8333": {
|
||||
"post": [-5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.1667": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
},
|
||||
"jaw": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
@@ -118,19 +158,15 @@
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.1667": {
|
||||
"post": [85, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.4167": {
|
||||
"post": [85, 0, 0],
|
||||
"post": [72.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.5833": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": {
|
||||
"post": [85, 0, 0],
|
||||
"0.8333": {
|
||||
"post": [52.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.1667": {
|
||||
@@ -138,6 +174,32 @@
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.5833": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0, -0.1]
|
||||
},
|
||||
"0.75": {
|
||||
"pre": [0.1, 0, -0.1],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.5833": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0, -0.1]
|
||||
},
|
||||
"0.75": {
|
||||
"pre": [-0.1, 0, -0.1],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
@@ -203,6 +265,546 @@
|
||||
"position": [-0.1, 0, -0.1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.spearow.hold_item": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"jaw": {
|
||||
"rotation": [30, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.spearow.ground_walk": {
|
||||
"loop": true,
|
||||
"animation_length": 0.75,
|
||||
"bones": {
|
||||
"torso": {
|
||||
"rotation": ["1-math.cos(q.anim_time*90*16/3*2)*-2", "-math.sin(q.anim_time*90*16/3+60)*3", "-1+math.sin(q.anim_time*90*16/3+30)*-4"],
|
||||
"position": [0, "math.sin(q.anim_time*90*16/3*2)*0.2", 0]
|
||||
},
|
||||
"wings_open": {
|
||||
"scale": 0
|
||||
},
|
||||
"wing_closed_left": {
|
||||
"rotation": [3, 0, 0]
|
||||
},
|
||||
"wing_closed_right": {
|
||||
"rotation": [3, 0, 0]
|
||||
},
|
||||
"tail2": {
|
||||
"rotation": ["22-math.cos(q.anim_time*90*16/3*2)*5", 0, 0]
|
||||
},
|
||||
"tail3": {
|
||||
"rotation": ["5-math.cos(q.anim_time*90*16/3*2)*5", 0, 0]
|
||||
},
|
||||
"neck": {
|
||||
"rotation": {
|
||||
"0.0": ["-math.cos(q.anim_time*90*16/3*2)*-12.5", "-math.sin(q.anim_time*90*16/3+60)*-3", "math.sin(q.anim_time*90*16/3+30)*3"],
|
||||
"0.125": ["-math.cos(q.anim_time*90*16/3*2)*-9.5", "-math.sin(q.anim_time*90*16/3+60)*-3", "math.sin(q.anim_time*90*16/3+30)*3"],
|
||||
"0.1667": ["-math.cos(q.anim_time*90*16/3*2)*-12.5", "-math.sin(q.anim_time*90*16/3+60)*-3", "math.sin(q.anim_time*90*16/3+30)*3"],
|
||||
"0.375": ["-math.cos(q.anim_time*90*16/3*2)*-12.5", "-math.sin(q.anim_time*90*16/3+60)*-3", "math.sin(q.anim_time*90*16/3+30)*3"],
|
||||
"0.5": ["-math.cos(q.anim_time*90*16/3*2)*-9.5", "-math.sin(q.anim_time*90*16/3+60)*-3", "math.sin(q.anim_time*90*16/3+30)*3"],
|
||||
"0.5417": ["-math.cos(q.anim_time*90*16/3*2)*-12.5", "-math.sin(q.anim_time*90*16/3+60)*-3", "math.sin(q.anim_time*90*16/3+30)*3"]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, "math.cos(q.anim_time*90*16/3*2)*0.2", 0],
|
||||
"0.0417": [0, -0.075, 0.025],
|
||||
"0.0833": [0, "-0.2+math.cos(q.anim_time*90*16/3*2)*0.2", -0.2],
|
||||
"0.125": [0, -0.22, -0.17],
|
||||
"0.1667": [0, -0.21, -0.185],
|
||||
"0.375": [0, "math.cos(q.anim_time*90*16/3*2)*0.2", 0],
|
||||
"0.4167": [0, -0.075, 0.025],
|
||||
"0.4583": [0, "-0.2+math.cos(q.anim_time*90*16/3*2)*0.2", -0.2],
|
||||
"0.5": [0, -0.22, -0.17],
|
||||
"0.5417": [0, -0.21, -0.185],
|
||||
"0.75": [0, "math.cos(q.anim_time*90*16/3*2)*0.2", 0]
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"rotation": ["5-math.cos(q.anim_time*90*16/3*2)*18", 0, 0],
|
||||
"position": [0, 0, "-0.2+math.cos(q.anim_time*90*16/3*2)*0.3"]
|
||||
},
|
||||
"scruff_left": {
|
||||
"rotation": [0, "-0-math.cos(q.anim_time*90*16/3*2-30)*7", 0]
|
||||
},
|
||||
"scruff_right": {
|
||||
"rotation": [0, "0+math.cos(q.anim_time*90*16/3*2-30)*7", 0]
|
||||
},
|
||||
"scruff_top_right": {
|
||||
"rotation": ["-0-math.cos(q.anim_time*90*16/3*2-30)*5", 0, 0]
|
||||
},
|
||||
"scruff_bottom": {
|
||||
"rotation": ["-0-math.cos(q.anim_time*90*16/3*2)*-12", 0, 0]
|
||||
},
|
||||
"leg_left": {
|
||||
"rotation": {
|
||||
"0.0": [25, -17.5, 0],
|
||||
"0.125": {
|
||||
"pre": [21.25, -12.5, 0],
|
||||
"post": [21.25, -12.5, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.375": [-40, -5, 0],
|
||||
"0.75": [25, -17.5, 0]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0.3, 0.1, 0.6],
|
||||
"0.0417": [0.23, 0.25, 0.71],
|
||||
"0.125": {
|
||||
"pre": [0, 0.68, -0.08],
|
||||
"post": [0, 0.68, -0.08],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [0, 0.97, -1.41],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.375": [0, -0.5, -2.15],
|
||||
"0.5": [0, -0.19, -1.02],
|
||||
"0.5833": [0, -0.07, -0.3],
|
||||
"0.625": [0, -0.02, 0.21],
|
||||
"0.7083": [0.1, 0.215, 0.43],
|
||||
"0.75": [0.3, 0.1, 0.6]
|
||||
}
|
||||
},
|
||||
"leg_left2": {
|
||||
"rotation": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.125": {
|
||||
"pre": [-30.83, 0, 0],
|
||||
"post": [-30.83, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [-2.65, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.375": [12.5, 0, 0],
|
||||
"0.75": [0, 0, 0]
|
||||
}
|
||||
},
|
||||
"foot_left": {
|
||||
"rotation": {
|
||||
"0.0": [27.5, 0, -5],
|
||||
"0.125": {
|
||||
"pre": [20.17, 0, 0],
|
||||
"post": [20.17, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [12.596, 0.6637, -1.3486],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.375": [28, 0, 0],
|
||||
"0.625": [-7.33, 0, 0],
|
||||
"0.75": [27.5, 0, -5]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, 0.25, 0],
|
||||
"0.125": [0, 0, 0],
|
||||
"0.375": [0, 0, 0],
|
||||
"0.625": [0, 0.17, 0],
|
||||
"0.75": [0, 0.25, 0]
|
||||
}
|
||||
},
|
||||
"toe_back_left": {
|
||||
"rotation": {
|
||||
"0.0": [-20, 0, 0],
|
||||
"0.2083": {
|
||||
"pre": [-8.33, 0, 0],
|
||||
"post": [-8.33, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.375": [0, 0, 0],
|
||||
"0.625": [0, 0, 0],
|
||||
"0.75": [-20, 0, 0]
|
||||
}
|
||||
},
|
||||
"toe_inner_left": {
|
||||
"rotation": {
|
||||
"0.0": [-55, 10, -7.5],
|
||||
"0.125": {
|
||||
"pre": [7.5, 15, 0],
|
||||
"post": [7.5, 15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [5, 15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.375": [0, 15, 0],
|
||||
"0.625": [0, 15, 0],
|
||||
"0.75": [-55, 10, -7.5]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, -0.75, 1.35],
|
||||
"0.125": [0, 0, 0],
|
||||
"0.625": [0, 0, 0],
|
||||
"0.75": [0, -0.75, 1.35]
|
||||
}
|
||||
},
|
||||
"toe_outer_left": {
|
||||
"rotation": {
|
||||
"0.0": [-51.5, -2.5, 10],
|
||||
"0.125": {
|
||||
"pre": [5, -15, 0],
|
||||
"post": [5, -15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [5, -15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.375": [0, -15, 0],
|
||||
"0.625": [0, -15, 0],
|
||||
"0.75": [-51.5, -2.5, 10]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, -0.75, 1.35],
|
||||
"0.125": [0, 0, 0],
|
||||
"0.625": [0, 0, 0],
|
||||
"0.75": [0, -0.75, 1.35]
|
||||
}
|
||||
},
|
||||
"leg_right": {
|
||||
"rotation": {
|
||||
"0.0": [-40, 5, 0],
|
||||
"0.375": [25, 17.5, 0],
|
||||
"0.5": {
|
||||
"pre": [21.25, 12.5, 0],
|
||||
"post": [21.25, 12.5, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": [-40, 5, 0]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, -0.5, -2.15],
|
||||
"0.125": [0, -0.19, -1.02],
|
||||
"0.2083": [0, -0.07, -0.3],
|
||||
"0.25": [0, -0.02, 0.21],
|
||||
"0.3333": [-0.1, 0.215, 0.43],
|
||||
"0.375": [-0.3, 0.1, 0.6],
|
||||
"0.4167": [-0.23, 0.25, 0.71],
|
||||
"0.5": {
|
||||
"pre": [0, 0.68, -0.08],
|
||||
"post": [0, 0.68, -0.08],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.625": {
|
||||
"post": [0, 0.97, -1.41],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": [0, -0.5, -2.15]
|
||||
}
|
||||
},
|
||||
"leg_right2": {
|
||||
"rotation": {
|
||||
"0.0": [12.5, 0, 0],
|
||||
"0.375": [0, 0, 0],
|
||||
"0.5": {
|
||||
"pre": [-30.83, 0, 0],
|
||||
"post": [-30.83, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.625": {
|
||||
"post": [-2.65, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": [12.5, 0, 0]
|
||||
}
|
||||
},
|
||||
"foot_right": {
|
||||
"rotation": {
|
||||
"0.0": [28, 0, 0],
|
||||
"0.25": [-7.33, 0, 0],
|
||||
"0.375": [27.5, 0, 5],
|
||||
"0.5": {
|
||||
"pre": [20.17, 0, 0],
|
||||
"post": [20.17, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.625": {
|
||||
"post": [12.596, -0.6637, 1.3486],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": [28, 0, 0]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": [0, 0.17, 0],
|
||||
"0.375": [0, 0.25, 0],
|
||||
"0.5": [0, 0, 0],
|
||||
"0.75": [0, 0, 0]
|
||||
}
|
||||
},
|
||||
"toe_back_right": {
|
||||
"rotation": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": [0, 0, 0],
|
||||
"0.375": [-20, 0, 0],
|
||||
"0.5833": {
|
||||
"pre": [-8.33, 0, 0],
|
||||
"post": [-8.33, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": [0, 0, 0]
|
||||
}
|
||||
},
|
||||
"toe_inner_right": {
|
||||
"rotation": {
|
||||
"0.0": [0, -15, 0],
|
||||
"0.25": [0, -15, 0],
|
||||
"0.375": [-55, -10, 7.5],
|
||||
"0.5": {
|
||||
"pre": [7.5, -15, 0],
|
||||
"post": [7.5, -15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.625": {
|
||||
"post": [5, -15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": [0, -15, 0]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": [0, 0, 0],
|
||||
"0.375": [0, -0.75, 1.35],
|
||||
"0.5": [0, 0, 0],
|
||||
"0.75": [0, 0, 0]
|
||||
}
|
||||
},
|
||||
"toe_outer_right": {
|
||||
"rotation": {
|
||||
"0.0": [0, 15, 0],
|
||||
"0.25": [0, 15, 0],
|
||||
"0.375": [-51.5, 2.5, -10],
|
||||
"0.5": {
|
||||
"pre": [5, 15, 0],
|
||||
"post": [5, 15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.625": {
|
||||
"post": [5, 15, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": [0, 15, 0]
|
||||
},
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": [0, 0, 0],
|
||||
"0.375": [0, -0.75, 1.35],
|
||||
"0.5": [0, 0, 0],
|
||||
"0.75": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.spearow.air_idle": {
|
||||
"loop": true,
|
||||
"animation_length": 4,
|
||||
"bones": {
|
||||
"body": {
|
||||
"position": ["-math.sin(q.anim_time*90*3-45)*0.5", "math.sin(q.anim_time*90*6-45)*1.5", "math.sin(q.anim_time*90*6-45)*1/2"]
|
||||
},
|
||||
"torso": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-120)*-4", 0, "math.sin(q.anim_time*90*3-90)*4"]
|
||||
},
|
||||
"wing_open_left": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-90)*6", 0, "math.sin(q.anim_time*90*6)*65"],
|
||||
"position": [0, "math.sin(q.anim_time*90*6)*-1", 0]
|
||||
},
|
||||
"wing_open_left2": {
|
||||
"rotation": [0, 0, "20+math.sin(q.anim_time*90*6-45)*30"]
|
||||
},
|
||||
"wing_open_left3": {
|
||||
"rotation": [0, 0, "0+math.sin(q.anim_time*90*6-75)*30"]
|
||||
},
|
||||
"wing_open_right": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-90)*6", 0, "-math.sin(q.anim_time*90*6)*65"],
|
||||
"position": [0, "math.sin(q.anim_time*90*6)*-1", 0]
|
||||
},
|
||||
"wing_open_right2": {
|
||||
"rotation": [0, 0, "-20-math.sin(q.anim_time*90*6-45)*30"]
|
||||
},
|
||||
"wing_open_right3": {
|
||||
"rotation": [0, 0, "-0-math.sin(q.anim_time*90*6-75)*30"]
|
||||
},
|
||||
"tail2": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-30)*5", 0, 0]
|
||||
},
|
||||
"tail3": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-90)*5", 0, 0]
|
||||
},
|
||||
"neck": {
|
||||
"rotation": ["5-math.sin(q.anim_time*90*6-140)*-1", 0, "math.sin(q.anim_time*90*3-00)*-1"]
|
||||
},
|
||||
"head": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-110)*3", 0, "math.sin(q.anim_time*90*3-120)*-2"]
|
||||
},
|
||||
"scruff_left": {
|
||||
"rotation": [0, "-0-math.sin(q.anim_time*90*6-170)*4", 0]
|
||||
},
|
||||
"scruff_right": {
|
||||
"rotation": [0, "0+math.sin(q.anim_time*90*6-170)*4", 0]
|
||||
},
|
||||
"scruff_top_right": {
|
||||
"rotation": ["-0-math.sin(q.anim_time*90*6-210)*6", 0, 0]
|
||||
},
|
||||
"scruff_bottom": {
|
||||
"rotation": ["-0-math.sin(q.anim_time*90*6-170)*3", 0, 0]
|
||||
},
|
||||
"leg_left": {
|
||||
"rotation": [50, 0, 0]
|
||||
},
|
||||
"leg_left2": {
|
||||
"rotation": [-100, 0, 0]
|
||||
},
|
||||
"foot_left": {
|
||||
"rotation": ["40-math.sin(q.anim_time*90*6-30)*-5", -10, "math.sin(q.anim_time*90*3-150)*6"]
|
||||
},
|
||||
"toe_back_left": {
|
||||
"rotation": [-27.5, 0, 0]
|
||||
},
|
||||
"toe_inner_left": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
},
|
||||
"toe_outer_left": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
},
|
||||
"leg_right": {
|
||||
"rotation": [50, 0, 0]
|
||||
},
|
||||
"leg_right2": {
|
||||
"rotation": [-100, 0, 0]
|
||||
},
|
||||
"foot_right": {
|
||||
"rotation": ["40-math.sin(q.anim_time*90*6-30)*-5", 10, "-math.sin(q.anim_time*90*3-150)*6"]
|
||||
},
|
||||
"toe_back_right": {
|
||||
"rotation": [-27.5, 0, 0]
|
||||
},
|
||||
"toe_inner_right": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
},
|
||||
"toe_outer_right": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
}
|
||||
},
|
||||
"timeline": {
|
||||
"0.6667": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"1.3333": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"2.0": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"2.6667": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"3.3333": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"4.0": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};"
|
||||
}
|
||||
},
|
||||
"animation.spearow.air_fly": {
|
||||
"loop": true,
|
||||
"animation_length": 4,
|
||||
"bones": {
|
||||
"body": {
|
||||
"position": ["-math.sin(q.anim_time*90*3-45)*0.5", "math.sin(q.anim_time*90*6-45)*1.5", "math.sin(q.anim_time*90*6-45)*1/2"]
|
||||
},
|
||||
"torso": {
|
||||
"rotation": ["15-math.sin(q.anim_time*90*6-120)*-1.5", 0, "math.sin(q.anim_time*90*3-90)*4"]
|
||||
},
|
||||
"wing_open_left": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-90)*6", 0, "math.sin(q.anim_time*90*6)*65"],
|
||||
"position": [0, "math.sin(q.anim_time*90*6)*-1", 0]
|
||||
},
|
||||
"wing_open_left2": {
|
||||
"rotation": [0, 0, "20+math.sin(q.anim_time*90*6-45)*30"]
|
||||
},
|
||||
"wing_open_left3": {
|
||||
"rotation": [0, 0, "0+math.sin(q.anim_time*90*6-75)*30"]
|
||||
},
|
||||
"wing_open_right": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-90)*6", 0, "-math.sin(q.anim_time*90*6)*65"],
|
||||
"position": [0, "math.sin(q.anim_time*90*6)*-1", 0]
|
||||
},
|
||||
"wing_open_right2": {
|
||||
"rotation": [0, 0, "-20-math.sin(q.anim_time*90*6-45)*30"]
|
||||
},
|
||||
"wing_open_right3": {
|
||||
"rotation": [0, 0, "-0-math.sin(q.anim_time*90*6-75)*30"]
|
||||
},
|
||||
"tail": {
|
||||
"rotation": [-10, 0, 0]
|
||||
},
|
||||
"tail2": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-30)*5", 0, 0]
|
||||
},
|
||||
"tail3": {
|
||||
"rotation": ["-math.sin(q.anim_time*90*6-90)*5", 0, 0]
|
||||
},
|
||||
"neck": {
|
||||
"rotation": ["5-math.sin(q.anim_time*90*6-140)*-1", 0, "math.sin(q.anim_time*90*3-00)*-1"]
|
||||
},
|
||||
"head_ai": {
|
||||
"rotation": [5, 0, 0]
|
||||
},
|
||||
"head": {
|
||||
"rotation": ["-7.5-math.sin(q.anim_time*90*6-110)*3", 0, "math.sin(q.anim_time*90*3-120)*-2"]
|
||||
},
|
||||
"scruff_left": {
|
||||
"rotation": [0, "-0-math.sin(q.anim_time*90*6-170)*4", 0]
|
||||
},
|
||||
"scruff_right": {
|
||||
"rotation": [0, "0+math.sin(q.anim_time*90*6-170)*4", 0]
|
||||
},
|
||||
"scruff_top_right": {
|
||||
"rotation": ["-0-math.sin(q.anim_time*90*6-210)*6", 0, 0]
|
||||
},
|
||||
"scruff_bottom": {
|
||||
"rotation": ["-0-math.sin(q.anim_time*90*6-170)*3", 0, 0]
|
||||
},
|
||||
"leg_left": {
|
||||
"rotation": [50, 0, 0]
|
||||
},
|
||||
"leg_left2": {
|
||||
"rotation": [-100, 0, 0]
|
||||
},
|
||||
"foot_left": {
|
||||
"rotation": ["40-math.sin(q.anim_time*90*6-30)*-5", -10, "math.sin(q.anim_time*90*3-150)*6"]
|
||||
},
|
||||
"toe_back_left": {
|
||||
"rotation": [-27.5, 0, 0]
|
||||
},
|
||||
"toe_inner_left": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
},
|
||||
"toe_outer_left": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
},
|
||||
"leg_right": {
|
||||
"rotation": [50, 0, 0]
|
||||
},
|
||||
"leg_right2": {
|
||||
"rotation": [-100, 0, 0]
|
||||
},
|
||||
"foot_right": {
|
||||
"rotation": ["40-math.sin(q.anim_time*90*6-30)*-5", 10, "-math.sin(q.anim_time*90*3-150)*6"]
|
||||
},
|
||||
"toe_back_right": {
|
||||
"rotation": [-27.5, 0, 0]
|
||||
},
|
||||
"toe_inner_right": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
},
|
||||
"toe_outer_right": {
|
||||
"rotation": [37.5, 0, 0]
|
||||
}
|
||||
},
|
||||
"timeline": {
|
||||
"0.6667": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"1.3333": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"2.0": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"2.6667": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"3.3333": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};",
|
||||
"4.0": "q.has_entity?{q.sound('animation.plumage.wing_flap.small');};"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3431
-89
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -217,7 +217,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.raichu_cap.water_swim": {
|
||||
"animation.raichu_cap.water_surface_swim": {
|
||||
"loop": true,
|
||||
"animation_length": 1,
|
||||
"bones": {
|
||||
|
||||
+464
-58
@@ -2,6 +2,312 @@
|
||||
"format_version": "1.8.0",
|
||||
"animations": {
|
||||
"animation.ninetales.ground_idle": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"body": {
|
||||
"position": [0, -0.3, 0]
|
||||
},
|
||||
"torso": {
|
||||
"rotation": ["5+math.sin(q.anim_time*90*1-0)*0.5", 0, "0-math.sin(q.anim_time*90*0.5-30)*0.5"]
|
||||
},
|
||||
"chest": {
|
||||
"rotation": ["-4.8+math.sin(q.anim_time*90*1-30)*0.5", 0, -1.2]
|
||||
},
|
||||
"neck": {
|
||||
"rotation": ["-12.5+math.sin(q.anim_time*90*1-60)*1", 0, 0]
|
||||
},
|
||||
"neck_fur_left2": {
|
||||
"rotation": [0, 0, "-7.5-math.sin(q.anim_time*90*1-90)*1"]
|
||||
},
|
||||
"neck_fur_right2": {
|
||||
"rotation": [0, 0, "7.5+math.sin(q.anim_time*90*1-90)*1"]
|
||||
},
|
||||
"neck2": {
|
||||
"rotation": ["-12.5+math.sin(q.anim_time*90*1-90)*0.5", 0, 0]
|
||||
},
|
||||
"head_rotation": {
|
||||
"rotation": ["32.5+math.sin(q.anim_time*90*1-90)*-2", 0, "0-math.sin(q.anim_time*90*1-120)*-0.5"]
|
||||
},
|
||||
"hair2": {
|
||||
"rotation": ["-2.5+math.sin(q.anim_time*90*1-210)*1", 0, 0]
|
||||
},
|
||||
"hair_back_top": {
|
||||
"rotation": ["-2.5+math.sin(q.anim_time*90*1-300)*2", 0, 0]
|
||||
},
|
||||
"hair_back_top2": {
|
||||
"rotation": ["-22.5+math.sin(q.anim_time*90*1-360)*4", 0, 0]
|
||||
},
|
||||
"hair_back_bottom2": {
|
||||
"rotation": ["-20+math.sin(q.anim_time*90*1-380)*4", 0, 0]
|
||||
},
|
||||
"tail_middle": {
|
||||
"rotation": ["42.5+math.sin(q.anim_time*90*1-60)*-0.5", 0, 0]
|
||||
},
|
||||
"tail_middle2": {
|
||||
"rotation": ["7.5+math.sin(q.anim_time*90*1-120)*-1", 0, 0]
|
||||
},
|
||||
"tail_middle3": {
|
||||
"rotation": ["17.5+math.sin(q.anim_time*90*1-180)*-1", 0, 0]
|
||||
},
|
||||
"tail_middle4": {
|
||||
"rotation": ["-37.5+math.sin(q.anim_time*90*1-240)*-4", 0, 0]
|
||||
},
|
||||
"tail_middle5": {
|
||||
"rotation": ["-35+math.sin(q.anim_time*90*1-300)*-6", 2.5, 0]
|
||||
},
|
||||
"tail_middle6": {
|
||||
"rotation": ["-42.5+math.sin(q.anim_time*90*1-300)*-6", 0, 0]
|
||||
},
|
||||
"tail_middle7": {
|
||||
"rotation": ["-25+math.sin(q.anim_time*90*1-400)*-6", 0, 0]
|
||||
},
|
||||
"tail_middle8": {
|
||||
"rotation": ["35+math.sin(q.anim_time*90*1-460)*-12", 0, 0]
|
||||
},
|
||||
"tail_left1_rotation": {
|
||||
"rotation": ["27.525638448+math.sin(q.anim_time*90*1-60)*-0.5", 2.04767, 1.43455]
|
||||
},
|
||||
"tail_left1_2": {
|
||||
"rotation": ["15.013645339+math.sin(q.anim_time*90*1-120)*-1", 2.41476, 0.64743]
|
||||
},
|
||||
"tail_left1_3": {
|
||||
"rotation": ["17.5+math.sin(q.anim_time*90*1-180)*-1", 0, 0]
|
||||
},
|
||||
"tail_left1_4": {
|
||||
"rotation": ["-32.599068173+math.sin(q.anim_time*90*1-240)*-4", -4.21541, 2.69136]
|
||||
},
|
||||
"tail_left1_5": {
|
||||
"rotation": ["-37.605552+math.sin(q.anim_time*90*1-300)*-6", -3.9649, 3.04868]
|
||||
},
|
||||
"tail_left1_6": {
|
||||
"rotation": ["-40.107597848+math.sin(q.anim_time*90*1-360)*-4", 3.82821, -3.21873]
|
||||
},
|
||||
"tail_left1_7": {
|
||||
"rotation": ["-27.702122918+math.sin(q.anim_time*90*1-400)*-6", 6.64851, -3.47875]
|
||||
},
|
||||
"tail_left1_8": {
|
||||
"rotation": ["30.867477791+math.sin(q.anim_time*90*1-460)*-12", 12.95254, 7.63074]
|
||||
},
|
||||
"tail_left2_rotation": {
|
||||
"rotation": ["22.577335588+math.sin(q.anim_time*90*1-60)*-0.5", 4.61854, 1.91757]
|
||||
},
|
||||
"tail_left2_2": {
|
||||
"rotation": ["12.5+math.sin(q.anim_time*90*1-120)*-1", 0, 0]
|
||||
},
|
||||
"tail_left2_3": {
|
||||
"rotation": ["15+math.sin(q.anim_time*90*1-180)*-1", 0, 0]
|
||||
},
|
||||
"tail_left2_4": {
|
||||
"rotation": ["-20+math.sin(q.anim_time*90*1-240)*-4", 0, 0]
|
||||
},
|
||||
"tail_left2_5": {
|
||||
"rotation": ["-56.265008831+math.sin(q.anim_time*90*1-300)*-6", -9.93191, 14.48174]
|
||||
},
|
||||
"tail_left2_6": {
|
||||
"rotation": ["-37.158458405+math.sin(q.anim_time*90*1-300)*-6", 18.26883, -13.36473]
|
||||
},
|
||||
"tail_left2_7": {
|
||||
"rotation": ["33.125975871+math.sin(q.anim_time*90*1-360)*-12", 10.51794, 6.79286]
|
||||
},
|
||||
"tail_left3_rotation": {
|
||||
"rotation": ["10+math.sin(q.anim_time*90*1-60)*-0.5", 0, 0]
|
||||
},
|
||||
"tail_left3_2": {
|
||||
"rotation": ["22.577335588+math.sin(q.anim_time*90*1-120)*-1", 4.61854, 1.91757]
|
||||
},
|
||||
"tail_left3_3": {
|
||||
"rotation": ["10+math.sin(q.anim_time*90*1-180)*-1", 0, 0]
|
||||
},
|
||||
"tail_left3_4": {
|
||||
"rotation": ["-30+math.sin(q.anim_time*90*1-240)*-4", 0, 0]
|
||||
},
|
||||
"tail_left3_5": {
|
||||
"rotation": ["-27.860824367+math.sin(q.anim_time*90*1-300)*-6", -8.86042, 4.65468]
|
||||
},
|
||||
"tail_left3_6": {
|
||||
"rotation": ["-43.1852829+math.sin(q.anim_time*90*1-300)*-6", 9.18229, -8.51814]
|
||||
},
|
||||
"tail_left3_7": {
|
||||
"rotation": ["35.413183453+math.sin(q.anim_time*90*1-360)*-12", 8.17773, 5.77509]
|
||||
},
|
||||
"tail_right1_rotation": {
|
||||
"rotation": ["27.525638448+math.sin(q.anim_time*90*1-60)*-0.5", -2.04767, -1.43455]
|
||||
},
|
||||
"tail_right1_2": {
|
||||
"rotation": ["15.013645339+math.sin(q.anim_time*90*1-120)*-1", -2.41476, -0.64743]
|
||||
},
|
||||
"tail_right1_3": {
|
||||
"rotation": ["17.5+math.sin(q.anim_time*90*1-180)*-1", 0, 0]
|
||||
},
|
||||
"tail_right1_4": {
|
||||
"rotation": ["-32.599068173+math.sin(q.anim_time*90*1-240)*-4", 4.21541, -2.69136]
|
||||
},
|
||||
"tail_right1_5": {
|
||||
"rotation": ["-37.605552+math.sin(q.anim_time*90*1-300)*-6", 3.9649, -3.04868]
|
||||
},
|
||||
"tail_right1_6": {
|
||||
"rotation": ["-40.107597848+math.sin(q.anim_time*90*1-360)*-4", -3.82821, 3.21873]
|
||||
},
|
||||
"tail_right1_7": {
|
||||
"rotation": ["-27.702122918+math.sin(q.anim_time*90*1-400)*-6", -6.64851, 3.47875]
|
||||
},
|
||||
"tail_right1_8": {
|
||||
"rotation": ["30.867477791+math.sin(q.anim_time*90*1-460)*-12", -12.95254, -7.63074]
|
||||
},
|
||||
"tail_right2_rotation": {
|
||||
"rotation": ["22.577335588+math.sin(q.anim_time*90*1-60)*-0.5", -4.61854, -1.91757]
|
||||
},
|
||||
"tail_right2_2": {
|
||||
"rotation": ["12.5+math.sin(q.anim_time*90*1-120)*-1", 0, 0]
|
||||
},
|
||||
"tail_right2_3": {
|
||||
"rotation": ["15+math.sin(q.anim_time*90*1-180)*-1", 0, 0]
|
||||
},
|
||||
"tail_right2_4": {
|
||||
"rotation": ["-20+math.sin(q.anim_time*90*1-240)*-4", 0, 0]
|
||||
},
|
||||
"tail_right2_5": {
|
||||
"rotation": ["-56.265008831+math.sin(q.anim_time*90*1-300)*-6", 9.93191, -14.48174]
|
||||
},
|
||||
"tail_right2_6": {
|
||||
"rotation": ["-37.158458405+math.sin(q.anim_time*90*1-300)*-6", -18.26883, 13.36473]
|
||||
},
|
||||
"tail_right2_7": {
|
||||
"rotation": ["33.125975871+math.sin(q.anim_time*90*1-360)*-12", -10.51794, -6.79286]
|
||||
},
|
||||
"leg_front_left": {
|
||||
"rotation": ["-9.981069394+math.sin(q.anim_time*90*1-0)*-1", 0.43523, 4.98107],
|
||||
"position": [0, "0-math.sin(q.anim_time*90*1-0)*0.025", "0-math.sin(q.anim_time*90*1-0)*-0.15"]
|
||||
},
|
||||
"leg_front_left2": {
|
||||
"rotation": ["-2.5+math.sin(q.anim_time*90*1-0)*0.5", 0, 0]
|
||||
},
|
||||
"foot_front_left": {
|
||||
"rotation": ["12.5+math.sin(q.anim_time*90*1-0)*0.5", 0, -5]
|
||||
},
|
||||
"leg_back_left": {
|
||||
"rotation": ["10+math.sin(q.anim_time*90*1-0)*1", 0, -7.5],
|
||||
"position": [0, "0-math.sin(q.anim_time*90*1-0)*0.2", "0-math.sin(q.anim_time*90*1-0)*0.25"]
|
||||
},
|
||||
"leg_back_left2": {
|
||||
"rotation": ["-2.5+math.sin(q.anim_time*90*1-0)*1", 0, 0]
|
||||
},
|
||||
"leg_back_left3": {
|
||||
"rotation": ["-2.5+math.sin(q.anim_time*90*1-0)*-1", 0, 0]
|
||||
},
|
||||
"foot_back_left": {
|
||||
"rotation": ["-5+math.sin(q.anim_time*90*1-0)*-1", 0, 7.5]
|
||||
},
|
||||
"leg_front_right": {
|
||||
"rotation": ["10.018930606+math.sin(q.anim_time*90*1-0)*-1", -0.43523, -4.98107],
|
||||
"position": [0, "0-math.sin(q.anim_time*90*1-0)*0.025", "0-math.sin(q.anim_time*90*1-0)*-0.15"]
|
||||
},
|
||||
"leg_front_right2": {
|
||||
"rotation": ["-10+math.sin(q.anim_time*90*1-0)*0.5", 0, 0]
|
||||
},
|
||||
"foot_front_right": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-0)*0.5", 0, 5]
|
||||
},
|
||||
"leg_back_right": {
|
||||
"rotation": ["17.521361057+math.sin(q.anim_time*90*1-0)*1", 0.32621, 7.49294],
|
||||
"position": [0, "0-math.sin(q.anim_time*90*1-0)*0.2", "0-math.sin(q.anim_time*90*1-0)*0.25"]
|
||||
},
|
||||
"leg_back_right2": {
|
||||
"rotation": ["-5+math.sin(q.anim_time*90*1-0)*1", 0, 0]
|
||||
},
|
||||
"leg_back_right3": {
|
||||
"rotation": ["2.5+math.sin(q.anim_time*90*1-0)*-1", 0, 0]
|
||||
},
|
||||
"foot_back_right": {
|
||||
"rotation": ["-15+math.sin(q.anim_time*90*1-0)*-1", 0, -7.5]
|
||||
},
|
||||
"tail_right3_rotation": {
|
||||
"rotation": ["10+math.sin(q.anim_time*90*1-60)*-0.5", 0, 0]
|
||||
},
|
||||
"tail_right3_2": {
|
||||
"rotation": ["22.577335588+math.sin(q.anim_time*90*1-120)*-1", -4.61854, -1.91757]
|
||||
},
|
||||
"tail_right3_3": {
|
||||
"rotation": ["10+math.sin(q.anim_time*90*1-180)*-1", 0, 0]
|
||||
},
|
||||
"tail_right3_4": {
|
||||
"rotation": ["-30+math.sin(q.anim_time*90*1-240)*-4", 0, 0]
|
||||
},
|
||||
"tail_right3_5": {
|
||||
"rotation": ["-27.860824367+math.sin(q.anim_time*90*1-300)*-6", 8.86042, -4.65468]
|
||||
},
|
||||
"tail_right3_6": {
|
||||
"rotation": ["-43.1852829+math.sin(q.anim_time*90*1-300)*-6", -9.18229, 8.51814]
|
||||
},
|
||||
"tail_right3_7": {
|
||||
"rotation": ["35.413183453+math.sin(q.anim_time*90*1-360)*-12", -8.17773, -5.77509]
|
||||
},
|
||||
"tail_left4_rotation": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-60)*-0.5", 10, 0]
|
||||
},
|
||||
"tail_left4_2": {
|
||||
"rotation": ["17.5+math.sin(q.anim_time*90*1-120)*-1", 0, 0]
|
||||
},
|
||||
"tail_left4_3": {
|
||||
"rotation": ["20.4458201+math.sin(q.anim_time*90*1-180)*-2", -11.73507, -4.3361]
|
||||
},
|
||||
"tail_left4_4": {
|
||||
"rotation": ["-41.341977449+math.sin(q.anim_time*90*1-240)*-4", -13.31791, 11.45696]
|
||||
},
|
||||
"tail_left4_5": {
|
||||
"rotation": ["-35.413183453+math.sin(q.anim_time*90*1-300)*-6", 8.17773, -5.77509]
|
||||
},
|
||||
"tail_left4_6": {
|
||||
"rotation": ["39.711284319+math.sin(q.anim_time*90*1-360)*-12", 17.67415, 14.15251]
|
||||
},
|
||||
"tail_right4_rotation": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-60)*-0.5", -10, 0]
|
||||
},
|
||||
"tail_right4_2": {
|
||||
"rotation": ["17.5+math.sin(q.anim_time*90*1-120)*-1", 0, 0]
|
||||
},
|
||||
"tail_right4_3": {
|
||||
"rotation": ["20.4458201+math.sin(q.anim_time*90*1-180)*-2", 11.73507, 4.3361]
|
||||
},
|
||||
"tail_right4_4": {
|
||||
"rotation": ["-41.341977449+math.sin(q.anim_time*90*1-240)*-4", 13.31791, -11.45696]
|
||||
},
|
||||
"tail_right4_5": {
|
||||
"rotation": ["-35.413183453+math.sin(q.anim_time*90*1-300)*-6", -8.17773, 5.77509]
|
||||
},
|
||||
"tail_right4_6": {
|
||||
"rotation": ["39.711284319+math.sin(q.anim_time*90*1-360)*-12", -17.67415, -14.15251]
|
||||
},
|
||||
"neck_fur_front": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-60)*-1", 0, 0]
|
||||
},
|
||||
"neck_fur_front2": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-90)*2", 0, 0]
|
||||
},
|
||||
"neck_fur_front3": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-120)*2", 0, 0]
|
||||
},
|
||||
"ear_left": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-120)*1", 0, "0-math.sin(q.anim_time*90*1-30)*2"]
|
||||
},
|
||||
"ear_right": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-120)*1", 0, "-0+math.sin(q.anim_time*90*1-30)*2"]
|
||||
},
|
||||
"hair": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-150)*2", 0, 0]
|
||||
},
|
||||
"hair_detail": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-180)*1", 0, 0]
|
||||
},
|
||||
"hair_detail2": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-240)*1", 0, 0]
|
||||
},
|
||||
"hair_back_bottom": {
|
||||
"rotation": ["-0+math.sin(q.anim_time*90*1-320)*2", 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.ninetales.base": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"body": {
|
||||
@@ -276,64 +582,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.ninetales.cry": {
|
||||
"animation_length": 1,
|
||||
"bones": {
|
||||
"mouth": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": [0, -0.0999, -0.00436],
|
||||
"0.75": [0, -0.0999, -0.00436],
|
||||
"1.0": [0, 0, 0]
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [-15, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.6667": {
|
||||
"post": [-15, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.9167": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
},
|
||||
"jaw": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [65, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.75": {
|
||||
"post": [65, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"0.0": {
|
||||
"effect": "pokemon.ninetales.cry"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.ninetales.blink": {
|
||||
"animation_length": 0.1667,
|
||||
"bones": {
|
||||
@@ -413,6 +661,164 @@
|
||||
"position": [-0.1, 0, -0.1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.ninetales.cry": {
|
||||
"animation_length": 2,
|
||||
"bones": {
|
||||
"torso": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.25": {
|
||||
"post": [1, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.5": {
|
||||
"post": [-2, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.3333": {
|
||||
"post": [-4, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.6667": {
|
||||
"post": [-0.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"2.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
},
|
||||
"neck2": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.2083": {
|
||||
"post": [2.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.4167": {
|
||||
"post": [-5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.25": {
|
||||
"post": [-7.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.625": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"2.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
},
|
||||
"head_rotation": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.2083": {
|
||||
"post": [5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.4583": {
|
||||
"post": [-22.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.25": {
|
||||
"post": [-27, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.625": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"2.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [0.1, 0, -0.1]},
|
||||
"1.5": {"pre": [0.1, 0, -0.1], "post": [0, 0, 0]}
|
||||
}
|
||||
},
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [-0.1, 0, -0.1]},
|
||||
"1.5": {"pre": [-0.1, 0, -0.1], "post": [0, 0, 0]}
|
||||
}
|
||||
},
|
||||
"jaw": {
|
||||
"rotation": {
|
||||
"0.2917": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.5": {
|
||||
"post": [47.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.25": {
|
||||
"post": [20, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.5417": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
},
|
||||
"position": [0, 0, 0]
|
||||
},
|
||||
"hair": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.1667": {
|
||||
"post": [10, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"0.5": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.1667": {
|
||||
"post": [-2.5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"1.625": {
|
||||
"post": [5, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
},
|
||||
"2.0": {
|
||||
"post": [0, 0, 0],
|
||||
"lerp_mode": "catmullrom"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"0.3333": {
|
||||
"effect": "pokemon.ninetales.cry"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user