File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11#include " Items.hpp"
22
3+ #include < cstring>
34#include " string_hash.hpp"
45
56#include " Minecraft.hpp"
@@ -19,7 +20,7 @@ Core::Game::ItemData *Core::Game::Items::SearchItemByName(const std::string& nam
1920 while (actualPtr <= endAddr) {
2021 Core::Game::ItemData *itemData = GetItemData ((u32 )actualPtr);
2122 if (itemData != NULL ) {
22- if (name.compare ( itemData->idName2 ))
23+ if (std::strcmp ( name.c_str (), itemData->idName2 ) == 0 )
2324 return itemData;
2425 }
2526 actualPtr++;
Original file line number Diff line number Diff line change 11local playerCamera = Game .LocalPlayer .Camera
22local Gamepad = Game .Gamepad
3- local originalFOV = playerCamera . FOV
3+ local originalFOV = 70
44local isZoom = false
55
66Game .Event .OnKeyPressed :Connect (function ()
Original file line number Diff line number Diff line change 11local player = Game .LocalPlayer
22local gamepad = Game .Gamepad
3- local coalId = Game . Items . findItemIDByName ( " coal " )
4- local diamondId = Game . Items . findItemIDByName ( " diamond " )
3+ local coalId = nil
4+ local diamondId = nil
55
66Game .Event .OnKeyPressed :Connect (function ()
77 if Game .World .Loaded then
88 if gamepad .isDown (gamepad .KeyCodes .DPADDOWN ) then
9+ if coalId == nil then -- You cannot use findItem when the game isn't loaded, wait until World is loaded to prevent nil results
10+ coalId = Game .Items .findItemIDByName (" coal" ) -- Make sure to not call this function many times as it can lag the game, use one time and store the value
11+ diamondId = Game .Items .findItemIDByName (" diamond" )
12+ end
913 local playerHand = player .Inventory .Slots [" hand" ]
1014 if playerHand .ItemID == coalId and playerHand .ItemData == 0 then
1115 playerHand .ItemID = diamondId
You can’t perform that action at this time.
0 commit comments