Skip to content

Commit

Permalink
Get mods from parameter in HOOK_LOGIN_FORGE
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshinm committed Jul 30, 2017
1 parent bd069a5 commit 5afc333
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions main.lua
Expand Up @@ -51,17 +51,25 @@ function OnPlayerJoined(Player)
end


function OnLoginForge(Client)
function OnLoginForge(Client, mods)
LOG("SampleForgeMod received forge mods connection")
local mods = Client:GetForgeMods()
--LOG("SampleForgeMod got mods: " .. mods:GetNumMods())

local i = 0
for name, version in pairs(mods) do
LOG("SampleForgeMod mod #" .. i .. " is " .. name .. " version " .. version)
i = i + 1
end

-- Same as passed parameter, but demonstrate calling GetForgeMods() method
mods2 = Client:GetForgeMods()
local j = 0
for name, version in pairs(mods2) do
LOG("(2) SampleForgeMod mod #" .. j .. " is " .. name .. " version " .. version)
j = j + 1
end



-- Example of denying clients with a specific Forge mod from connecting
-- This is a fairly harmless client mod for demonstrating purposes: https://minecraft.curseforge.com/projects/nofov
-- Of course, a sophisticated player could trivially bypass this protection
Expand Down

0 comments on commit 5afc333

Please sign in to comment.