ES 2.0 Update

master
maikerumine 2016-10-22 14:21:02 -04:00
parent 7f83755817
commit d29cace4d9
7 changed files with 209 additions and 16 deletions

146
antigrief.lua Normal file
View File

@ -0,0 +1,146 @@
-- ANTI GRIEF by rnd
-- Copyright 2016 rnd
----------------------------------------------------------------------------
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------------
-- prevents placing of lava/liquid sources or buckets above 0
--water
--bucket:bucket_water
function prevent_place_above(name)
local old_on_place=minetest.registered_craftitems[name];--.on_place;
local old_after_place_node = minetest.registered_nodes[name];--.after_place_node;
--after_place_node = func(pos, placer, itemstack, pointed_thing)
if old_on_place and old_on_place.on_place then
old_on_place=old_on_place.on_place;
minetest.registered_craftitems[name].on_place=function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if pos.y>0 then
minetest.log("action","ANTI GRIEF " .. placer:get_player_name() .. " tried to place " .. name .. " at " .. minetest.pos_to_string(pos));
return itemstack
else
return old_on_place(itemstack, placer, pointed_thing)
end
end
return;
end
if old_after_place_node then
old_after_place_node=old_after_place_node.after_place_node
local table = minetest.registered_nodes[name];
local table2 = {}
for i,v in pairs(table) do
table2[i] = v
end
table2.after_place_node=function(pos, placer, itemstack, pointed_thing)
--after_place_node = func(pos, placer, itemstack, pointed_thing)
local pos = pointed_thing.above
if pos.y>0 then
minetest.log("action","ANTI GRIEF " .. placer:get_player_name() .. " tried to place " .. name .. " at " .. minetest.pos_to_string(pos));
minetest.set_node(pos, {name = "air"});
return itemstack
end
end
minetest.register_node(":"..name, table2)
return;
end
return;
end
minetest.after(0,
function ()
prevent_place_above("bucket:bucket_water");
prevent_place_above("default:water_source");
prevent_place_above("bucket:bucket_lava");
prevent_place_above("default:lava_source");
prevent_place_above("es:toxic_water_source");
prevent_place_above("es:mud");
end
)
--TNT only below 150!
function no_tnt_above(name)
local tnt_on_place=minetest.registered_craftitems[name];--.on_place;
local tnt_after_place_node = minetest.registered_nodes[name];--.after_place_node;
--after_place_node = func(pos, placer, itemstack, pointed_thing)
if tnt_on_place and tnt_on_place.on_place then
tnt_on_place=tnt_on_place.on_place;
minetest.registered_craftitems[name].on_place=function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if pos.y>-150 then
minetest.log("action","ANTI GRIEF " .. placer:get_player_name() .. " tried to place " .. name .. " at " .. minetest.pos_to_string(pos));
return itemstack
else
return tnt_on_place(itemstack, placer, pointed_thing)
end
end
return;
end
if tnt_after_place_node then
tntafter_place_node=tnt_after_place_node.after_place_node
local table = minetest.registered_nodes[name];
local table2 = {}
for i,v in pairs(table) do
table2[i] = v
end
table2.after_place_node=function(pos, placer, itemstack, pointed_thing)
--after_place_node = func(pos, placer, itemstack, pointed_thing)
local pos = pointed_thing.above
if pos.y>-150 then
minetest.log("action","ANTI GRIEF " .. placer:get_player_name() .. " tried to place " .. name .. " at " .. minetest.pos_to_string(pos));
minetest.set_node(pos, {name = "air"});
return itemstack
end
end
minetest.register_node(":"..name, table2)
return;
end
return;
end
minetest.after(0,
function ()
no_tnt_above("tnt:tnt");
end
)

View File

