Compare commits

...
Author SHA1 Message Date
apion b36f84178e Merge remote-tracking branch 'origin/main' into feature/flashback-compat
# Conflicts:
#	fabric/src/main/resources/mixins.cobblemon-fabric.json
2025-11-26 20:33:51 -05:00
Polymeta 635f29e1ac fix glass bottle not being returned when using honey on saccharine leaves
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-11-26 22:08:12 +00:00
Polymeta db2001b60a Merge branch 'attempted-jvm-fix' into 'main'
Fixed JVM crash from campfire pot

Closes #1795

See merge request cable-mc/cobblemon!2040
2025-11-26 21:40:30 +00:00
Hiroku b5098a2ad0 Fixed JVM crash from campfire pot 2025-11-26 21:40:29 +00:00
Polymeta 8c939ee276 Merge branch 'lets-wind-down' into 'main'
Fixes wind charges recalling pastured pokémon

Closes #1805

See merge request cable-mc/cobblemon!2042
2025-11-26 13:27:12 +00:00
Neovitalism 645b8993c8 Fixes wind charges recalling pastured pokémon 2025-11-26 13:27:12 +00:00
Polymeta d96799cac7 Merge branch 'feature/neoforge-recipe-book' into 'main'
split recipebooktype and category across fabric and neoforge so we can leverage neoforge APIs

Closes #1789 and #1787

