diff --git a/mods/cars/welding.lua b/mods/cars/welding.lua index d30aa813..e07ccc63 100644 --- a/mods/cars/welding.lua +++ b/mods/cars/welding.lua @@ -53,6 +53,10 @@ local welderdef = { minetest.chat_send_player(name, "Only Police CEO and those with 'give' priv can make police cars.") return end + if class_get and not class_get(name, "machinist") and carname ~= "cars:police_sedan" then + minetest.chat_send_player(name, "Only machinists can craft cars") + return + end worldedit.set(vector.subtract(nodepos, offset), vector.add(vector.subtract(nodepos, offset), size), "air") local ent = minetest.add_entity(vector.add(vector.subtract(nodepos, offset), vector.multiply(size, .5)), carname, user:get_player_name()) ent:setyaw(minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2))-math.pi) @@ -68,6 +72,10 @@ local welderdef = { local obj = pointed_thing.ref if not obj or not obj:get_armor_groups().vehicle then return itemstack end if obj:get_hp() >= obj:get_properties().hp_max then return itemstack end--todo add reassembling repair and only allow welding for hp above 50% + if class_get and not class_get(name, "machinist") and obj:get_hp() >= obj:get_properties().hp_max/2 then--only allow machinist to completly repair cars. + minetest.chat_send_player(name, "Only machinists can repair cars above 50%") + return + end if default.player_attached[name] then return itemstack end if cooldowns[name] then return itemstack end diff --git a/mods/farming/init.lua b/mods/farming/init.lua index c3037508..c3f65f24 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -79,7 +79,7 @@ end -- Growth Logic -local STAGE_LENGTH_AVG = 72000 +local STAGE_LENGTH_AVG = 57600 local STAGE_LENGTH_AVG_ORIGINAL = STAGE_LENGTH_AVG local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG*.8 function farming_setspeed(factor) @@ -468,7 +468,7 @@ end -- Place Seeds on Soil function farming.place_seed(itemstack, placer, pointed_thing, plantname) - + if class_get and placer and player:get_player_name() and not class_get(player:get_player_name(), "farmer") then return end local pt = pointed_thing -- check if pointing at a node diff --git a/mods/hbhunger/hunger.lua b/mods/hbhunger/hunger.lua index 0955cff3..be64421a 100644 --- a/mods/hbhunger/hunger.lua +++ b/mods/hbhunger/hunger.lua @@ -466,7 +466,13 @@ function hbhunger.handle_node_actions(pos, oldnode, player, ext) new = hbhunger.EXHAUST_MOVE end exhaus = exhaus + new - if exhaus > hbhunger.EXHAUST_LVL then + local exhaus_lvl + if class_get and class_get(name, "unclassed") then + exhaus_lvl = hbhunger.EXHAUST_LVL*1.5 + else + exhaus_lvl = hbhunger.EXHAUST_LVL + end + if exhaus > exhaus_lvl then exhaus = 0 local h = tonumber(hbhunger.hunger[name]) h = h - 1 diff --git a/mods/hbhunger/init.lua b/mods/hbhunger/init.lua index 2cc4808c..758bd2c6 100644 --- a/mods/hbhunger/init.lua +++ b/mods/hbhunger/init.lua @@ -127,7 +127,11 @@ minetest.register_globalstep(function(dtime) -- lower satiation by 1 point after xx seconds if timer2 > hbhunger.HUNGER_TICK then if h > 0 then - h = h-1 + if class_get and class_get(name, "unclassed") then + h = h-.75 + else + h = h-1 + end hbhunger.hunger[name] = h hbhunger.set_hunger_raw(player) end diff --git a/mods/lockpicks/init.lua b/mods/lockpicks/init.lua index e2183cf9..524529eb 100644 --- a/mods/lockpicks/init.lua +++ b/mods/lockpicks/init.lua @@ -98,6 +98,9 @@ local newchestrightclick = function(pos, node, clicker, itemstack, pointed_thing and not (def and def.tool_capabilities and def.tool_capabilities.groupcaps and def.tool_capabilities.groupcaps.locked) then return itemstack end + if class_get and not default.can_interact_with_node(clicker, pos) and not class_get(clicker:get_player_name(), "snooper") then + return itemstack + end name = "default:chest_locked" sound_open = "default_chest_open" sound_close = "default_chest_close" diff --git a/mods/mobs_redo/api.lua b/mods/mobs_redo/api.lua index dcddeb58..6ee32525 100644 --- a/mods/mobs_redo/api.lua +++ b/mods/mobs_redo/api.lua @@ -4755,7 +4755,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) self._breed_countdown = nil - if breed and self.hornytimer == 0 then + if breed and self.hornytimer == 0 and (not class_get or class_get(clicker:get_player_name(), "farmer")) then self.horny = true self.food = 4 end diff --git a/mods/playertools/init.lua b/mods/playertools/init.lua index afcd7a13..fa32cf1b 100644 --- a/mods/playertools/init.lua +++ b/mods/playertools/init.lua @@ -240,6 +240,9 @@ minetest.register_chatcommand("grief_check", { if not minetest.setting_getbool("enable_rollback_recording") then return false, "Rollback functions are disabled." end + if class_get and not class_get(clicker:get_player_name(), "snooper") then + return false, "Only snooper class can grief check" + end local range, hours, limit = param:match("(%d+) *(%d*) *(%d*)") range = tonumber(range) or 0