@ -772,7 +772,7 @@ end
minetest.register_decoration({
deco_type = "schematic",
place_on = {"es:dry_dirt","es:strange_grass","es:strange_clay_brown"},
place_on = {"es:dry_dirt","es:strange_grass","es:strange_clay_brown","default:dirt_with_dry_grass","default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.0003,
@ -782,7 +782,7 @@ end
octaves = 3,
persist = 0.66
},
biomes = {"barren","clay"},
biomes = {"barren","clay","savanna","sandstone_grassland"},
y_min = 2,
y_max = 20,
schematic = minetest.get_modpath("es").."/schematics/cabin_old.mts",

View File

@ -36,7 +36,7 @@ minetest.register_chatcommand("mapfix", {
return true, "Done."
end,
})
--[[
--RND CODE
--NO GRIEF WITH liquids
local function disable_placing_above_ground(name)
@ -58,3 +58,4 @@ minetest.after(0,function()
disable_placing_above_ground("es:mud");
-- add here all other sources: toxic water, mud ,....
end)
]]

View File

@ -22,7 +22,7 @@ local modpath = minetest.get_modpath("es")
es.modpath = modpath
dofile(modpath.."/crafting.lua")
dofile(modpath.."/anticheat.lua")
dofile(modpath.."/antigrief.lua")
dofile(modpath.."/armor.lua")
dofile(modpath.."/shields.lua")
dofile(modpath.."/shutdown.lua")

View File

@ -177,6 +177,52 @@ local default_radiation_resistance_per_node = {
["technic:zinc_block"] = 36,
["tnt:tnt"] = 11,
["tnt:tnt_burning"] = 11,
["es:lag_block"] = 1000,
["es:lag_ice"] = 1000,
["es:compressedcobble"] = 23,
["es:granite"] = 10,
["es:granite_bricks"] = 14,
["es:marble"] = 12,
["es:marble_bricks"] = 15,
["es:stone_with_emeralds"] = 21,
["es:stone_with_rubys"] = 22,
["es:stone_with_aikerums"] = 23,
["es:stone_with_infiniums"] = 0,
["es:stone_with_purpelliums"] = 0,
["es:stone_with_uraniums"] = 0,
["es:emeraldblock"] = 20,
["es:rubyblock"] = 30,
["es:aikerumblock"] = 40,
["es:infiniumblock"] = 50,
["es:purpelliumblock"] = 60,
["es:sand_with_diamond"] = 12,
["es:boneblock"] = 39,
["es:hgglass"] = 60,
["es:hgglass2"] = 60,
["es:steelblock"] = 60,
["es:stoneblock"] = 60,
["es:stonebrick"] = 60,
["es:junglewood"] = 13,
["es:messymese"] = 23,
["es:what"] = 3,
["es:vault"] = 22,
["es:aiden_tree"] = 12,
["es:old_tree"] = 10,
["es:strange_clay_blue"] = 15,
["es:strange_clay_red"] = 15,
["es:strange_clay_maroon"] = 15,
["es:strange_clay_brown"] = 15,
["es:strange_clay_orange"] = 15,
["es:strange_clay_black"] = 15,
["es:strange_clay_grey"] = 15,
["es:dry_dirt"] = 8.2,
["es:desert_stone_with_gold"] = 60,
["es:desert_stone_with_iron"] = 20,
["es:desert_stone_with_coal"] = 34,
["es:mud"] = 5.8,
["es:mud_flowing"] = 3.8,
["es:lava_source"] = 17,
["es:lava_flowing"] = 8.5,
}
local default_radiation_resistance_per_group = {
concrete = 16,

View File

@ -48,7 +48,7 @@ minetest.register_chatcommand("spawn", {
end,
})
--[[
--Give initial stuff code
minetest.register_on_newplayer(function(player)
--print("on_newplayer")
@ -61,7 +61,7 @@ minetest.register_on_newplayer(function(player)
player:get_inventory():add_item('main', 'default:wood 3')
player:get_inventory():add_item('main', 'farming:bread 10')
end)
]]
--disable sneak on player join to make more interesting mining
--Sent: 31 Jan 2016, 10:53

View File

@ -23,28 +23,28 @@ end
]]
--TECHNIC STAIRS
stairs.register_stair_and_slab("granite", "es:granite",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"technic_granite.png"},
"Granite Block Stair",
"Granite Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("marble", "es:marble",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"technic_marble.png"},
"Marble Block Stair",
"Marble Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("marble_bricks", "es:marble_bricks",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"technic_marble_bricks.png" },
"Marble Bricks Block Stair",
"Marble Bricks Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("granite_bricks", "es:granite_bricks",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"technic_granite_bricks.png" },
"Granite Bricks Block Stair",
"Granite Bricks Block Slab",
@ -53,42 +53,42 @@ stairs.register_stair_and_slab("granite_bricks", "es:granite_bricks",
--Extreme Survival Stairs
stairs.register_stair_and_slab("Ruby", "es:rubyblock",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"ruby_block.png"},
"Ruby Block Stair",
"Ruby Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("Emerald", "es:emeraldblock",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"emerald_block.png"},
"Emerald Block Stair",
"Emerald Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("Aikerum", "es:aikerumblock",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"aikerum_block.png"},
"Aikerum Block Stair",
"Aikerum Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("Infinium", "es:infiniumblock",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"infinium_block.png"},
"Infinium Block Stair",
"Infinium Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("Purpellium", "es:purpelliumblock",
{cracky = 1},
{cracky = 1,not_in_craft_guide=1},
{"purpellium_block.png"},
"Purpellium Block Stair",
"Purpellium Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("Dirt", "default:dirt",
{cracky = 3, crumbly = 3,},
{cracky = 3, crumbly = 3,not_in_craft_guide=1},
{"default_dirt.png"},
"Dirt Block Stair",
"Dirt Block Slab",