diff --git a/mods/src/chat/ui.cpp b/mods/src/chat/ui.cpp index bdc2dc2..12157b7 100644 --- a/mods/src/chat/ui.cpp +++ b/mods/src/chat/ui.cpp @@ -10,7 +10,10 @@ #include #include -std::vector history; +static std::vector &get_history() { + static std::vector history = {}; + return history; +} // Structure struct ChatScreen { @@ -26,7 +29,7 @@ CUSTOM_VTABLE(chat_screen, Screen) { original_init(super); ChatScreen *self = (ChatScreen *) super; // Text Input - self->chat = TextInputBox::create("", "", &history); + self->chat = TextInputBox::create("", "", &get_history()); self->super.m_textInputs->push_back(self->chat); self->chat->init(super->font); self->chat->setFocused(true); @@ -81,7 +84,8 @@ CUSTOM_VTABLE(chat_screen, Screen) { if (key == 0x0d && self->chat->isFocused()) { if (self->chat->getText().length() > 0) { std::string text = self->chat->getText(); - if (self->chat->history_pos != int(history.size() - 1)) { + std::vector &history = get_history(); + if (history.size() == 0 || text != history.back()) { history.push_back(text); } _chat_queue_message(text.c_str()); @@ -119,7 +123,6 @@ static Screen *create_chat_screen() { // Init void _init_chat_ui() { - history = {}; misc_run_on_game_key_press([](Minecraft *minecraft, int key) { if (key == 0x54) { if (Minecraft_isLevelGenerated(minecraft) && minecraft->screen == NULL) { diff --git a/symbols/src/item/ItemInHandRenderer.def b/symbols/src/item/ItemInHandRenderer.def index ac3f3ed..e6cbe76 100644 --- a/symbols/src/item/ItemInHandRenderer.def +++ b/symbols/src/item/ItemInHandRenderer.def @@ -5,3 +5,5 @@ property Minecraft *mc = 0x18; method void renderItem(Mob *mob, ItemInstance *item) = 0x4b824; method void render(float param_1) = 0x4bfcc; + +static-property ItemInHandRenderer *instance = 0x137bc0; \ No newline at end of file diff --git a/symbols/src/level/Biome.def b/symbols/src/level/Biome.def index 4b5fa33..3fed3d5 100644 --- a/symbols/src/level/Biome.def +++ b/symbols/src/level/Biome.def @@ -16,5 +16,5 @@ virtual-method float getCreatureProbability() = 0x20; property int color = 0x2c; property int leaf_color = 0x34; -// 64x64, Temp x humidity +// This is a Biome*[64x64], temp x humidity static-property-array Biome *map = 0x17c970;