See merge request cable-mc/cobblemon!2044
2025-11-26 12:44:06 +00:00
Polymeta b822b626c4 split recipebooktype and category across fabric and neoforge so we can leverage neoforge APIs 2025-11-26 12:44:05 +00:00
Polymeta 4d9b182fb3 fix hearty grains crashing if a block is in the way
Closes #1818

Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-11-26 11:59:25 +00:00
Polymeta 88d155eaf4 [skip-ci] more changelog
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-11-26 11:33:57 +00:00
Paul af96469b7a changelog [skip-ci] 2025-11-26 21:17:15 +10:00
Paul 65f1e7a3be Merge remote-tracking branch 'weblate/lang-updates' 2025-11-26 21:14:31 +10:00
阿鱼 16cd2de02f Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.4% (8973 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/zh_Hans/
2025-11-26 10:03:51 +00:00
Polymeta 22a44bd7e9 Merge branch 'ImprovedPastureBees' into 'main'
Improved Pasture Combees and More

See merge request cable-mc/cobblemon!2043
2025-11-26 09:36:28 +00:00
Polymeta d37bd4ef03 Merge branch 'OmnipathNavigationCrashFix' into 'main'
OmnipathNavigationCrashFix

See merge request cable-mc/cobblemon!2045
2025-11-26 09:34:03 +00:00
Hiroku a3d9a10f2e Merge branch 'wallpaper' into 'main'
Remove auto generated screen glow due to rendering issues

See merge request cable-mc/cobblemon!2047
2025-11-26 08:48:00 +00:00
Test 7801e3feee changelog clarification [skip-ci] 2025-11-26 04:56:10 +00:00
Test 4a54cb4674 remove auto generated screen glow 2025-11-26 04:38:14 +00:00
JazzMcNade 24fe1c125c changelog 2025-11-25 21:47:45 -06:00
JazzMcNade 023160f87a Removed a really silly cast 2025-11-25 21:32:17 -06:00
Polymeta 17fbf7c6f0 defensive pokemon casts as NPCs use this too
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-11-25 16:53:26 +00:00
Polymeta ec86b7d4bf fix tag reference
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-11-25 15:18:09 +00:00
阿鱼 7561eb116f Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.3% (8960 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/zh_Hans/
2025-11-25 14:20:09 +00:00
Polymeta 6467b97a23 Merge branch 'implement_pokemon' into 'main'
marked furfrou as implemented

See merge request cable-mc/cobblemon!2041
2025-11-25 12:16:02 +00:00
JazzMcNade 6d5909a1e3 Added rain clause, do not attempt to enter a full hive, changelog 2025-11-25 02:17:28 -06:00
JazzMcNade 2bb0d43ca8 Fix wandering for pastured bees, fix hoverpos not being cleared 2025-11-25 00:51:04 -06:00
Watuneni iteite 1fb3f0ebdc Translated using Weblate (Japanese)
Currently translated at 99.2% (8954 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/ja/
2025-11-25 06:46:07 +00:00
violet fb2154e2c3 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-11-24 22:06:34 -05:00
violet 3b14d19fdb marked furfrou as implemented 2025-11-24 22:06:22 -05:00
Carmendar 6840c2fdef Merge branch 'main' into implement_pokemon 2025-11-24 17:28:35 -06:00
阿鱼 8fc2031806 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.2% (8954 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/zh_Hans/
2025-11-24 21:23:59 +00:00
Alexis Salgueiro 4795e2e1bc Translated using Weblate (French)
Currently translated at 99.6% (8984 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/fr/
2025-11-24 11:22:45 +00:00
Carmendar c563627b05 Shiny female Combee is now actually shiny. 2025-11-24 02:31:25 -06:00
violet 73ebf7a789 tiny typo fix 2025-11-24 03:18:38 -05:00
washashu0905 e3d0252d75 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 94.4% (8519 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/zh_Hant/
2025-11-24 00:10:57 +00:00
阿鱼 dbe8e57341 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.2% (8950 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/zh_Hans/
2025-11-24 00:10:56 +00:00
Zack the Ghast 6f37fd69cd Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.4% (8791 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/pt_BR/
2025-11-24 00:10:55 +00:00
geumu 47daea6195 Translated using Weblate (Korean)
Currently translated at 75.6% (6826 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/ko/
2025-11-22 17:37:36 +00:00
Watuneni iteite aca66a4bb0 Translated using Weblate (Japanese)
Currently translated at 99.2% (8954 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/ja/
2025-11-22 17:37:35 +00:00
geumu 68c6d5d9b2 Translated using Weblate (Korean)
Currently translated at 75.6% (6825 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/ko/
2025-11-22 07:33:14 +00:00
Watuneni iteite f6b3591d80 Translated using Weblate (Japanese)
Currently translated at 99.2% (8954 of 9019 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/ja/
2025-11-22 03:06:51 +00:00
geumu f9878d6137 Translated using Weblate (Korean)
Currently translated at 75.2% (6740 of 8962 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/ko/
2025-11-22 01:45:14 +00:00
Watuneni iteite 94da3b8d21 Translated using Weblate (Japanese)
Currently translated at 100.0% (8962 of 8962 strings)

Translation: Cobblemon/Mod
Translate-URL: http://lang.cobblemon.com/projects/cobblemon/mod/ja/
2025-11-22 01:45:14 +00:00
Apion a6c02cc63e Fix server crash 2025-11-16 13:29:02 -05:00
Apion fc229298e7 Fix bug where Flashback didn't track some driver state when the recorder was driving 2025-11-16 01:36:25 -05:00
Apion 3a0239a01f Fix crash with flashback related to improper riding packet handling 2025-11-15 21:23:17 -05:00
Apion 2dc027ec5f Fix bug with flashback where riding state was not properly updates 2025-11-15 21:22:48 -05:00
Apion 230cb02afe Revert "Add gross fix for flashback only."
This reverts commit 3f458bd210.
2025-11-15 14:28:36 -05:00
JPAKx4 3f458bd210 Add gross fix for flashback only. 2025-11-14 20:47:58 -06:00
JPAKx4 b07ea7566b Merge branch 'main' into feature/flashback-compat 2025-11-14 20:19:49 -06:00
Apion 98f8441c4e Merge remote-tracking branch 'origin/main' into feature/flashback-compat 2025-11-12 14:59:56 -05:00
Apion d78c076e06 Use getter instead of field in ReplayGamePacketHandlerMixin 2025-11-09 17:09:49 -05:00
Apion 6118a4ed32 Add Flashback mixin to support custom SpawnExtraDataEntityPackets from PokemonEntitys 2025-11-08 23:09:09 -05:00
Apion 8464591e41 Add flashback to dev environment run configs (c2me conflicts, removed temporarily) 2025-11-08 13:17:22 -05:00
56 changed files with 1522 additions and 421 deletions

No files matched your search

+30 -9
View File
@@ -6,28 +6,49 @@
- Added brewing recipe for Throat Spray.
### Changes
- Convert the riding freelook button to a configurable keybinding.
- Reduced cost of the Vivichoke Seed trade with the Wandering Trader.
- Converted the riding freelook button to a configurable keybinding.
- Reduced the cost of the Vivichoke Seed trade with the Wandering Trader.
### Fixes
- Prevent displaying ride controls overlay to passengers.
- Fixed player suffocation on vanilla mounts experienced on some worlds.
- Fixed Poké Snack spawning sounds not coming from the block.
- Fix player suffocation on vanilla mounts experienced on some worlds.
- Stop passengers from hearing the shiny noise of a ridden shiny Pokémon.
- Fixed incorrect camera pivot on Bird, Jet, and Dolphin mounts.
- Fixed Poké Snack spawning sound positioning.
- Fix player suffocation on vanilla mounts experienced on some worlds.
- Stop passengers from hearing the shiny noise of a ridden shiny Pokémon.
- Ponigiri can no longer be eaten at full hunger.
- Medicinal Brew's Campfire Pot recipe now correctly displays that it can be made using an empty glass bottle or a filled bottle,
- Fix incorrect camera pivot on Bird, Jet, and Dolphin mounts.
- Medicinal Brew's Campfire Pot recipe now correctly displays that it can be made using an empty glass bottle or a filled bottle.
- Fixed a crash when you place a block in the way of hearty grains 2nd block
- Fixed a graphics crash that could occur on some machines when campfires were nearby.
- Fixed glass bottle not being returned when honey-ing a saccharine leaf block
- Fixed Combees not depositing honey upon leaving a hive if they entered with nectar.
- Safer reading of brain memories in hive mixins.
- Fixed crash when opening a PC box with certain wallpapers when using *VulkanMod*.
- Fixed pastured Combees not moving in night or rain.
- Fixed a case in which a Combee might try to path to a flower that no longer exists.
- Fixed Combees attempting to enter a full hive.
- Fixed a crash involving Combees and hives.
- Fixed crashing and rendering issues when opening a PC box with certain wallpapers.
- Fixed a crash when opening a PC box with certain wallpapers while using *VulkanMod*.
- Fixed a glitch where friendship would reset to the default value when evolving a Pokémon.
- Fixed a crashed related to NPC navigation.
- Fix player suffocation on vanilla mounts experienced on some worlds.
- Stop passengers from hearing the shiny noise of a ridden shiny Pokémon.
- Fix a glitch where friendship would reset to the default value when evolving a Pokémon.
- Fixed friendship resetting to the default value when evolving a Pokémon.
- Fixed a bunch of incompatibilities with NeoForge mods
- Fixed a bug where wind charges hitting pasture blocks would recall all pokémon in it.
### Developer
### Molang & Datapacks
- Removed automatic generation of PC wallpaper screen glow if no asset is provided; it is now optional.
### Particles
### Localization
- Updated translations for:
- French
- Japanese
- Korean
- Brazilian Portuguese
- Simplified Chinese
- Traditional Chinese
@@ -37,16 +37,16 @@ public class ClientPacketListenerMixin {
passengers.add(this.level.getEntity(passenger));
}
Arrays
.stream(pokemon.getOccupiedSeats())
.filter(x -> !passengers.contains(x))
.filter(Objects::nonNull)
.forEach(Entity::stopRiding);
.stream(pokemon.getOccupiedSeats())
.filter(x -> !passengers.contains(x))
.filter(Objects::nonNull)
.forEach(Entity::stopRiding);
var occupiedSeats = Arrays.asList(pokemon.getOccupiedSeats());
passengers.stream()
.filter(x -> !occupiedSeats.contains(x))
.filter(Objects::nonNull)
.forEach(x -> x.startRiding(pokemon, true));
.filter(x -> !occupiedSeats.contains(x))
.filter(Objects::nonNull)
.forEach(x -> x.startRiding(pokemon, true));
ci.cancel();
}
}
@@ -1,38 +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.mixin;
import com.cobblemon.mod.common.block.PreEmptsExplosion;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = Explosion.class)
public class ExplosionMixin {
@Redirect(
method = "finalizeExplosion",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/level/Level;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;",
ordinal = 0
)
)
public BlockState cobblemon$whenExploded(Level world, BlockPos pos) {
BlockState blockState = world.getBlockState(pos);
if(blockState.getBlock() instanceof PreEmptsExplosion preExplosionBlock) {
preExplosionBlock.whenExploded(world, blockState, pos);
}
return blockState;
}
}
@@ -1,32 +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.mixin;
import net.minecraft.stats.RecipeBookSettings;
import net.minecraft.world.inventory.RecipeBookType;
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;
import java.util.Map;
@Mixin(RecipeBookSettings.class)
public class RecipeBookSettingsMixin {
@Shadow @Final public Map<RecipeBookType, RecipeBookSettings.TypeSettings> states;
@Inject(method = "<init>", at = @At("TAIL"))
private void cobblemon$init(CallbackInfo ci) {
states.put(RecipeBookType.valueOf("COOKING_POT"), new RecipeBookSettings.TypeSettings(true, true));
}
}
@@ -9,14 +9,15 @@
package com.cobblemon.mod.common
import net.minecraft.client.RecipeBookCategories
import net.minecraft.world.inventory.RecipeBookType
enum class CobblemonRecipeCategories {
COOKING_POT_SEARCH("COOKING_POT_SEARCH"),
COOKING_POT_FOODS("COOKING_POT_FOODS"),
COOKING_POT_MEDICINES("COOKING_POT_MEDICINES"),
COOKING_POT_COMPLEX_DISHES("COOKING_POT_COMPLEX_DISHES"),
COOKING_POT_MISC("COOKING_POT_MISC");
COOKING_POT_SEARCH("COBBLEMON_COOKING_POT_SEARCH"),
COOKING_POT_FOODS("COBBLEMON_COOKING_POT_FOODS"),
COOKING_POT_MEDICINES("COBBLEMON_COOKING_POT_MEDICINES"),
COOKING_POT_COMPLEX_DISHES("COBBLEMON_COOKING_POT_COMPLEX_DISHES"),
COOKING_POT_MISC("COBBLEMON_COOKING_POT_MISC");
companion object {
val customAggregateCategories: Map<RecipeBookCategories, List<RecipeBookCategories>> = mapOf(
@@ -35,6 +36,9 @@ enum class CobblemonRecipeCategories {
fun toVanillaCategory(): RecipeBookCategories {
return RecipeBookCategories.valueOf(this.id)
}
}
object CobblemonRecipeBookTypes {
const val COOKING_POT_NAME = "COBBLEMON_COOKING_POT"
val COOKING_POT: RecipeBookType = RecipeBookType.valueOf(COOKING_POT_NAME)
}
@@ -109,7 +109,7 @@ class PollinateFlowerTaskConfig : SingleTaskConfig {
}
override fun stop(level: ServerLevel, entity: LivingEntity, gameTime: Long) {
hoverPos = null
if (successfulPollinationTicks > REQUIRED_SUCCESSFUL_POLLINATION_TICKS) {
entity.brain.setMemory(CobblemonMemories.HAS_NECTAR, true)
}
@@ -9,13 +9,8 @@
package com.cobblemon.mod.common.api.cooking
import com.cobblemon.mod.common.api.riding.stats.RidingStat
import com.cobblemon.mod.common.util.math.geometry.toDegrees
import com.cobblemon.mod.common.util.math.geometry.toRadians
import net.minecraft.util.FastColor
import net.minecraft.world.item.ItemStack
import kotlin.math.atan2
import kotlin.math.cos
import kotlin.math.sin
private val colourMap = mapOf(
Flavour.SPICY to 0xFEB37D,
@@ -34,27 +29,30 @@ private val bubbleColourMap = mapOf(
)
fun getColourMixFromSeasonings(seasonings: List<ItemStack>, forBubbles: Boolean = false): Int? {
val flavors = seasonings
.mapNotNull { Seasonings.getFlavoursFromItemStack(it) }
.flatMap { it.entries }
.groupingBy { it.key }
.fold(0) { acc, entry -> acc + entry.value }
val flavourValues = mutableMapOf<Flavour, Int>()
for (seasoning in seasonings) {
val flavours = Seasonings.getFlavoursFromItemStack(seasoning) ?: continue
for ((flavour, value) in flavours.entries) {
flavourValues[flavour] = (flavourValues[flavour] ?: 0) + value
}
}
if (flavors.isEmpty()) return null
if (flavourValues.isEmpty()) {
return null
}
val maxFlavorValue = flavors.values.maxOrNull()
val dominantFlavors = flavors.filter { it.value == maxFlavorValue }.map { it.key }
val maxFlavorValue = flavourValues.values.maxOrNull()
val dominantFlavours = flavourValues.filter { it.value == maxFlavorValue }.map { it.key }
return getColourMixFromFlavours(dominantFlavors, forBubbles)
return getColourMixFromFlavours(dominantFlavours, forBubbles)
}
fun getColourMixFromFlavours(dominantFlavours: List<Flavour>, forBubbles: Boolean = false): Int? {
val colors =
dominantFlavours.mapNotNull { if (forBubbles) bubbleColourMap[it] else colourMap[it] }
dominantFlavours
.mapNotNull { if (forBubbles) bubbleColourMap[it] else colourMap[it] }
.map { FastColor.ARGB32.opaque(it) }
if (colors.isEmpty()) return null
return getColourMixFromColors(colors)
}
@@ -62,104 +60,33 @@ fun getColourMixFromRideStatBoosts(dominantBoosts: Iterable<RidingStat>, forBubb
return getColourMixFromFlavours(dominantBoosts.map { it.flavour }, forBubbles)
}
// Mixing RGB colors directly often gives poor results
// Converting them to HSL and averaging hues circularly produces more natural blends
fun getColourMixFromColors(colors: List<Int>): Int? {
if (colors.isEmpty()) return null
if (colors.size == 1) return colors[0]
val hslColors = colors.map {
val red = FastColor.ARGB32.red(it)
val green = FastColor.ARGB32.green(it)
val blue = FastColor.ARGB32.blue(it)
val firstWeight = 0.7f
val otherWeightTotal = 1f - firstWeight
val otherWeight = otherWeightTotal / (colors.size - 1)
rgbToHsl(red, green, blue)
var alphaSum = 0f
var redSum = 0f
var greenSum = 0f
var blueSum = 0f
for (i in colors.indices) {
val weight = if (i == 0) firstWeight else otherWeight
val color = colors[i]
alphaSum += FastColor.ARGB32.alpha(color) * weight
redSum += FastColor.ARGB32.red(color) * weight
greenSum += FastColor.ARGB32.green(color) * weight
blueSum += FastColor.ARGB32.blue(color) * weight
}
val hues = hslColors.map { it.h.toDouble() }
val huesAverage = hueAverage(hues).toFloat()
val saturations = hslColors.map { it.s }
val saturationsAverage = average(saturations)
val lightness = hslColors.map { it.l }
val lightnessAverage = average(lightness)
val rgbColor = hslToRgb(huesAverage, saturationsAverage, lightnessAverage)
return FastColor.ARGB32.color(rgbColor.r, rgbColor.g, rgbColor.b)
}
// Based on https://iter.ca/post/hue-avg
fun hueAverage(hues: List<Double>): Float {
val points = hues.map { hue ->
val rad = hue.toRadians()
Pair(cos(rad), sin(rad))
}
val avgX = points.sumOf { it.first.toDouble() } / points.size
val avgY = points.sumOf { it.second.toDouble() } / points.size
var degrees = atan2(avgY, avgX).toDegrees()
if (degrees < 0) {
degrees += 360f
} else if (degrees > 360) {
degrees -= 360f
}
return degrees
}
fun average(values: List<Float>): Float {
if (values.isEmpty()) return 0f
return values.sum() / values.size
}
data class HSL(val h: Float, val s: Float, val l: Float)
fun rgbToHsl(r: Int, g: Int, b: Int): HSL {
val rf = r / 255f
val gf = g / 255f
val bf = b / 255f
val max = maxOf(rf, gf, bf)
val min = minOf(rf, gf, bf)
val delta = max - min
var h = 0f
val l = (max + min) / 2f
val s = if (delta == 0f) 0f else delta / (1f - kotlin.math.abs(2f * l - 1f))
if (delta != 0f) {
h = when (max) {
rf -> ((gf - bf) / delta) % 6f
gf -> ((bf - rf) / delta) + 2f
else -> ((rf - gf) / delta) + 4f
}
h *= 60f
if (h < 0) h += 360f
}
return HSL(h, s, l)
}
data class RGB(val r: Int, val g: Int, val b: Int)
fun hslToRgb(h: Float, s: Float, l: Float): RGB {
val c = (1f - kotlin.math.abs(2f * l - 1f)) * s
val x = c * (1f - kotlin.math.abs((h / 60f) % 2f - 1f))
val m = l - c / 2f
val (rf, gf, bf) = when {
h < 60f -> Triple(c, x, 0f)
h < 120f -> Triple(x, c, 0f)
h < 180f -> Triple(0f, c, x)
h < 240f -> Triple(0f, x, c)
h < 300f -> Triple(x, 0f, c)
else -> Triple(c, 0f, x)
}
return RGB(
((rf + m) * 255).toInt().coerceIn(0, 255),
((gf + m) * 255).toInt().coerceIn(0, 255),
((bf + m) * 255).toInt().coerceIn(0, 255)
return FastColor.ARGB32.color(
alphaSum.toInt(),
redSum.toInt(),
greenSum.toInt(),
blueSum.toInt()
)
}
@@ -17,7 +17,6 @@ import com.cobblemon.mod.common.client.render.models.blockbench.repository.Varyi
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.toHex
import com.mojang.blaze3d.platform.GlStateManager
import com.mojang.blaze3d.platform.GLX
import com.mojang.blaze3d.platform.Lighting
import com.mojang.blaze3d.systems.RenderSystem
import com.mojang.blaze3d.vertex.BufferUploader
@@ -38,8 +37,6 @@ import net.minecraft.resources.ResourceLocation
import net.minecraft.util.FormattedCharSequence
import org.joml.Matrix4f
import org.joml.Vector3f
import org.lwjgl.opengl.GL30
import java.nio.ByteBuffer
@JvmOverloads
fun blitk(
@@ -370,28 +367,3 @@ fun renderSprite(matrixStack: PoseStack, sprite: ResourceLocation) {
BufferUploader.drawWithShader(buffer.buildOrThrow())
}
fun getPixelRGB(x: Int, y: Int): Triple<Int, Int, Int> {
val window = Minecraft.getInstance().window
val scale = window.guiScale
val buffer = ByteBuffer.allocateDirect(4)
// Check if OpenGL context is present
if (!GLX.getOpenGLVersionString().equals("NO CONTEXT")) {
RenderSystem.readPixels(
(x * scale).toInt(),
(window.height - y * scale - scale).toInt(),
1,
1,
GL30.GL_RGBA,
GL30.GL_UNSIGNED_BYTE,
buffer
)
}
return Triple(
buffer[0].toInt() and 0xFF,
buffer[1].toInt() and 0xFF,
buffer[2].toInt() and 0xFF
)
}
@@ -34,6 +34,7 @@ import com.cobblemon.mod.common.util.resolveFloat
import com.cobblemon.mod.common.util.writeNullableExpression
import com.cobblemon.mod.common.util.writeRidingStats
import net.minecraft.client.Minecraft
import net.minecraft.client.player.LocalPlayer
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
@@ -19,7 +19,6 @@ import net.minecraft.server.level.ServerLevel
import net.minecraft.tags.FluidTags
import net.minecraft.util.Mth
import net.minecraft.util.RandomSource
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.*
import net.minecraft.world.level.block.Block
@@ -175,7 +174,7 @@ class HeartyGrainsBlock(settings: Properties) : CropBlock(settings), SimpleWater
UPDATE_CLIENTS
)
}
else if (stateAbove.getValue(HALF) == DoubleBlockHalf.UPPER) {
else if (stateAbove.hasProperty(HALF) && stateAbove.getValue(HALF) == DoubleBlockHalf.UPPER) {
world.setBlock(
abovePos,
stateAbove.setValue(AGE, newAge),
@@ -34,6 +34,7 @@ import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Explosion
import net.minecraft.world.level.Level
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.LevelReader
@@ -55,9 +56,10 @@ import net.minecraft.world.phys.shapes.VoxelShape
import java.util.*
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.gameevent.GameEvent
import java.util.function.BiConsumer
@Suppress("OVERRIDE_DEPRECATION", "DEPRECATION")
class PastureBlock(settings: Properties): BaseEntityBlock(settings), SimpleWaterloggedBlock, PreEmptsExplosion {
class PastureBlock(settings: Properties): BaseEntityBlock(settings), SimpleWaterloggedBlock {
companion object {
val CODEC = simpleCodec(::PastureBlock)
@@ -213,9 +215,19 @@ class PastureBlock(settings: Properties): BaseEntityBlock(settings), SimpleWater
return super.playerWillDestroy(world, pos, state, player)
}
override fun whenExploded(world: Level, state: BlockState, pos: BlockPos) {
val blockEntity = world.getBlockEntity(pos) as? PokemonPastureBlockEntity ?: return
blockEntity.onBroken()
override fun onExplosionHit(
state: BlockState,
level: Level,
pos: BlockPos,
explosion: Explosion,
dropConsumer: BiConsumer<ItemStack?, BlockPos?>
) {
val interaction = explosion.blockInteraction
if (interaction == Explosion.BlockInteraction.DESTROY || interaction == Explosion.BlockInteraction.DESTROY_WITH_DECAY) {
val blockEntity = level.getBlockEntity(pos) as? PokemonPastureBlockEntity ?: return
blockEntity.onBroken()
}
super.onExplosionHit(state, level, pos, explosion, dropConsumer)
}
override fun <T : BlockEntity?> getTicker(world: Level, state: BlockState, type: BlockEntityType<T>): BlockEntityTicker<T>? {
@@ -1,17 +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.block
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.core.BlockPos
import net.minecraft.world.level.Level
interface PreEmptsExplosion {
fun whenExploded(world: Level, state: BlockState, pos: BlockPos)
}
@@ -271,15 +271,16 @@ class SaccharineLeafBlock(settings: Properties) : LeavesBlock(settings) {
player.addItem(Items.HONEY_BOTTLE.defaultInstance)
level.playSound(null, pos, SoundEvents.BOTTLE_FILL, SoundSource.BLOCKS)
level.setBlock(pos, state.setValue(AGE, 0), 2)
level.setBlock(pos, state.setValue(AGE, 0), UPDATE_CLIENTS)
level.gameEvent(null, GameEvent.BLOCK_CHANGE, pos)
return ItemInteractionResult.SUCCESS
} else if (isHoneyBottle && !isAtMaxAge(state)) {
// Decrement stack if not in creative mode
itemStack.consume(1, player)
player.addItem(Items.GLASS_BOTTLE.defaultInstance)
level.playSound(null, pos, SoundEvents.HONEY_BLOCK_PLACE, SoundSource.BLOCKS)
level.setBlock(pos, state.setValue(AGE, 2), 2)
level.setBlock(pos, state.setValue(AGE, 2), UPDATE_CLIENTS)
level.gameEvent(null, GameEvent.BLOCK_CHANGE, pos)
return ItemInteractionResult.SUCCESS
}
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.block.campfirepot
import com.cobblemon.mod.common.CobblemonMenuType
import com.cobblemon.mod.common.CobblemonRecipeBookTypes.COOKING_POT
import com.cobblemon.mod.common.CobblemonRecipeTypes
import com.cobblemon.mod.common.api.cooking.Seasonings
import com.cobblemon.mod.common.block.entity.CampfireBlockEntity
@@ -211,7 +212,7 @@ class CookingPotMenu : RecipeBookMenu<CraftingInput, CookingPotRecipeBase>, Cont
}
override fun getRecipeBookType(): RecipeBookType {
return RecipeBookType.valueOf("COOKING_POT")
return COOKING_POT
}
override fun shouldMoveToInventory(slotIndex: Int): Boolean {
@@ -111,13 +111,18 @@ class CampfireBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlock
BlockEntitySoundTracker.stop(pos, campfireBlockEntity.ambientSound.location)
}
campfireBlockEntity.brothColor =
getColourMixFromSeasonings(campfireBlockEntity.getSeasonings())
?: BASE_BROTH_COLOR
val seasonings = campfireBlockEntity.getSeasonings()
if (seasonings.size != campfireBlockEntity.lastSeasoningStacks.size || seasonings.any { it !in campfireBlockEntity.lastSeasoningStacks }) {
campfireBlockEntity.lastSeasoningStacks = seasonings
campfireBlockEntity.bubbleColor =
getColourMixFromSeasonings(campfireBlockEntity.getSeasonings(), true)
?: BASE_BROTH_BUBBLE_COLOR
campfireBlockEntity.brothColor =
getColourMixFromSeasonings(seasonings)
?: BASE_BROTH_COLOR
campfireBlockEntity.bubbleColor =
getColourMixFromSeasonings(seasonings, true)
?: BASE_BROTH_BUBBLE_COLOR
}
if (campfireBlockEntity.particleCooldown > 0) {
campfireBlockEntity.particleCooldown--
@@ -241,6 +246,9 @@ class CampfireBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlock
var bubbleColor: Int = BASE_BROTH_BUBBLE_COLOR
var time: Int = 0
/** Used to know if we should be changing the colour of the broth or if we can go with the previous colour. */
var lastSeasoningStacks = listOf<ItemStack>()
var dataAccess: ContainerData = object : ContainerData {
override fun get(index: Int): Int {
return when (index) {
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.client.gui.pc
import com.cobblemon.mod.common.CobblemonNetwork
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.api.gui.blitk
import com.cobblemon.mod.common.api.gui.getPixelRGB
import com.cobblemon.mod.common.api.storage.StorePosition
import com.cobblemon.mod.common.api.storage.party.PartyPosition
import com.cobblemon.mod.common.api.storage.pc.PCPosition
@@ -284,20 +283,6 @@ class StorageWidget(
height = 189,
alpha = if (screenLoaded) 1F else ((pcGui.ticksElapsed).toFloat() / 10F).coerceIn(0F, 1F)
)
} else {
val rgb = getPixelRGB(x + (SCREEN_WIDTH / 2), y + (SCREEN_HEIGHT / 2))
blitk(
matrixStack = matrices,
texture = screenGlowResource,
x = x - 17,
y = y - 17,
width = 208,
height = 189,
red = rgb.first / 255F,
green = rgb.second / 255F,
blue = rgb.third / 255F,
alpha = if (screenLoaded) 1F else ((pcGui.ticksElapsed).toFloat() / 10F).coerceIn(0F, 1F)
)
}
blitk(
@@ -186,7 +186,7 @@ class OmniPathNavigation(val world: Level, val entity: Mob) : GroundPathNavigati
val blockState = this.world.getBlockState(target)
val path = if (!blockState.isSolid
|| (blockState.`is`(BlockTags.LEAVES) && blockState.block == CobblemonBlocks.SACCHARINE_LEAVES && (this.entity as PokemonEntity).canPathThroughSaccLeaves())) {
|| (blockState.`is`(BlockTags.LEAVES) && blockState.block == CobblemonBlocks.SACCHARINE_LEAVES && pather.canPathThroughSaccLeaves())) {
findPath(target, distance)
} else {
blockPos = target.above()
@@ -269,7 +269,7 @@ class OmniPathNavigation(val world: Level, val entity: Mob) : GroundPathNavigati
// If we can fly and we're airborne, return the current Y position
return vec.y
}
if (world.getBlockState(blockPos).block == CobblemonBlocks.SACCHARINE_LEAVES && (this.entity as PokemonEntity).canPathThroughSaccLeaves()) {
if (world.getBlockState(blockPos).block == CobblemonBlocks.SACCHARINE_LEAVES && pather.canPathThroughSaccLeaves()) {
return vec.y + 0.5
}
return if ((canFloat()) && blockGetter.getFluidState(blockPos).`is`(FluidTags.WATER)) vec.y + 0.5 else super.getGroundY(vec)
@@ -52,8 +52,9 @@ object PlaceHoneyInHiveTask {
if (blockEntity.isFull) {
// Erase Hive memory and give the bee a moment to locate a new hive
entity.brain.eraseMemory(CobblemonMemories.HIVE_LOCATION)
} else {
blockEntity.addOccupant(entity)
}
blockEntity.addOccupant(entity)
}
return@Trigger true
@@ -24,10 +24,19 @@ class ClientboundUpdateRidingStatePacket(
override val id = ID
override fun encode(buffer: RegistryFriendlyByteBuf) {
if (state == null) error("Expected state to be populated for encoding")
//We need to allow for encoding the data buffer instead of state for Flashback compat
//Flashback needs to be able to call encode on the packet it gets, which only has data, not state yet.
if (state == null && data == null) error("Expected state or data to be populated for encoding")
buffer.writeInt(entity)
buffer.writeResourceLocation(behaviour)
state.encode(buffer)
if (state != null) {
state.encode(buffer)
}
else if (data != null) {
buffer.writeBytes(data)
//So the buffer can be read in the future
data.resetReaderIndex()
}
}
companion object {
@@ -5,6 +5,10 @@
{
"aspects": ["female"],
"model": "cobblemon:combee_female.geo"
},
{
"aspects": ["shiny", "female"],
"texture": "cobblemon:textures/pokemon/0415_combee/combee_shiny.png"
}
]
}
@@ -6165,7 +6165,7 @@
"cobblemon.command.freezepokemon.non_pokemon": "Vous ne pointez pas un Pokémon.",
"advancements.cobblemon.craft_rod": "Équipé pour pécho !",
"advancements.cobblemon.use_bait.description": "Utiliser une baie avec la Poké Rod",
"advancements.cobblemon.craft_master_rod": "Dévouement magistral",
"advancements.cobblemon.craft_master_rod": "Cela affectera la population de Barbicha",
"cobblemon.battle.resisted_spread": "Ça n'est pas très efficace sur %1$s.",
"cobblemon.battle.superEffective_spread": "C'est super efficace sur %1$s !",
"cobblemon.battle.crit_spread": "Coup critique infligé à %1$s !",
@@ -8773,7 +8773,7 @@
"cobblemon.config.ui.despawner_max_age_ticks": "Âge maximum (Ticks)",
"cobblemon.config.ui.despawner_max_age_ticks.tooltip": "L'âge (en ticks de jeu) qu'un Pokémon doit atteindre avant de pouvoir disparaître à petite distance.",
"advancements.cobblemon.resurrect_galar_fossil": "N'arrêtez jamais d'apprendre",
"advancements.cobblemon.resurrect_galar_fossil.description": "Ressuscitez un Pokémon fossile créé à partir d'un Fossile Oiseau ou Fossile Poisson et d'un Fossile Dragon ou Fossile Aileron",
"advancements.cobblemon.resurrect_galar_fossil.description": "Ressuscitez un Pokémon fossile créé à partir d’un Fossile Oiseau ou Poisson et d’un Fossile Dragon ou Aileron",
"advancements.cobblemon.ride_pokemon": "Monteur de Pokémon !",
"advancements.cobblemon.ride_pokemon.description": "Montez sur un Pokémon pour la première fois",
"cobblemon.battle.sidestart.ally.auroraveil": "Voile Aurore augmente la résistance des Pokémon de l'équipe aux capacités physiques et spéciales !",
@@ -9088,7 +9088,7 @@
"cobblemon.config.ui.summary_profile_animations.animate_selected.tooltip": "Animer le Pokémon sélectionné à moins d'être K.O.",
"tag.item.cobblemon.berries.status_recovery": "Baies de récupération de statut",
"cobblemon.behaviour.configurable_resource_identifier.desc": "Permet de modifier l'identifiant de ressource qui contrôle l'apparence du PNJ.",
"item.cobblemon.moomoo_milk.tooltip": "Efface tous les changements de stats du Pokémon cible lorsqu'il est utilisé au combat.",
"item.cobblemon.moomoo_milk.tooltip": "Efface tous les changements de stats du Pokémon cible lorsqu'il est utilisé au combat",
"cobblemon.config.ui.poke_snack_pokemon_per_chunk": "Poké Snack Pokémon par tronçon",
"cobblemon.config.ui.animate_battle_tiles": "Animer les tuiles de combat",
"cobblemon.config.ui.pc_profile_animations.never_animate": "Ne jamais animer",
@@ -9104,5 +9104,35 @@
"cobblemon.entity.variable.display_name_tag.name": "Afficher l'étiquette",
"cobblemon.entity.variable.display_name_tag.desc": "Permet d'afficher ou masquer l'étiquette de l'entité.",
"cobblemon.behaviour.dialogue_selection.name": "Sélection du dialogue",
"cobblemon.behaviour.dialogue_selection.desc": "Permet de configurer l'interaction avec le PNJ afin d'ouvrir un dialogue spécifique."
"cobblemon.behaviour.dialogue_selection.desc": "Permet de configurer l'interaction avec le PNJ afin d'ouvrir un dialogue spécifique.",
"cobblemon.fishing_bait_effects.drops_reroll.tooltip": "%1$s%% - %3$s× Relance Des Butins",
"cobblemon.requires_debug_keys": "Les touches de débogage doivent être activées sur le serveur pour utiliser cette fonctionnalité.",
"cobblemon.requires_permission": "Vous n’avez pas l’autorisation requise pour effectuer cette action.",
"cobblemon.ui.stats.blocks_traveled": "Pas",
"item.cobblemon.eggant_berry.tooltip": "Le porteur est soigné s’il est amoureux",
"cobblemon.config.ui.default_key_items.tooltip": "Les objets rares que les joueurs obtiennent par défaut au début.",
"cobblemon.config.ui.default_key_items": "Objets Rares Par Défaut",
"advancements.cobblemon.cook_all_regional_delicacies": "Paul Bocuse",
"advancements.cobblemon.cook_all_regional_delicacies.description": "Cuisinez chaque Spécialité Régionale",
"advancements.cobblemon.cook_all_ev_mochi": "Mochi Mochi !",
"advancements.cobblemon.cook_all_ev_mochi.description": "Cuisinez chaque parfum de mochi, une délicieuse friandise capable de modifier les Points d’Effort d’un Pokémon",
"advancements.cobblemon.cook_snack": "Sentez-Moi Ça !",
"advancements.cobblemon.cook_snack.description": "Préparez un Poké Snack, un délicieux gâteau capable d’attirer certains Pokémon selon les Baies utilisées",
"advancements.cobblemon.use_poke_bait": "Souvenirs D'Enfance",
"advancements.cobblemon.use_poke_bait.description": "Préparez un Poké Appât personnalisé dans une Marmite de Feu de Camp et utilisez-le pour ferrer un Pokémon",
"advancements.cobblemon.max_ride_stats": "Poké-Athlète, Médaille D'Or",
"advancements.cobblemon.max_ride_stats.description": "Maximisez les cinq statistiques de monture d’un Pokémon en lui donnant du Jus d’Abriko aromatisé\nDifférents profils de saveurs augmentent différentes statistiques",
"advancements.cobblemon.interact_with_pokemon": "Le Bonheur À Portée De Main",
"advancements.cobblemon.interact_with_pokemon.description": "Utilisez l’un de vos nombreux outils pour obtenir des ressources de votre Pokémon",
"advancements.cobblemon.slather_saccharine": "Juste Une Lichette",
"advancements.cobblemon.slather_saccharine.description": "Étalez un pot de miel sur le tronc d’un arbre Saccharine pour attirer l’apparition de certains Pokémon",
"gamerule.healersHealPC": "Soigne les Pokémon du PC lors de l’utilisation d’une Machine de Soin",
"tag.item.cobblemon.berries.colour.white": "Baies Blanches",
"tag.item.cobblemon.berries.colour.brown": "Baies Marrons",
"tag.item.cobblemon.berries.colour.red": "Baies Rouges",
"tag.item.cobblemon.berries.colour.orange": "Baies Oranges",
"tag.item.cobblemon.berries.colour.yellow": "Baies Jaunes",
"tag.item.cobblemon.berries.colour.lime": "Baies Vert Clair",
"tag.item.cobblemon.berries.colour.green": "Baies Vertes",
"tag.item.cobblemon.berries.colour.cyan": "Baies Cyan"
}
@@ -6270,7 +6270,7 @@
"cobblemon.ui.pc.search": "検索",
"cobblemon.ui.wallpapers": "壁紙",
"cobblemon.ui.interact.ride": "騎乗",
"cobblemon.ui.interact.give.cosmetic_item": "コスメティックアイテムの変更",
"cobblemon.ui.interact.give.cosmetic_item": "衣装アイテムの変更",
"item.cobblemon.syrupy_apple.tooltip": "とにかく 蜜入りの 不思議なりんご。カジッチュに使うと カミッチュに進化する。",
"cobblemon.fishing.no_bite": "釣れないなぁ……",
"cobblemon.ui.interact.request_already_expired": "そのリクエストはすでに期限切れです!",
@@ -7778,7 +7778,7 @@
"cobblemon.move.gmaxtartness.desc": "キョダイマックスした アップリューが 繰りだす くさタイプの 攻撃。 相手の 回避率を 下げる。",
"cobblemon.species.basculin-white.desc": "極寒の 海で 群れを 作り エサを 分け合って 暮らす。 時が 来ると 生まれた 川に 帰る。",
"cobblemon.species.landorus-therian.desc": "霊獣の姿にて 天翔けしとき 大地に 豊穣もたらす。 衆人 これを 敬う。 一刻あれば ヒスイの地を 縦断す。",
"cobblemon.ui.pokedex.info.form.greninja-bond": " ",
"cobblemon.ui.pokedex.info.form.greninja-bond": "きずなへんげ",
"cobblemon.species.vivillon-polar.desc": "生まれた 土地の 気候や 風土の 影響により 模様が 変わる。 降雪の 多い 土地の 姿。",
"cobblemon.species.vivillon-archipelago.desc": "生まれた 土地の 気候や 風土の 影響により 模様が 変わる。 島が 群れ成す 土地の 姿。",
"cobblemon.species.furfrou-diamond.desc": "ボサボサの 体毛を 刈りこむと 姿が 美しくなる だけでなく 身体の キレが 良くなるのだ。",
@@ -7921,7 +7921,7 @@
"cobblemon.species.arceus-ice.desc": "アルセウスの持つ つららのプレートには 文字が 刻まれている。 「そのもの じかん くうかんの 2ひき ぶんしんとして よに はなつ」",
"cobblemon.ui.pokedex.info.form.arceus-dragon": "アルセウスのすがた",
"cobblemon.ui.pokedex.info.form.arceus-dark": "アルセウスのすがた",
"cobblemon.species.arceus-dark.desc": "アルセウスの持つ りゅうのプレートには 文字が 刻まれている。 「そのもの じかん くうかんを つなぐ 3びきの ポケモンをも うみだす」",
"cobblemon.species.arceus-dark.desc": "アルセウスの持つ こわもてプレートには 文字が 刻まれている。 「2ひきに もの 3びきに こころ いのり うませ せかい かたちづくる」",
"cobblemon.ui.pokedex.info.form.arceus-fairy": "アルセウスのすがた",
"cobblemon.ui.pokedex.info.form.oshawott": " ",
"cobblemon.ui.pokedex.info.form.dewott": " ",
@@ -8068,8 +8068,8 @@
"cobblemon.ui.pokedex.info.form.zygarde": "50%フォルム",
"cobblemon.ui.pokedex.info.form.zygarde-10": "10%フォルム",
"cobblemon.species.zygarde-10.desc": "鋭い キバで 敵を 仕留める。 ずっと この身体を 維持 できず 一定時間で バラバラになる。",
"cobblemon.ui.pokedex.info.form.zygarde-10c": "10%フォルム",
"cobblemon.ui.pokedex.info.form.zygarde-50c": "50%フォルム",
"cobblemon.ui.pokedex.info.form.zygarde-10c": "10%(スワームチェンジ)",
"cobblemon.ui.pokedex.info.form.zygarde-50c": "50%(スワームチェンジ)",
"cobblemon.species.zygarde-50c.desc": "生態系を 脅かす ものと 戦うとき 更に 強力な 姿に 変化すると いわれる。",
"cobblemon.ui.pokedex.info.form.zygarde-complete": "パーフェクトフォルム",
"cobblemon.species.zygarde-complete.desc": "生態系を 脅かす者を 圧倒的な 力を 以て 制圧する ジガルデの 姿。",
@@ -8084,7 +8084,7 @@
"cobblemon.species.oricorio-pau.desc": "うすもものミツを 吸った オドリドリ。 踊っている ときは トレーナーの 指示が 聞こえないほど マイペース。",
"cobblemon.ui.pokedex.info.form.oricorio-sensu": "まいまいスタイル",
"cobblemon.ui.pokedex.info.form.rockruff": " ",
"cobblemon.ui.pokedex.info.form.rockruff-dusk": " ",
"cobblemon.ui.pokedex.info.form.rockruff-dusk": "マイペース",
"cobblemon.ui.pokedex.info.form.lycanroc": "まひるのすがた",
"cobblemon.ui.pokedex.info.form.lycanroc-midnight": "まよなかのすがた",
"cobblemon.species.lycanroc-midnight.desc": "気に入らない 命令は 平気で 無視。 相手を 仕留めるためなら 傷つくことも まるで 気にしない。",
@@ -8959,5 +8959,74 @@
"entity.cobblemon.chest_boat": "チェスト付きのボート",
"entity.cobblemon.npc": "NPC",
"entity.cobblemon.empty_pokeball": "空のモンスターボール",
"cobblemon.battle.activate.insomnia": "このポケモンは ふみんのため 眠ることができない!"
"cobblemon.battle.activate.insomnia": "このポケモンは ふみんのため 眠ることができない!",
"cobblemon.battle.sideend.ally.auroraveil": "味方の オーロラベールが なくなった!",
"cobblemon.battle.sideend.ally.toxicspikes": "味方の足元から どくびしが 消えた!",
"cobblemon.battle.sideend.opponent.auroraveil": "相手の オーロラベールが なくなった!",
"cobblemon.battle.sideend.opponent.lightscreen": "相手の ひかりのかべが なくなった!",
"cobblemon.battle.sideend.opponent.mist": "相手の しろいきりが なくなった!",
"cobblemon.battle.sideend.opponent.reflect": "相手の リフレクターが なくなった!",
"cobblemon.battle.block.aromaveil": "%1$sは アロマベールで 守られている!",
"cobblemon.battle.error.incorrect_actor_count": "現在の参加者は %1$s人だが %2%s人の参加者が 必要な ようだ",
"cobblemon.battle.error.no_party": "%1$sは バトルに出すための 手持ちのポケモンを 持っていないようだ",
"cobblemon.battle.enditem.focusband": "%1$sは きあいのハチマキで 持ちこたえた!",
"cobblemon.battle.enditem.focussash": "%1$sは きあいのタスキで 持ちこたえた!",
"cobblemon.battle.enditem.ejectpack": "%1$sは だっしゅつパックで 戻っていく!",
"cobblemon.battle.enditem.occaberry": "%1$sへの ダメージを オッカのみが 弱めた!",
"cobblemon.battle.enditem.passhoberry": "%1$sへの ダメージを イトケのみが 弱めた!",
"cobblemon.battle.enditem.chopleberry": "%1$sへの ダメージを ヨプのみが 弱めた!",
"cobblemon.battle.enditem.kebiaberry": "%1$sへの ダメージを ビアーのみが 弱めた!",
"cobblemon.battle.enditem.shucaberry": "%1$sへの ダメージを シュカのみが 弱めた!",
"cobblemon.battle.enditem.cobaberry": "%1$sへの ダメージを バコウのみが 弱めた!",
"cobblemon.battle.enditem.payapaberry": "%1$sへの ダメージを ウタンのみが 弱めた!",
"cobblemon.battle.enditem.chartiberry": "%1$sへの ダメージを ヨロギのみが 弱めた!",
"cobblemon.battle.enditem.kasibberry": "%1$sへの ダメージを カシブのみが 弱めた!",
"cobblemon.battle.enditem.habanberry": "%1$sへの ダメージを ハバンのみが 弱めた!",
"cobblemon.battle.enditem.babiriberry": "%1$sへの ダメージを リリバのみが 弱めた!",
"cobblemon.battle.enditem.chilanberry": "%1$sへの ダメージを ホズのみが 弱めた!",
"cobblemon.battle.formechange.default.temporary.ended": "%1$sは 元の姿に 戻った!",
"cobblemon.battle.formechange.mega": "%1$sが キーストーンに 共鳴した!",
"cobblemon.battle.formechange.ash": "%1$sは サトシゲッコウガに きずなへんげした!",
"cobblemon.battle.formechange.school": "%1$sは むれたすがたに なった!",
"cobblemon.battle.withdraw.other": "%1$sは %2$sを 引っ込めた!",
"cobblemon.battle.sideend.ally.lightscreen": "味方の ひかりのかべが なくなった!",
"cobblemon.battle.sideend.ally.reflect": "味方の リフレクターが なくなった!",
"cobblemon.battle.sideend.ally.spikes": "味方の足元から まきびしが 消えた!",
"cobblemon.battle.sideend.ally.safeguard": "味方の 神秘のベールが なくなった!",
"cobblemon.battle.sideend.opponent.stickyweb": "相手の足元から ねばねばネットが なくなった!",
"cobblemon.battle.enditem.wacanberry": "%1$sへの ダメージを ソクノのみが 弱めた!",
"cobblemon.battle.enditem.rindoberry": "%1$sへの ダメージを リンドのみが 弱めた!",
"cobblemon.battle.enditem.yacheberry": "%1$sへの ダメージを ヤチェのみが 弱めた!",
"cobblemon.battle.heal.bagitemrevive": "%1$sは ひんしから 回復した!",
"cobblemon.battle.heal.bagitemfullrestore": "%1$sの 体力が 回復した!",
"cobblemon.battle.formechange.minior": "%1$sの リミットシールド 発動!",
"cobblemon.battle.switch.other": "%1$s は %2$sを 繰り出した!",
"cobblemon.battle.enditem.tangaberry": "%1$sへの ダメージを タンガのみが 弱めた!",
"cobblemon.battle.withdraw.self": "%1$s、戻れ!",
"cobblemon.battle.sideend.opponent.luckychant": "相手の おまじないが 切れた!",
"cobblemon.battle.block.sweetveil": "%1$sは スイートベールで 眠れない!",
"cobblemon.battle.enditem.colburberry": "%1$sへの ダメージを ナモのみが 弱めた!",
"cobblemon.battle.enditem.roseliberry": "%1$sへの ダメージを ロゼルのみが 弱めた!",
"cobblemon.battle.formechange.wishiwashi": "%1$sの群れは どこかに行ってしまった...",
"cobblemon.battle.switch.other.nickname": "%1$s は %2$s (%3$s)を 繰り出した!",
"cobblemon.battle.sideend.ally.tailwind": "味方の おいかぜが 切れた!",
"cobblemon.battle.sideend.opponent.safeguard": "相手の 神秘のベールが なくなった!",
"cobblemon.battle.sideend.ally.stealthrock": "味方の足元から とがった岩が 消えた!",
"cobblemon.battle.sideend.ally.stickyweb": "味方の足元から ねばねばネットが なくなった!",
"cobblemon.battle.sideend.ally.luckychant": "味方の おまじないが 切れた!",
"cobblemon.battle.sideend.ally.mist": "味方の しろいきりが なくなった!",
"cobblemon.battle.sideend.opponent.tailwind": "相手の おいかぜが 切れた!",
"cobblemon.battle.sideend.opponent.spikes": "相手の足元から まきびしが なくなった!",
"cobblemon.battle.sideend.opponent.toxicspikes": "相手の足元から どくびしが なくなった!",
"cobblemon.battle.cant.nopp": "%1$sは %2$sを使うための PPが 足りない!",
"cobblemon.battle.end.neutralizinggas": "かがくへんかガスが なくなった!",
"cobblemon.battle.ability.replace": "%1$sは 特性が %2$sに変わった!",
"cobblemon.battle.formechange.default.temporary": "%1$s は %2$sフォルムに なった!",
"cobblemon.battle.formechange.default.permanent": "%1$s は %2$sに フォルムチェンジした!",
"cobblemon.battle.formechange.meteor": "%1$sの リミットシールド 解除!",
"cobblemon.battle.switch.self": "いけ! %1$s!",
"cobblemon.fishing_bait_effects.drops_reroll.tooltip": "%1$s%% - %3$s× ドロップ品リロール",
"cobblemon.requires_debug_keys": "この機能を使用するには、サーバーでデバッグキーを有効にする必要があります。",
"cobblemon.requires_permission": "この操作を行うには必要な権限がありません。",
"cobblemon.ui.stats.blocks_traveled": "ステップ"
}
File diff suppressed because it is too large. Load diff
@@ -511,7 +511,7 @@
"cobblemon.ui.starter.hasalreadychosen": "%1$s já escolheu um iniciante.",
"cobblemon.ui.starter.skippedchoosing": "Você ainda não escolheu um iniciante, mas já recebeu um Pokémon. Para selecionar seu inciante, coloque todos seus Pokémon em um PC e pressione \"%1$s\".",
"cobblemon.ui.starter.choose_starter_title": "Escolha o seu inicial!",
"cobblemon.ui.starter.choose_starter_description": "Pressiona a tecla \"%1$s\"",
"cobblemon.ui.starter.choose_starter_description": "Pressione a tecla \"%1$s\"",
"cobblemon.ui.starter.chooseyourstarter": "Pressione %1$s para escolher seu Pokémon e começar sua jornada!",
"cobblemon.ui.moves": "Ataques",
"cobblemon.ui.moves.switch": "Trocar Ataque",
@@ -5906,7 +5906,7 @@
"advancements.cobblemon.craft_rod.description": "使用宝可梦钓竿锻造模版制作一个宝可梦钓竿",
"advancements.cobblemon.use_bait": "非常好树果,使我线轮旋转",
"advancements.cobblemon.craft_master_rod.description": "使用大师球制作一个宝可梦钓竿",
"advancements.cobblemon.craft_master_rod": "慷慨带不来好运",
"advancements.cobblemon.craft_master_rod": "这将影响鲶鱼王的数量",
"advancements.cobblemon.craft_rod": "器渔轩昂",
"advancements.cobblemon.use_bait.description": "让你的宝可梦钓竿挂上一个树果诱饵",
"cobblemon.battle.center": "自动居中!",
@@ -8607,7 +8607,7 @@
"item.cobblemon.swift_mochi.tooltip": "提升宝可梦的速度基础点数4点",
"item.cobblemon.fresh_start_mochi": "净空粘糕",
"item.cobblemon.fresh_start_mochi.tooltip": "将宝可梦的全部基础点数清空",
"item.cobblemon.poke_bait": "宝可梦诱饵",
"item.cobblemon.poke_bait": "宝诱饵",
"item.cobblemon.aprijuice_blue": "蓝球果汁",
"item.cobblemon.aprijuice_green": "绿球果汁",
"item.cobblemon.aprijuice_pink": "粉球果汁",
@@ -8751,7 +8751,7 @@
"cobblemon.config.ui.maximum_spawning_zone_distance_from_player.tooltip": "宝可梦生成时,距玩家所需的最大方块数。",
"cobblemon.config.ui.maximum_spawns_per_pass": "单次生成最大数量",
"cobblemon.config.ui.despawner_far_distance.tooltip": "以玩家为中心的最大距离范围。在此范围之外,且存在时间超过最小活动时间的宝可梦会被系统移除。",
"advancements.cobblemon.resurrect_galar_fossil.description": "复活一只由化石鸟或化石鱼以及化石海兽或化石龙组成的宝可梦",
"advancements.cobblemon.resurrect_galar_fossil.description": "复活一只由化石鸟或化石鱼和化石海兽或化石龙组成的宝可梦",
"cobblemon.battle.sidestart.ally.auroraveil": "极光幕使我方的物理和特殊抗性提高了!",
"cobblemon.battle.sidestart.ally.safeguard": "我方被神秘之幕包围了!",
"cobblemon.battle.sidestart.opponent.auroraveil": "极光幕使对手的物理和特殊抗性提高了!",
@@ -9050,7 +9050,7 @@
"cobblemon.snapshots.warning.dont_show_again": "不再显示",
"cobblemon.snapshots.warning.dont_show_again_tip": "在较新的 方块宝可梦 快照中(例如 1.7.0 与 1.8.0),此设置可能会被忽略",
"key.cobblemon.toggleridingstatsgui": "切换骑乘能力界面",
"item.cobblemon.moomoo_milk.tooltip": "在战斗中使用时,会清除目标的能力变化。",
"item.cobblemon.moomoo_milk.tooltip": "在战斗中使用时,会清除目标的能力变化",
"cobblemon.config.ui.poke_snack_pokemon_per_chunk": "每个区块的宝点心宝可梦数量",
"cobblemon.config.ui.poke_snack_pokemon_per_chunk.tooltip": "通过宝点心生成时,区块中允许的宝可梦数量。",
"cobblemon.config.ui.summary_profile_animations.animate_selected.tooltip": "选中的宝可梦播放动画,除非已昏厥",
@@ -9105,5 +9105,25 @@
"cobblemon.seasoning_ride_boosts_info_header": "骑乘属性提升:",
"item.cobblemon.eggant_berry": "子茄果",
"cobblemon.entity.variable.look_at_entity_types.desc": "该实体将看向的实体类型。",
"cobblemon.entity.variable.look_at_entity_types.name": "看向实体类型"
"cobblemon.entity.variable.look_at_entity_types.name": "看向实体类型",
"cobblemon.fishing_bait_effects.drops_reroll.tooltip": "%1$s%% - %3$s× 额外掉落",
"cobblemon.requires_debug_keys": "必须在服务器上启用调试键才能使用此功能。",
"cobblemon.ui.stats.blocks_traveled": "步数",
"cobblemon.requires_permission": "你没有执行此操作的权限。",
"cobblemon.config.ui.default_key_items": "默认关键道具",
"cobblemon.config.ui.default_key_items.tooltip": "玩家默认拥有的关键道具。",
"advancements.cobblemon.cook_all_regional_delicacies": "世界美食之旅",
"item.cobblemon.eggant_berry.tooltip": "解除着迷状态",
"advancements.cobblemon.cook_all_regional_delicacies.description": "烹饪每种地区美食",
"advancements.cobblemon.cook_all_ev_mochi": "咭呗咭呗!",
"advancements.cobblemon.use_poke_bait.description": "在营火锅中准备一个自制的宝可梦诱饵,并使用它钓到一只宝可梦",
"advancements.cobblemon.max_ride_stats": "明星宝可竞技选手",
"advancements.cobblemon.max_ride_stats.description": "通过喂食不同风味的球果汁,将宝可梦宝可梦的五项坐骑能力提升至最高\n不同风味的球果汁会提升不同的能力",
"advancements.cobblemon.slather_saccharine": "只是一小口",
"advancements.cobblemon.cook_all_ev_mochi.description": "制作每一种口味的粘糕,这种美味点心可以影响宝可梦的基础点数",
"advancements.cobblemon.cook_snack": "诱人的香味",
"advancements.cobblemon.cook_snack.description": "烘焙一个宝点心,一种美味的蛋糕,可以根据使用的树果吸引特定的宝可梦",
"advancements.cobblemon.use_poke_bait": "那是诱饵",
"advancements.cobblemon.interact_with_pokemon": "牧场上的家",
"advancements.cobblemon.interact_with_pokemon.description": "使用你众多工具的一个,从你的宝可梦那里获取资源"
}
@@ -6433,7 +6433,7 @@
"item.cobblemon.smooth_rock.tooltip": "攜帶後,刮起沙暴的話,沙暴的時間就會比平常更長",
"item.cobblemon.icy_rock.tooltip": "攜帶後,將天氣變為下雪的話,下雪的時間就會比平常更長",
"item.cobblemon.energy_root.tooltip": "使一隻寶可夢回復80HP,同時降低它的親密度",
"item.cobblemon.revival_herb.tooltip": "使一隻昏厥的寶可夢回復全部HP,同時降低它的親密度",
"item.cobblemon.revival_herb.tooltip": "使一隻昏厥的寶可夢回復最大HP的25%,同時降低它的親密度",
"item.cobblemon.remedy.tooltip": "使一隻寶可夢回復20HP,同時小幅降低它的親密度",
"item.cobblemon.fine_remedy.tooltip": "使一隻寶可夢回復60HP,同時小幅降低它的親密度",
"item.cobblemon.superb_remedy.tooltip": "使一隻寶可夢回復120HP,同時小幅降低它的親密度",
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@@ -27,7 +27,7 @@
{
"type": "cobblemon:activity_change",
"activity": "minecraft:idle",
"condition": "q.entity.lacks_memory_value('cobblemon:has_nectar', 'cobblemon:nearby_flower') || (q.entity.has_memory_value('cobblemon:has_nectar') && (q.entity.lacks_memory_value('cobblemon:nearby_sacc_leaves', 'cobblemon:hive_location'))) || q.entity.has_memory_value('cobblemon:hive_cooldown')"
"condition": "q.entity.lacks_memory_value('cobblemon:has_nectar', 'cobblemon:nearby_flower') || (q.entity.has_memory_value('cobblemon:has_nectar') && (q.entity.lacks_memory_value('cobblemon:nearby_sacc_leaves', 'cobblemon:hive_location'))) || q.entity.has_memory_value('cobblemon:hive_cooldown') || ((q.entity.biome.is_in('#minecraft:is_overworld') && ((q.entity.world.time_of_day >= 13000 && q.entity.world.time_of_day <= 23000) || q.entity.world.is_raining)) && (q.entity.lacks_memory_value('cobblemon:hive_location')))"
},
{
"type": "cobblemon:activity_change",
@@ -62,7 +62,7 @@
{
"type": "cobblemon:activity_change",
"activity": "cobblemon:pokemon_pollination",
"condition": "(q.entity.has_memory_value('cobblemon:nearby_sacc_leaves') || q.entity.has_memory_value('cobblemon:hive_location')) && !q.entity.has_memory_value('cobblemon:hive_cooldown')"
"condition": "((q.entity.has_memory_value('cobblemon:nearby_sacc_leaves') || q.entity.has_memory_value('cobblemon:hive_location')) && !q.entity.has_memory_value('cobblemon:hive_cooldown'))"
}
],
"1": [
@@ -1,5 +1,5 @@
{
"pokemon": ["braixien", "delphox"],
"pokemon": ["braixen", "delphox"],
"cosmeticItems": [
{
"consumedItem": "cobblemon:silk_scarf",
@@ -5,7 +5,7 @@ q.entity.has_memory_value('cobblemon:hive_location') ? {
t.wander_control.set_path_cooldown_ticks(50);
};
q.entity.lacks_memory_value('cobblemon:hive_location') && q.entity.has_memory_value('cobblemon:nearby_sacc_leaves') ? {
t.position = q.entity.get_position_memory('cobblemon:hive_location');
t.position = q.entity.get_position_memory('cobblemon:nearby_sacc_leaves');
t.wander_control = q.entity.get_wander_control_memory();
t.wander_control.set_center(t.position.x, t.position.y, t.position.z, 2, 32);
t.wander_control.set_path_cooldown_ticks(50);
@@ -1,4 +1,5 @@
{
"implemented": true,
"nationalPokedexNumber": 676,
"name": "Furfrou",
"primaryType": "normal",
@@ -5,6 +5,6 @@
"#cobblemon:recipe_filters/effect_seasoning",
"#cobblemon:recipe_filters/flavour_seasoning",
"#cobblemon:recipe_filters/nutrition_seasoning",
"#cobblemon:recipe_filters/poke_puff_seasoner"
"#cobblemon:recipe_filters/poke_puff_seasoning"
]
}
@@ -35,7 +35,6 @@
"client.MouseHandlerMixin",
"client.OptionsMixin",
"client.PlayerRendererMixin",
"client.RecipeBookCategoriesMixin",
"client.RecipeBookComponentMixin",
"client.RecipeBookTabButtonMixin",
"client.RecipeCollectionMixin",
@@ -60,7 +59,6 @@
"EntitySkeletonMixin",
"EntityStorageMixin",
"EntityVillagerMixin",
"ExplosionMixin",
"ItemStackComponentizationFixMixin",
"LecternBlockMixin",
"LightningBoltMixin",
@@ -74,8 +72,6 @@
"PlayerMixin",
"PointedDripstoneBlockMixin",
"PowderSnowBlockMixin",
"RecipeBookSettingsMixin",
"RecipeBookTypeMixin",
"ServerEntityMixin",
"ServerLevelMixin",
"ServerPlayerMixin",
+1 -2
View File
@@ -6,8 +6,7 @@ PC box wallpapers have two sides, one on client and an optional one on server.
This involves adding the texture PNG file to the `assets/cobblemon/textures/gui/pc/wallpaper/` directory. The mod will trawl
this directory on asset load and form a base list. The client will send this list to the server to validate
the list, with the server returning a list of valid wallpapers. The client will then display the wallpapers in the GUI.
The emissive screen glow will be automatically generated using colour of the center pixel of the provided wallpaper.
For a custom screen glow, place the file in the `assets/cobblemon/textures/gui/pc/wallpaper/*/glow` directory with the same file name as the wallpaper.
The emissive screen glow is an optional asset. To add one, place the file in the `assets/cobblemon/textures/gui/pc/wallpaper/*/glow` directory with the same file name as the wallpaper.
An optional, alternate wallpaper can also be provided. This should be similar to the main wallpaper as it will share the custom glow if one is provided. This alternate wallpaper will be shown, replacing the main wallpaper, when holding the Shift key while the wallpaper selection list is open in the PC interface. To add an alternate wallpaper, place the file in the `assets/cobblemon/textures/gui/pc/wallpaper/*/alt` directory with the same file name as the main wallpaper.
+8
View File
@@ -38,6 +38,7 @@ repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven(url = "https://api.modrinth.com/maven")
maven(url = "https://maven.terraformersmc.com/")
maven(url = "https://api.modrinth.com/maven")
}
dependencies {
@@ -58,6 +59,13 @@ dependencies {
modImplementation(libs.bundles.fabric.integrations.implementation)
modRuntimeOnly(libs.bundles.fabric.integrations.runtimeOnly)
modImplementation("maven.modrinth:flashback:0.38.2-fabric,1.21.1")
// Lattice (config)
modImplementation("com.moulberry:lattice:1.2.18") {
attributes {
attribute(Attribute.of("earth.terrarium.cloche.modLoader", String::class.java), "fabric")
}
}
// modImplementation(libs.flywheelFabric)
// include(libs.flywheelFabric)
@@ -6,10 +6,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.mixin.client;
package com.cobblemon.mod.fabric.mixin;
import com.cobblemon.mod.common.CobblemonItems;
import com.cobblemon.mod.common.CobblemonRecipeBookTypes;
import com.cobblemon.mod.common.CobblemonRecipeCategories;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.RecipeBookCategories;
@@ -49,17 +50,19 @@ public class RecipeBookCategoriesMixin {
)
private static void cobblemon$addRecipeBookType(CallbackInfo ci) {
ArrayList<RecipeBookCategories> types = new ArrayList<>(List.of($VALUES));
types.add(cobblemon$createCategory("COOKING_POT_SEARCH", $VALUES.length, new ItemStack(Items.COMPASS)));
types.add(cobblemon$createCategory("COOKING_POT_FOODS", $VALUES.length + 1, new ItemStack(CobblemonItems.LEEK_AND_POTATO_STEW)));
types.add(cobblemon$createCategory("COOKING_POT_MEDICINES", $VALUES.length + 2, new ItemStack(CobblemonItems.POTION)));
types.add(cobblemon$createCategory("COOKING_POT_COMPLEX_DISHES", $VALUES.length + 3, new ItemStack(CobblemonItems.APRIJUICE_RED)));
types.add(cobblemon$createCategory("COOKING_POT_MISC", $VALUES.length + 4, new ItemStack(CobblemonItems.PROTEIN)));
// if you change or add any of these, neoforge uses a separate mechanism
// check enumextensions.json and `CobblemonEnumExtensions`
types.add(cobblemon$createCategory("COBBLEMON_COOKING_POT_SEARCH", $VALUES.length, new ItemStack(Items.COMPASS)));
types.add(cobblemon$createCategory("COBBLEMON_COOKING_POT_FOODS", $VALUES.length + 1, new ItemStack(CobblemonItems.LEEK_AND_POTATO_STEW)));
types.add(cobblemon$createCategory("COBBLEMON_COOKING_POT_MEDICINES", $VALUES.length + 2, new ItemStack(CobblemonItems.POTION)));
types.add(cobblemon$createCategory("COBBLEMON_COOKING_POT_COMPLEX_DISHES", $VALUES.length + 3, new ItemStack(CobblemonItems.APRIJUICE_RED)));
types.add(cobblemon$createCategory("COBBLEMON_COOKING_POT_MISC", $VALUES.length + 4, new ItemStack(CobblemonItems.PROTEIN)));
$VALUES = types.toArray(RecipeBookCategories[]::new);
}
@Inject(method = "getCategories", at = @At("HEAD"), cancellable = true)
private static void modifyCategories(RecipeBookType recipeBookType, CallbackInfoReturnable<List<RecipeBookCategories>> cir) {
if (recipeBookType == RecipeBookType.valueOf("COOKING_POT")) {
if (recipeBookType == CobblemonRecipeBookTypes.INSTANCE.getCOOKING_POT()) {
List var10000 = ImmutableList.of(
CobblemonRecipeCategories.COOKING_POT_SEARCH.toVanillaCategory(),
CobblemonRecipeCategories.COOKING_POT_FOODS.toVanillaCategory(),
@@ -8,25 +8,42 @@
package com.cobblemon.mod.fabric.mixin;
import com.cobblemon.mod.common.CobblemonRecipeBookTypes;
import net.minecraft.stats.RecipeBookSettings;
import net.minecraft.world.inventory.RecipeBookType;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.Arrays;
import java.util.Map;
@Mixin(RecipeBookSettings.class)
public class RecipeBookSettingsMixin {
@Shadow
@Final
public Map<RecipeBookType, RecipeBookSettings.TypeSettings> states;
@Inject(method = "<init>(Ljava/util/Map;)V", at = @At("TAIL"))
private void cobblemon$init(CallbackInfo ci) {
// if you change or add any of these, neoforge uses a separate mechanism
// check enumextensions.json and `CobblemonEnumExtensions`
states.put(CobblemonRecipeBookTypes.INSTANCE.getCOOKING_POT(), new RecipeBookSettings.TypeSettings(true, true));
}
// this fixes a disconnect issue with vanilla servers where the network sync relies on the enum we modify in a common mixin to be the same on both sides
@Redirect( method = "read(Lnet/minecraft/network/FriendlyByteBuf;)Lnet/minecraft/stats/RecipeBookSettings;", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/inventory/RecipeBookType;values()[Lnet/minecraft/world/inventory/RecipeBookType;"))
private static RecipeBookType[] cobblemon$valuesReadRedirect() {
return Arrays.stream(RecipeBookType.values()).filter( recipeBookType -> !RecipeBookType.valueOf("COOKING_POT").equals(recipeBookType) ).toArray(RecipeBookType[]::new);
return Arrays.stream(RecipeBookType.values()).filter( recipeBookType -> !CobblemonRecipeBookTypes.INSTANCE.getCOOKING_POT().equals(recipeBookType) ).toArray(RecipeBookType[]::new);
}
@Redirect( method = "write(Lnet/minecraft/network/FriendlyByteBuf;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/inventory/RecipeBookType;values()[Lnet/minecraft/world/inventory/RecipeBookType;"))
private RecipeBookType[] cobblemon$valuesWriteRedirect() {
return Arrays.stream(RecipeBookType.values()).filter( recipeBookType -> !RecipeBookType.valueOf("COOKING_POT").equals(recipeBookType) ).toArray(RecipeBookType[]::new);
return Arrays.stream(RecipeBookType.values()).filter( recipeBookType -> !CobblemonRecipeBookTypes.INSTANCE.getCOOKING_POT().equals(recipeBookType) ).toArray(RecipeBookType[]::new);
}
}
@@ -6,8 +6,9 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.mixin;
package com.cobblemon.mod.fabric.mixin;
import com.cobblemon.mod.common.CobblemonRecipeBookTypes;
import net.minecraft.world.inventory.RecipeBookType;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -40,7 +41,9 @@ public class RecipeBookTypeMixin {
)
private static void cobblemon$addRecipeBookType(CallbackInfo ci) {
ArrayList<RecipeBookType> types = new ArrayList<>(List.of($VALUES));
types.add(cobblemon$createBookType("COOKING_POT", $VALUES.length));
// if you change or add any of these, neoforge uses a separate mechanism
// check enumextensions.json and `CobblemonEnumExtensions`
types.add(cobblemon$createBookType(CobblemonRecipeBookTypes.COOKING_POT_NAME, $VALUES.length));
$VALUES = types.toArray(RecipeBookType[]::new);
}
}
@@ -0,0 +1,45 @@
/*
* 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.fabric.mixin.compat;
import com.cobblemon.mod.common.duck.PlayerDuck;
import com.cobblemon.mod.common.net.messages.client.orientation.ClientboundUpdateDriverInputPacket;
import com.llamalad7.mixinextras.sugar.Local;
import com.moulberry.flashback.record.Recorder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.world.entity.player.Player;
import org.joml.Vector3f;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
@Mixin(Recorder.class)
public abstract class RecorderMixin {
@Inject(method = "writeLocalData()V", at = @At(value = "INVOKE", target = "Lcom/moulberry/flashback/io/AsyncReplaySaver;writeGamePackets(Lnet/minecraft/network/codec/StreamCodec;Ljava/util/List;)V"))
public void cobblemon$writeLocalData(
CallbackInfo ci,
@Local(name = "gamePackets") List<Packet<? super ClientGamePacketListener>> gamePackets
) {
// The server will not send a ClientboundUpdateDriverInputPacket to the player that initially set the driver input
// so Flashback needs to save that data itself. For stuff like players holding space on Pokemon mounts
LocalPlayer player = Minecraft.getInstance().player;
if (player == null) return;
// Gather driver Input
float vertInput = player.jumping ? 1.0f : (player.isShiftKeyDown() ? -1.0f : 0.0f);
Vector3f driverInput = new Vector3f(Math.signum(player.xxa), vertInput, Math.signum(player.zza));
gamePackets.add(new ClientboundCustomPayloadPacket(new ClientboundUpdateDriverInputPacket(driverInput, player.getId())));
}
}
@@ -0,0 +1,106 @@
/*
* 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.fabric.mixin.compat;
import com.cobblemon.mod.common.api.mark.Mark;
import com.cobblemon.mod.common.api.mark.Marks;
import com.cobblemon.mod.common.api.pokeball.PokeBalls;
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnExtraDataEntityPacket;
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnPokemonPacket;
import com.cobblemon.mod.common.pokeball.PokeBall;
import com.cobblemon.mod.common.pokemon.Pokemon;
import com.cobblemon.mod.common.pokemon.Species;
import com.moulberry.flashback.playback.ReplayGamePacketHandler;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.client.Minecraft;
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
import net.minecraft.network.protocol.game.ClientboundSetPassengersPacket;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
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;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
@Mixin(ReplayGamePacketHandler.class)
public abstract class ReplayGamePacketHandlerMixin {
@Shadow
public abstract void handleAddEntity(ClientboundAddEntityPacket clientboundAddEntityPacket);
@Shadow
public abstract ServerLevel level();
@Shadow(remap = false)
private Int2ObjectMap<Entity> pendingEntities;
@Inject(method = "handleCustomPayload", at = @At("HEAD"))
public void cobblemon$handleSpawnEntityWithExtraData(ClientboundCustomPayloadPacket packet, CallbackInfo ci) {
if (packet.payload() instanceof SpawnExtraDataEntityPacket<?, ?> cobblemonPacket) {
ClientboundAddEntityPacket addEntityPacket = cobblemonPacket.getVanillaSpawnPacket();
this.handleAddEntity(addEntityPacket);
Entity entity = pendingEntities.get(addEntityPacket.getId());
if (entity instanceof PokemonEntity pokemonEntity && cobblemonPacket instanceof SpawnPokemonPacket spawnPokemonPacket) {
Pokemon pokemon = pokemonEntity.getPokemon();
pokemon.setUuid(spawnPokemonPacket.getPokemonUUID());
Species species = Optional.ofNullable(PokemonSpecies.INSTANCE.getByIdentifier(spawnPokemonPacket.getSpeciesId()))
.orElse(PokemonSpecies.INSTANCE.random());
pokemon.setSpecies(species);
pokemon.setScaleModifier(spawnPokemonPacket.getScaleModifier());
pokemon.setGender(spawnPokemonPacket.getGender());
pokemon.setShiny(spawnPokemonPacket.getShiny());
pokemon.setForm(pokemon.getSpecies().getFormByShowdownId(spawnPokemonPacket.getFormName()));
pokemon.setForcedAspects(spawnPokemonPacket.getAspects());
pokemon.setNickname(spawnPokemonPacket.getNickname());
ResourceLocation markId = spawnPokemonPacket.getMark();
if (markId != null) {
pokemon.setActiveMark(Marks.INSTANCE.getByIdentifier(spawnPokemonPacket.getMark()));
}
PokeBall caughtBall = PokeBalls.INSTANCE.getPokeBall(spawnPokemonPacket.getCaughtBall());
if (caughtBall != null) {
pokemon.setCaughtBall(caughtBall);
}
}
}
}
@Inject(method = "handleSetEntityPassengersPacket", at = @At("HEAD"), cancellable = true)
public void cobblemon$handleSetEntityPassengersPacket(ClientboundSetPassengersPacket packet, CallbackInfo ci) {
Entity entity = this.level().getEntity(packet.getVehicle());
if (entity instanceof PokemonEntity pokemon) {
var passengers = new ArrayList<Entity>();
for (int passenger : packet.getPassengers()) {
passengers.add(this.level().getEntity(passenger));
}
Arrays
.stream(pokemon.getOccupiedSeats())
.filter(x -> !passengers.contains(x))
.filter(Objects::nonNull)
.forEach(Entity::stopRiding);
var occupiedSeats = Arrays.asList(pokemon.getOccupiedSeats());
passengers.stream()
.filter(x -> !occupiedSeats.contains(x))
.filter(Objects::nonNull)
.forEach(x -> x.startRiding(pokemon, true));
ci.cancel();
}
}
}
@@ -8,13 +8,17 @@
"FabricCameraMixin",
"GameRendererMixin",
"GuiMixin",
"pokeball.ModelLoaderMixin"
"RecipeBookCategoriesMixin",
"pokeball.ModelLoaderMixin",
"compat.ReplayGamePacketHandlerMixin",
"compat.RecorderMixin"
],
"mixins": [
"EntityMixin",
"FabricBrewingStandMenuMixin",
"FabricSoundEngineMixin",
"PlayerMixin",
"RecipeBookSettingsMixin"
"RecipeBookSettingsMixin",
"RecipeBookTypeMixin"
]
}
+1 -1
View File
@@ -100,7 +100,7 @@ kotlin = [ "kotlin-stdlib", "kotlin-reflect" ]
fabric = [ "fabric-kotlin", "fabric-permissions" ]
common-integrations-compileOnly = [ "adorn-fabric", "jei-api" ]
fabric-integrations-implementation = [ "mod-menu" ]
fabric-integrations-runtimeOnly = [ "jei-fabric", "c2me-fabric" ]
fabric-integrations-runtimeOnly = [ "jei-fabric" ]
neoforge-integrations-runtimeOnly = [ "jei-neoforge", "c2me-neoforge" ]
mongo = [ "mongo-driver-core", "mongo-driver-sync" ]
unitTesting = [ "junit-fabric", "junit-params", "mockito-core", "mock-kotlin", "classgraph" ]
@@ -0,0 +1,38 @@
/*
* 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.neoforge
import com.cobblemon.mod.common.CobblemonItems
import net.minecraft.client.RecipeBookCategories
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.neoforged.fml.common.asm.enumextension.EnumProxy
import java.util.List
import java.util.function.Supplier
// to learn more about this, read https://docs.neoforged.net/docs/1.21.1/advanced/extensibleenums/#iextensibleenum
// this is the preferred way instead of mixining in ourselves, as it preserves mod compatibility
object CobblemonEnumExtensions {
@JvmField
val COOKING_POT_SEARCH = EnumProxy(RecipeBookCategories::class.java,
Supplier<List<ItemStack>> { listOf(ItemStack(Items.COMPASS)) as List<ItemStack> })
@JvmField
val COOKING_POT_FOODS = EnumProxy(RecipeBookCategories::class.java,
Supplier<List<ItemStack>> { listOf(ItemStack(CobblemonItems.LEEK_AND_POTATO_STEW)) as List<ItemStack> })
@JvmField
val COOKING_POT_MEDICINES = EnumProxy(RecipeBookCategories::class.java,
Supplier<List<ItemStack>> { listOf(ItemStack(CobblemonItems.POTION)) as List<ItemStack> })
@JvmField
val COOKING_POT_COMPLEX_DISHES = EnumProxy(RecipeBookCategories::class.java,
Supplier<List<ItemStack>> { listOf(ItemStack(CobblemonItems.APRIJUICE_RED)) as List<ItemStack> })
@JvmField
val COOKING_POT_MISC = EnumProxy(RecipeBookCategories::class.java,
Supplier<List<ItemStack>> { listOf(ItemStack(CobblemonItems.PROTEIN)) as List<ItemStack> })
}
@@ -9,6 +9,11 @@
package com.cobblemon.mod.neoforge
import com.cobblemon.mod.common.*
import com.cobblemon.mod.common.CobblemonRecipeCategories.COOKING_POT_COMPLEX_DISHES
import com.cobblemon.mod.common.CobblemonRecipeCategories.COOKING_POT_FOODS
import com.cobblemon.mod.common.CobblemonRecipeCategories.COOKING_POT_MEDICINES
import com.cobblemon.mod.common.CobblemonRecipeCategories.COOKING_POT_MISC
import com.cobblemon.mod.common.CobblemonRecipeCategories.COOKING_POT_SEARCH
import com.cobblemon.mod.common.advancement.CobblemonCriteria
import com.cobblemon.mod.common.advancement.predicate.CobblemonEntitySubPredicates
import com.cobblemon.mod.common.api.net.serializers.IdentifierDataSerializer
@@ -74,6 +79,7 @@ import net.neoforged.fml.ModList
import net.neoforged.fml.common.Mod
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent
import net.neoforged.fml.loading.FMLEnvironment
import net.neoforged.neoforge.client.event.RegisterRecipeBookCategoriesEvent
import net.neoforged.neoforge.common.ItemAbilities
import net.neoforged.neoforge.common.NeoForge
import net.neoforged.neoforge.common.NeoForgeMod
@@ -118,6 +124,7 @@ class CobblemonNeoForge : CobblemonImplementation {
addListener(networkManager::registerMessages)
addListener(EventPriority.HIGH, ::onBuildContents)
addListener(::onAddPackFindersEvent)
addListener(::loadRecipeCategory)
}
with(NeoForge.EVENT_BUS) {
addListener(::onDataPackSync)
@@ -479,6 +486,19 @@ class CobblemonNeoForge : CobblemonImplementation {
}
}
private fun loadRecipeCategory(e: RegisterRecipeBookCategoriesEvent) {
e.registerBookCategories(CobblemonRecipeBookTypes.COOKING_POT, listOf(
COOKING_POT_SEARCH.toVanillaCategory(),
COOKING_POT_FOODS.toVanillaCategory(),
COOKING_POT_MISC.toVanillaCategory(),
COOKING_POT_MEDICINES.toVanillaCategory(),
COOKING_POT_COMPLEX_DISHES.toVanillaCategory()
))
CobblemonRecipeCategories.customAggregateCategories.forEach { bookType ->
e.registerAggregateCategory(bookType.key, bookType.value)
}
}
private fun onLootTableLoad(e: LootTableLoadEvent) {
LootInjector.attemptInjection(e.name) { builder -> e.table.addPool(builder.build()) }
}
@@ -0,0 +1,55 @@
{
"entries": [
{
"enum": "net/minecraft/world/inventory/RecipeBookType",
"name": "COBBLEMON_COOKING_POT",
"constructor": "()V",
"parameters": []
},
{
"enum": "net/minecraft/client/RecipeBookCategories",
"name": "COBBLEMON_COOKING_POT_SEARCH",
"constructor": "(Ljava/util/function/Supplier;)V",
"parameters": {
"class": "com/cobblemon/mod/neoforge/CobblemonEnumExtensions",
"field": "COOKING_POT_SEARCH"
}
},
{
"enum": "net/minecraft/client/RecipeBookCategories",
"name": "COBBLEMON_COOKING_POT_FOODS",
"constructor": "(Ljava/util/function/Supplier;)V",
"parameters": {
"class": "com/cobblemon/mod/neoforge/CobblemonEnumExtensions",
"field": "COOKING_POT_FOODS"
}
},
{
"enum": "net/minecraft/client/RecipeBookCategories",
"name": "COBBLEMON_COOKING_POT_MEDICINES",
"constructor": "(Ljava/util/function/Supplier;)V",
"parameters": {
"class": "com/cobblemon/mod/neoforge/CobblemonEnumExtensions",
"field": "COOKING_POT_MEDICINES"
}
},
{
"enum": "net/minecraft/client/RecipeBookCategories",
"name": "COBBLEMON_COOKING_POT_COMPLEX_DISHES",
"constructor": "(Ljava/util/function/Supplier;)V",
"parameters": {
"class": "com/cobblemon/mod/neoforge/CobblemonEnumExtensions",
"field": "COOKING_POT_COMPLEX_DISHES"
}
},
{
"enum": "net/minecraft/client/RecipeBookCategories",
"name": "COBBLEMON_COOKING_POT_MISC",
"constructor": "(Ljava/util/function/Supplier;)V",
"parameters": {
"class": "com/cobblemon/mod/neoforge/CobblemonEnumExtensions",
"field": "COOKING_POT_MISC"
}
}
]
}
@@ -14,7 +14,7 @@ authors="The Cobblemon Team"
description='''
Adds Pokémon to the world, letting you find, battle, capture, and evolve them.
'''
enumExtensions="META-INF/enumextensions.json"
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/