-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Add missing allay and warden memories + refactor memory modules + …
…add docs Combined all memory module types into one file, since memory modules are often shared between multiple entity types, not using inheritance, which is how the other files are structured.
- Loading branch information
Showing
13 changed files
with
298 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,310 @@ | ||
use ::java::server::util::global_pos::GlobalPos | ||
|
||
struct TimedMemory { | ||
/// Ticks before this memory is removed. | ||
struct Memories { | ||
[#[id="memory_module_type"] string]: minecraft:memory_module[[%key]], | ||
} | ||
|
||
struct ExpirableValue { | ||
/// If present, ticks before this memory is automatically removed. | ||
#[since="1.16"] | ||
ttl: long, | ||
ttl?: long, | ||
} | ||
|
||
// Memory modules that are not dispatched do not have a codec and are not serialized in-game | ||
dispatch minecraft:memory_module[%unknown] to () | ||
|
||
dispatch minecraft:memory_module[home] to struct Home { | ||
...ExpirableValue, | ||
// Position of the villager's home. | ||
value: GlobalPos, | ||
} | ||
|
||
dispatch minecraft:memory_module[job_site] to struct JobSite { | ||
...ExpirableValue, | ||
// Position of the villager's job site. | ||
value: GlobalPos, | ||
} | ||
|
||
dispatch minecraft:memory_module[potential_job_site] to struct PotentialJobSite { | ||
...ExpirableValue, | ||
// Position of a potential job site of the villager. | ||
value: GlobalPos, | ||
} | ||
|
||
dispatch minecraft:memory_module[meeting_point] to struct MeetingPoint { | ||
...ExpirableValue, | ||
// Position of the villager's meeting point. | ||
value: GlobalPos, | ||
} | ||
|
||
struct FlagMemory { | ||
dispatch minecraft:memory_module[golem_detected_recently] to struct GolemDetectedRecently { | ||
...ExpirableValue, | ||
// Whether the villager has detected an iron golem recently. | ||
value: boolean, | ||
} | ||
|
||
struct TimedFlagMemory { | ||
...TimedMemory, | ||
dispatch minecraft:memory_module[danger_detected_recently] to struct DangerDetectedRecently { | ||
...ExpirableValue, | ||
// Whether the armadillo has detected danger recently. | ||
value: boolean, | ||
} | ||
|
||
struct TimedEntityMemory { | ||
...TimedMemory, | ||
/// Target entity's UUID. | ||
value: int[] @ 4, | ||
dispatch minecraft:memory_module[last_slept] to struct LastSlept { | ||
...ExpirableValue, | ||
// The gametime tick that the villager last slept in a bed. | ||
value: long, | ||
} | ||
|
||
struct TickMemory { | ||
/// Tick value | ||
dispatch minecraft:memory_module[last_woken] to struct LastWoken { | ||
...ExpirableValue, | ||
// The gametime tick that the villager last woke up from a bed. | ||
value: long, | ||
} | ||
|
||
struct PositionMemory { | ||
/// Position | ||
dispatch minecraft:memory_module[last_worked_at_poi] to struct LastWorkedAtPoi { | ||
...ExpirableValue, | ||
// The gametime tick that the villager last worked at their job site. | ||
value: long, | ||
} | ||
|
||
dispatch minecraft:memory_module[play_dead_ticks] to struct PlayDeadTicks { | ||
...ExpirableValue, | ||
/// Ticks until the axolotl stops playing dead. | ||
value: int, | ||
} | ||
|
||
dispatch minecraft:memory_module[temptation_cooldown_ticks] to struct TemptationCooldownTicks { | ||
...ExpirableValue, | ||
// Ticks before the mob can be tempted again. | ||
value: int, | ||
} | ||
|
||
dispatch minecraft:memory_module[gaze_cooldown_ticks] to struct GazeCooldownTicks { | ||
...ExpirableValue, | ||
// Ticks before the armadillo or camel can randomly look around again. | ||
value: int, | ||
} | ||
|
||
dispatch minecraft:memory_module[is_tempted] to struct IsTempted { | ||
...ExpirableValue, | ||
/// Whether the mob is currently tempted by a player. | ||
value: boolean, | ||
} | ||
|
||
dispatch minecraft:memory_module[long_jump_cooling_down] to struct LongJumpCoolingDown { | ||
...ExpirableValue, | ||
/// Ticks before the goat can long jump again. | ||
value: int, | ||
} | ||
|
||
dispatch minecraft:memory_module[has_hunting_cooldown] to struct HasHuntingCooldown { | ||
...ExpirableValue, | ||
// Whether the axolotl is in a hunting cooldown. | ||
value: boolean, | ||
} | ||
|
||
dispatch minecraft:memory_module[ram_cooldown_ticks] to struct RamCooldownTicks { | ||
...ExpirableValue, | ||
// Ticks before the goat can ram again. | ||
value: int, | ||
} | ||
|
||
dispatch minecraft:memory_module[is_in_water] to struct IsInWater { | ||
...ExpirableValue, | ||
/// Whether the frog is currently in water. | ||
value: struct {} | ||
} | ||
|
||
dispatch minecraft:memory_module[is_pregnant] to struct IsPregnant { | ||
...ExpirableValue, | ||
/// Whether the frog is pregnant. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[is_panicking] to struct IsPanicking { | ||
...ExpirableValue, | ||
// Whether the mob is currently panicking. | ||
value: boolean, | ||
} | ||
|
||
dispatch minecraft:memory_module[angry_at] to struct AngryAt { | ||
...ExpirableValue, | ||
/// The target of the piglin or piglin brute. | ||
value: #[uuid] int[] @ 4, | ||
} | ||
|
||
dispatch minecraft:memory_module[universal_anger] to struct UniversalAnger { | ||
...ExpirableValue, | ||
// Whether the piglin is being universally angered. Only used when the `universalAnger` gamerule is enabled. | ||
value: boolean, | ||
} | ||
|
||
dispatch minecraft:memory_module[admiring_item] to struct AdmiringItem { | ||
...ExpirableValue, | ||
/// Whether the piglin is currently admiring an item. | ||
value: boolean, | ||
} | ||
|
||
dispatch minecraft:memory_module[admiring_disabled] to struct AdmiringDisable { | ||
...ExpirableValue, | ||
/// Whether the piglin cannot admire an item. | ||
/// Set when converting, when attacked, or when admiring an item. | ||
value: boolean, | ||
} | ||
|
||
dispatch minecraft:memory_module[hunted_recently] to struct HuntedRecently { | ||
...ExpirableValue, | ||
/// Whether the piglin just hunted recently. | ||
/// Set after hunting or spawning in a bastion remnant. | ||
value: boolean, | ||
} | ||
|
||
dispatch minecraft:memory_module[recent_projectile] to struct RecentProjectile { | ||
...ExpirableValue, | ||
// Whether the warden has recently noticed a projectile vibration. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[is_sniffing] to struct IsSniffing { | ||
...ExpirableValue, | ||
// Whether the warden or sniffer is currently sniffing. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[is_emerging] to struct IsEmerging { | ||
...ExpirableValue, | ||
// Whether the warden is currently emerging from the ground. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[roar_sound_delay] to struct RoarSoundDelay { | ||
...ExpirableValue, | ||
// If present, the warden doesn't roar. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[dig_cooldown] to struct DigCooldown { | ||
...ExpirableValue, | ||
// If present, the warden will not dig down. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[roar_sound_cooldown] to struct RoarSoundCooldown { | ||
...ExpirableValue, | ||
// If present, the warden doesn't roar. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[sniff_cooldown] to struct SniffCooldown { | ||
...ExpirableValue, | ||
// If present, the warden or sniffer will not sniff. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[touch_cooldown] to struct TouchCooldown { | ||
...ExpirableValue, | ||
// If present, the warden will not react to being pushed by another mob. Set to 20 when touched. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[vibration_cooldown] to struct VibrationCooldown { | ||
...ExpirableValue, | ||
// If present, the warden will not react to vibrations. Set to 40 when receiving a vibration. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[sonic_boom_cooldown] to struct SonicBoomCooldown { | ||
...ExpirableValue, | ||
// If present, the warden will not use the sonic boom attack. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[sonic_boom_sound_cooldown] to struct SonicBoomSoundCooldown { | ||
...ExpirableValue, | ||
// If present, the warden's sonic boom animation will not spawn particles and play sounds. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[sonic_boom_sound_delay] to struct SonicBoomSoundDelay { | ||
...ExpirableValue, | ||
// If present, will delay the warden's sonic boom animation. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[liked_player] to struct LikedPlayer { | ||
...ExpirableValue, | ||
/// The UUID of the player entity that the allay likes. | ||
value: #[uuid] int[] @ 4, | ||
} | ||
|
||
dispatch minecraft:memory_module[liked_noteblock] to struct LikedNoteblock { | ||
...ExpirableValue, | ||
/// The position and dimension of the note block that the allay likes. | ||
value: GlobalPos, | ||
} | ||
|
||
dispatch minecraft:memory_module[liked_noteblock_cooldown_ticks] to struct LikedNoteblockCooldownTicks { | ||
...ExpirableValue, | ||
/// Ticks before the allay stops putting items at the liked note block. | ||
value: int, | ||
} | ||
|
||
dispatch minecraft:memory_module[item_pickup_cooldown_ticks] to struct ItemPickupCooldownTicks { | ||
...ExpirableValue, | ||
/// Ticks before the allay goes to pick up an item again. | ||
value: int, | ||
} | ||
|
||
dispatch minecraft:memory_module[sniffer_explored_positions] to struct SnifferExploredPositions { | ||
...ExpirableValue, | ||
/// Last 20 block positions that the sniffer has dug up. The sniffer will not dig in these positions. | ||
value: [int[] @ 3] @ ..20, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_jump_cooldown] to struct BreezeJumpCooldown { | ||
...ExpirableValue, | ||
// If present, the breeze will not long jump or slide. Set after performing a long jump. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_shoot] to struct BreezeShoot { | ||
...ExpirableValue, | ||
// If present, the breeze is able to shoot a wind charge, and will not long jump or slide. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_shoot_charging] to struct BreezeShootCharging { | ||
...ExpirableValue, | ||
// If present, the breeze will not shoot a wind charge. Set when starting to shoot. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_shoot_recover] to struct BreezeShootRecover { | ||
...ExpirableValue, | ||
// If present, the breeze will not shoot a wind charge. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_shoot_cooldown] to struct BreezeShootCooldown { | ||
...ExpirableValue, | ||
// If present, the breeze will not shoot a wind charge. Set after shooting | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_jump_inhaling] to struct BreezeJumpInhaling { | ||
...ExpirableValue, | ||
// If present, the breeze will not long jump or shoot a wind charge when stuck. | ||
value: struct {}, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_jump_target] to struct BreezeJumpTarget { | ||
...ExpirableValue, | ||
/// The block position that the breeze is jumping towards. | ||
value: int[] @ 3, | ||
} | ||
|
||
dispatch minecraft:memory_module[breeze_leaving_water] to struct BreezeLeavingWater { | ||
...ExpirableValue, | ||
// If present, the breeze is in water. | ||
value: struct {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.