Fix A LOT of things

This commit is contained in:
oilboi 2020-05-15 08:00:13 -04:00
parent 540091e46d
commit 269bce7c4c
18 changed files with 41 additions and 70 deletions

View File

@ -24,12 +24,11 @@ minetest.register_biome({
--hi paramat :D
-- Set the 3D noise parameters for the terrain.
local perlin= minetest.get_mapgen_params()
local np_terrain = {
offset = 0,
scale = 1,
spread = {x = 200, y = 100, z = 200},
seed = 5900033, --perlin.seed
seed = tonumber(minetest.get_mapgen_setting("seed")) or math.random(0,999999999),
octaves = 5,
persist = 0.63,
lacunarity = 2.0,

View File

@ -3,7 +3,7 @@
local plant_max = 240
minetest.register_plant = function(name,def)
max = 1
local max = 1
if def.stages then
max = def.stages
end

View File

@ -121,7 +121,6 @@ minetest.register_plant("wheat", {
tiles = {"wheat_stage"}, --automatically adds _X.png
paramtype2 = "degrotate",
buildable_to = false,
grow_stage = i,
groups = {leaves = 1, plant = 1, axe = 1, hand = 0,dig_immediate=1,attached_node=1,crops=1},
sounds = main.grassSound(),
sunlight_propagates = true,

View File

@ -184,7 +184,11 @@ local function hunger_update()
end)
end
hunger_update()
minetest.register_on_mods_loaded(function()
minetest.after(0,function()
hunger_update()
end)
end)
--take away hunger and satiation randomly while mining
minetest.register_on_dignode(function(pos, oldnode, digger)

View File

@ -16,7 +16,7 @@ minetest.register_globalstep(function(dtime)
meta:set_float("experience_collection_buffer", experience_collection_buffer)
local pos = player:getpos()
local pos = player:get_pos()
local inv = player:get_inventory()
--radial detection
for _,object in ipairs(minetest.get_objects_inside_radius({x=pos.x,y=pos.y+0.5,z=pos.z}, 2)) do

View File

@ -1,5 +1,3 @@
print("Initialized Main")
main = {}
local path = minetest.get_modpath("main")

View File

@ -2,6 +2,7 @@ minetest.register_alias("mapgen_stone", "main:stone")
minetest.register_alias("mapgen_dirt", "main:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "main:grass")
minetest.register_alias("mapgen_water_source", "main:water")
minetest.register_alias("mapgen_river_water_source", "main:water")
minetest.register_alias("mapgen_sand", "main:sand")
minetest.register_alias("mapgen_tree", "main:tree")
minetest.register_alias("mapgen_leaves", "main:leaves")

View File

@ -57,7 +57,7 @@ minetest.register_node("main:sapling", {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
on_place = on_rightclick or function(itemstack, placer, pointed_thing)
on_place = function(itemstack, placer, pointed_thing)
if not pointed_thing.type == "node" then
return
end

View File

@ -13,7 +13,7 @@ mobs.register_mob = function(def)
mob_register = {}
local mob_register = {}
------------------------------------------------
mob_register.initial_properties = {

View File

@ -38,12 +38,11 @@ minetest.register_decoration({
--hi paramat :D
-- Set the 3D noise parameters for the terrain.
local perlin= minetest.get_mapgen_params()
local np_terrain = {
offset = 0,
scale = 1,
spread = {x = 384, y = 192, z = 384},
seed = 5900033, --perlin.seed
seed = tonumber(minetest.get_mapgen_setting("seed")) or math.random(0,999999999),
octaves = 5,
persist = 0.63,
lacunarity = 2.0,

View File

@ -42,7 +42,6 @@ minetest.register_node("nether:glowstone", {
end,
drop = {
max_items = 5,
tools = tool_required,
items= {
{
tools = {"main:ironpick","main:goldpick","main:diamondpick"},

View File

@ -1,4 +1,4 @@
local get_group = minetest.get_node_group
local get_group = minetest.get_item_group
local registered_nodes
local get_node = minetest.get_node
--add nodes that hurt the player into the touch hurt table
@ -79,7 +79,7 @@ local heart
local legs
local head
local hurt_more
local name = ""
local function handle_hurt_inside(player)
if player:get_hp() > 0 then
player_pos = player:get_pos()
@ -108,6 +108,7 @@ local head
local hurt_more
local drawy
local legs
local name = ""
local function handle_player_suffocation(player)
if player:get_hp() > 0 then
player_pos = player:get_pos()
@ -137,7 +138,7 @@ end
local get_node = minetest.get_node
local pos
local node
local name
local name = ""
local damage_pos
local collisionbox
local a_min
@ -203,8 +204,11 @@ local function index_players_surroundings()
index_players_surroundings()
end)
end
index_players_surroundings() --begin
minetest.register_on_mods_loaded(function()
minetest.after(0,function()
index_players_surroundings() --begin
end)
end)
--completely destroy the breath bar
@ -288,5 +292,8 @@ local function fix_breath_hack()
fix_breath_hack()
end)
end
fix_breath_hack()
minetest.register_on_mods_loaded(function()
minetest.after(0,function()
fix_breath_hack()
end)
end)

View File

@ -3,6 +3,7 @@ for i = 0,1 do
local light_level = i * 9
local groups
local on_punch = nil
local on_timer
if i == 0 then
groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4,pathable = 1}
on_punch = function(pos, node, puncher, pointed_thing)

View File

@ -1,42 +0,0 @@
minetest.register_node("redstone:wire",{
description = "Redstone Dust",
wield_image = "redstone_dust_item.png",
paramtype = "light",
drawtype = "nodebox",
--paramtype2 = "wallmounted",
walkable = false,
node_box = {
type = "connected",
--{xmin, ymin, zmin, xmax, ymax, zmax}
fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
disconnected_sides = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
connect_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
-- connect_bottom =
connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
connect_left = {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
connect_back = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
},
collision_box = {
type = "connected",
--{xmin, ymin, zmin, xmax, ymax, zmax}
fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
-- connect_top =
-- connect_bottom =
connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
connect_left = {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
connect_back = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
},
connects_to = {"group:redstone"},
inventory_image = fence_texture,
wield_image = fence_texture,
tiles = {"redstone_dust.png"},
sunlight_propagates = true,
is_ground_content = false,
groups = {redstone =1, instant=1},
})

View File

@ -39,8 +39,8 @@ for i = 0,8 do
connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
},
connects_to = {"group:redstone"},
inventory_image = fence_texture,
wield_image = fence_texture,
inventory_image = "dirt.png",
wield_image = "dirt.png",
tiles = {"redstone_wire.png^[colorize:red:"..coloring},
sunlight_propagates = true,
is_ground_content = false,

View File

@ -368,9 +368,9 @@ crafting_table_inv = "size[17.2,8.75]"..
pages = 0
--run through the items and then set the pages
inv = {}
minetest.register_on_mods_loaded(function()
local item_counter = 0
inv = {}
local page = 0
inv["page_"..page] = ""

View File

@ -26,12 +26,11 @@ minetest.register_biome({
--hi paramat :D
-- Set the 3D noise parameters for the terrain.
local perlin= minetest.get_mapgen_params()
local np_terrain = {
offset = 0,
scale = 1,
spread = {x = 100, y = 50, z = 100},
seed = 5900033, --perlin.seed
seed = tonumber(minetest.get_mapgen_setting("seed")) or math.random(0,999999999),
octaves = 5,
persist = 0.63,
lacunarity = 2.0,

View File

@ -217,8 +217,11 @@ local function do_snow()
do_snow()
end)
end
do_snow()
minetest.register_on_mods_loaded(function()
minetest.after(0,function()
do_snow()
end)
end)
@ -233,7 +236,11 @@ local function randomize_weather()
randomize_weather()
end)
end
randomize_weather()
minetest.register_on_mods_loaded(function()
minetest.after(0,function()
randomize_weather()
end)
end)
local snowball_throw = function(player)
local pos = player:get_pos()