2021-01-27 21:26:19 +00:00
|
|
|
#include <libreborn/libreborn.h>
|
2021-09-12 03:18:12 +00:00
|
|
|
#include <symbols/minecraft.h>
|
2020-12-02 23:18:49 +00:00
|
|
|
|
|
|
|
#include "../feature/feature.h"
|
|
|
|
#include "../init/init.h"
|
|
|
|
|
2021-06-30 23:41:18 +00:00
|
|
|
// Animated Water
|
2020-12-02 23:18:49 +00:00
|
|
|
static void Minecraft_tick_injection(unsigned char *minecraft, int32_t param_1, int32_t param_2) {
|
|
|
|
// Call Original Method
|
|
|
|
(*Minecraft_tick)(minecraft, param_1, param_2);
|
|
|
|
|
|
|
|
// Tick Dynamic Textures
|
2020-12-18 03:22:56 +00:00
|
|
|
unsigned char *textures = *(unsigned char **) (minecraft + Minecraft_textures_property_offset);
|
2020-12-02 23:18:49 +00:00
|
|
|
if (textures != NULL) {
|
|
|
|
(*Textures_tick)(textures, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-30 23:41:18 +00:00
|
|
|
// Init
|
2020-12-02 23:18:49 +00:00
|
|
|
void init_textures() {
|
2021-06-30 23:41:18 +00:00
|
|
|
// Tick Dynamic Textures (Animated Water)
|
2021-07-04 23:02:45 +00:00
|
|
|
if (feature_has("Animated Water", 0)) {
|
2020-12-02 23:18:49 +00:00
|
|
|
overwrite_calls((void *) Minecraft_tick, (void *) Minecraft_tick_injection);
|
|
|
|
}
|
2021-06-30 22:38:43 +00:00
|
|
|
}
|