forked from Mineclonia/Mineclonia
Compare commits
18 Commits
master
...
mineclone2
Author | SHA1 | Date |
---|---|---|
kay27 | ae7563727e | |
kay27 | fefc3a95d4 | |
kay27 | 47bf494996 | |
kay27 | e7ec91edb7 | |
Nils Dagsson Moskopp | ed1849ed81 | |
kay27 | 56a8736149 | |
kay27 | 989607142e | |
kay27 | cb0d8af818 | |
kay27 | f182b75c66 | |
Nils Dagsson Moskopp | 2f0fa1edb3 | |
kay27 | db86ad52e5 | |
kay27 | 5e229a24fb | |
kay27 | 6c2b6326c7 | |
kay27 | edf6d080c1 | |
kay27 | ae3453e197 | |
kay27 | ec11b73dc3 | |
iliekprogrammar | 9a7237b68e | |
iliekprogrammar | 7a7c4215d8 |
|
@ -1,38 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
name: "Bug Report"
|
|
||||||
about: "Use this for when something's broken."
|
|
||||||
labels:
|
|
||||||
- bug
|
|
||||||
- unconfirmed
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
##### What happened?
|
|
||||||
|
|
||||||
<!-- Describe what's wrong. -->
|
|
||||||
|
|
||||||
##### What did I expect?
|
|
||||||
|
|
||||||
<!-- Describe what should be happening instead -->
|
|
||||||
|
|
||||||
##### How to get it to happen
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Write down exactly what you did to get the bug to happen
|
|
||||||
If you need more steps, just keep adding numbers. If you
|
|
||||||
don't need them all, delete the empty numbers.
|
|
||||||
-->
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
|
|
||||||
##### Environment
|
|
||||||
|
|
||||||
Mineclonia Version: <!-- Paste the version of Mineclonia here, if you know it. -->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Please refer to https://git.minetest.land/Mineclonia/Mineclonia/wiki/Reporting-Bugs
|
|
||||||
if you need help finding your Minetest version.
|
|
||||||
-->
|
|
||||||
Minetest Version:
|
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
name: "Feature Request"
|
|
||||||
about: "Mineclonia doesn't do something you need it to"
|
|
||||||
labels:
|
|
||||||
- "feature request"
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
##### Problem
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Describe what's wrong.
|
|
||||||
|
|
||||||
If you're reporting a missing feature from Minecraft,
|
|
||||||
please include a link to the Minetest wiki or Mojang bug
|
|
||||||
tracker entry describing that feature.
|
|
||||||
-->
|
|
||||||
|
|
||||||
##### Solution
|
|
||||||
|
|
||||||
<!-- Write down an example of what you'd like to happen. -->
|
|
|
@ -1,51 +0,0 @@
|
||||||
<!--
|
|
||||||
Please include the main mod this PR affects in the title, including
|
|
||||||
the leading directory. For example, if you have added a new
|
|
||||||
type of banner to mcl_banners, the title should look like:
|
|
||||||
|
|
||||||
items/mcl_banners: add new banner type
|
|
||||||
|
|
||||||
-->
|
|
||||||
##### Problem
|
|
||||||
TRACKING ISSUE: #<!-- Tracking issue number -->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Describe WHAT problem this pull request solves.
|
|
||||||
If the tracking issue includes all the needed
|
|
||||||
information, you can leave this section empty.
|
|
||||||
-->
|
|
||||||
|
|
||||||
##### Solution
|
|
||||||
|
|
||||||
<!-- Describe HOW this pull request solves its problem. -->
|
|
||||||
|
|
||||||
##### Details
|
|
||||||
|
|
||||||
<!-- Include any additional information here. -->
|
|
||||||
|
|
||||||
##### Testing Steps
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Write how we can verify this patch addresses its problem.
|
|
||||||
If you need more steps, just keep adding numbers. If you
|
|
||||||
don't need them all, delete the empty numbers.
|
|
||||||
-->
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
|
|
||||||
<!--
|
|
||||||
If your pull request still needs work, uncomment the
|
|
||||||
following section and include a list of things that
|
|
||||||
need to be done before it's ready for us to look at.
|
|
||||||
|
|
||||||
Please remember to put WIP: in front of the title as well.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
##### To do
|
|
||||||
|
|
||||||
- [ ] Item 1
|
|
||||||
- [ ] Item 2
|
|
||||||
- [ ] Item 3
|
|
||||||
-->
|
|
102
.luacheckrc
102
.luacheckrc
|
@ -1,102 +0,0 @@
|
||||||
std = "min"
|
|
||||||
|
|
||||||
read_globals = {
|
|
||||||
"ItemStack",
|
|
||||||
"dump", "dump2",
|
|
||||||
"vector",
|
|
||||||
"VoxelArea",
|
|
||||||
"minetest",
|
|
||||||
"PseudoRandom",
|
|
||||||
"PerlinNoise",
|
|
||||||
"PcgRandom",
|
|
||||||
|
|
||||||
string = {fields = {"split", "trim"}},
|
|
||||||
table = {fields = {"copy", "getn", "indexof", "insert_all"}},
|
|
||||||
math = {fields = {"hypot", "round"}},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- A config option to allow r/w access to mods which contain
|
|
||||||
-- this one. It only avoids a couple warnings, and may not be
|
|
||||||
-- the behavior we want, so it's disabled by default.
|
|
||||||
local allow_parents=false
|
|
||||||
|
|
||||||
local lfs = require "lfs"
|
|
||||||
|
|
||||||
-- Seed the queue with the mods/ directory
|
|
||||||
local queue={ {"mods"} }
|
|
||||||
|
|
||||||
local function check(dir)
|
|
||||||
-- Get the string of the directory path
|
|
||||||
local sdir=table.concat(dir, "/")
|
|
||||||
-- Save the top-level directory name as a
|
|
||||||
-- fallback in case there's no mod.conf,
|
|
||||||
-- or no name= directive.
|
|
||||||
local name=dir[#dir]
|
|
||||||
|
|
||||||
-- Is there a mod.conf?
|
|
||||||
if lfs.attributes(sdir.."/mod.conf", "mode") == "file" then
|
|
||||||
local deps={}
|
|
||||||
for line in io.lines(sdir.."/mod.conf") do
|
|
||||||
-- Use name= if it's there
|
|
||||||
name=string.match(line, "name *= *([a-zA-Z0-9_]+)") or name
|
|
||||||
-- Get the dependency entries (if they're there)
|
|
||||||
local ents=string.match(line, "depends *=(.*)$")
|
|
||||||
if ents then
|
|
||||||
-- Split them in to the comma-separated names
|
|
||||||
for m in string.gmatch(ents, "([a-zA-Z0-9_]+),?") do
|
|
||||||
table.insert(deps, m)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local glb={ name }
|
|
||||||
if allow_parents then
|
|
||||||
for _, v in pairs(dir) do
|
|
||||||
-- Skip ALL-CAPS names since those tend
|
|
||||||
-- to be collections of mods instead of
|
|
||||||
-- mods themselves.
|
|
||||||
if not string.match(v, "^[A-Z]+$") then
|
|
||||||
table.insert(glb, v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Tell Luacheck what the directory is allowed to do
|
|
||||||
files[sdir]={
|
|
||||||
globals = glb,
|
|
||||||
read_globals = deps,
|
|
||||||
}
|
|
||||||
elseif lfs.attributes(sdir.."/init.lua", "mode") == "file" then
|
|
||||||
-- No mod.conf, but there's an init.lua here.
|
|
||||||
local glb={ name }
|
|
||||||
if allow_parents then
|
|
||||||
for _, v in pairs(dir) do
|
|
||||||
-- Again, skip ALL-CAPS.
|
|
||||||
if not string.match(v, "^[A-Z]+$") then
|
|
||||||
table.insert(glb, v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
files[sdir]={ globals=glb }
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Queue any child directories
|
|
||||||
for d in lfs.dir(sdir) do
|
|
||||||
-- Skip hidden directories and parent/current directories.
|
|
||||||
if lfs.attributes(sdir.."/"..d, "mode") == "directory" and not string.match(d, "^%.") then
|
|
||||||
-- Copy dir in to nd (New Dir)
|
|
||||||
local nd={}
|
|
||||||
for k, v in pairs(dir) do
|
|
||||||
nd[k]=v
|
|
||||||
end
|
|
||||||
nd[#nd+1]=d
|
|
||||||
table.insert(queue, nd)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
while #queue > 0 do
|
|
||||||
-- Pop an entry and process it.
|
|
||||||
check(table.remove(queue, 1))
|
|
||||||
end
|
|
|
@ -21,7 +21,7 @@ The basic digging time groups determine by which tools a node can be dug.
|
||||||
* `swordy=1`: Diggable by sword (any material), and this node is *not* a cobweb
|
* `swordy=1`: Diggable by sword (any material), and this node is *not* a cobweb
|
||||||
* `swordy_cobweb=1`: Diggable by sword (any material), and this node is a cobweb
|
* `swordy_cobweb=1`: Diggable by sword (any material), and this node is a cobweb
|
||||||
* `shearsy=1`: Diggable by shears, and this node is *not* wool
|
* `shearsy=1`: Diggable by shears, and this node is *not* wool
|
||||||
* `shearsy_wool=1`: Diggable by shears, and this node is wool
|
* `shearsy=wool=1`: Diggable by shears, and this node is wool
|
||||||
* `handy=1`: Breakable by hand and this node gives it useful drop when dug by hand. All nodes which are breakable by pickaxe, axe, shovel, sword or shears are also automatically breakable by hand, but not neccess
|
* `handy=1`: Breakable by hand and this node gives it useful drop when dug by hand. All nodes which are breakable by pickaxe, axe, shovel, sword or shears are also automatically breakable by hand, but not neccess
|
||||||
* `creative_breakable=1`: Block is breakable by hand in creative mode. This group is implied if the node belongs to any other digging group
|
* `creative_breakable=1`: Block is breakable by hand in creative mode. This group is implied if the node belongs to any other digging group
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ These groups are used mostly for informational purposes
|
||||||
* `trapdoor=2`: Open trapdoor
|
* `trapdoor=2`: Open trapdoor
|
||||||
* `glass=1`: Glass (full cubes only)
|
* `glass=1`: Glass (full cubes only)
|
||||||
* `rail=1`: Rail
|
* `rail=1`: Rail
|
||||||
* `music_record=1`: Music Disc
|
* `music_record`: Music Disc (rating is track ID)
|
||||||
* `tnt=1`: Block is TNT
|
* `tnt=1`: Block is TNT
|
||||||
* `boat=1`: Boat
|
* `boat=1`: Boat
|
||||||
* `minecart=1`: Minecart
|
* `minecart=1`: Minecart
|
||||||
|
@ -182,10 +182,6 @@ These groups are used mostly for informational purposes
|
||||||
* `redstone_torch=1`: Redstone Torch (lit)
|
* `redstone_torch=1`: Redstone Torch (lit)
|
||||||
* `redstone_torch=2`: Redstone Torch (unlit)
|
* `redstone_torch=2`: Redstone Torch (unlit)
|
||||||
|
|
||||||
* `dirt=1`: Uncovered dirt
|
|
||||||
* `dirt=2`: Covered dirt (grass or mycelium or podzol on top)
|
|
||||||
* `dirt=3`: Coarse dirt
|
|
||||||
|
|
||||||
* `plant=1`: Plant or part of a plant
|
* `plant=1`: Plant or part of a plant
|
||||||
* `double_plant`: Part of a double-sized plant. 1 = lower part, 2 = upper part
|
* `double_plant`: Part of a double-sized plant. 1 = lower part, 2 = upper part
|
||||||
|
|
||||||
|
|
BIN
menu/header.png
BIN
menu/header.png
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 76 KiB |
BIN
menu/icon.png
BIN
menu/icon.png
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
SVG_FILE=${2%.png}.svg
|
|
||||||
|
|
||||||
# How crisp a Minetest menu icon appears is influenced by image height
|
|
||||||
# and width. Low resolutions lead to blurry edges, as Minetest scales
|
|
||||||
# menu icons up. High resolutions lead to jagged edges, as Minetest
|
|
||||||
# scales menu icons down. Height & width of 72 pixes seem to work.
|
|
||||||
#
|
|
||||||
# Though usually one would export directly to "${3}", Inkscape 1.0 had
|
|
||||||
# its command line options changed by people who apparently think that
|
|
||||||
# backwards compatibility is some kind of swear word: Whereas earlier
|
|
||||||
# Inkscape versions would export to a file called foo.png.tmp, newer
|
|
||||||
# behaviour is to ignore the user's wishes & write to foo.png.png –
|
|
||||||
# unless one asks it to write to a filename with a .png extension,
|
|
||||||
# Inkscape 1.0 changes the filename extension to .png each time.
|
|
||||||
#
|
|
||||||
# As we do not know the extension of "${3}", we have to use the
|
|
||||||
# extension, then rename the resulting file to the proper name;
|
|
||||||
# only that way the export works with Inkscape 1.0 & earlier …
|
|
||||||
>&2 inkscape \
|
|
||||||
--file="${SVG_FILE}" \
|
|
||||||
--export-png="${3}".png \
|
|
||||||
--export-area-page \
|
|
||||||
--export-height 72 \
|
|
||||||
--export-width 72 \
|
|
||||||
|
|
||||||
mv "${3}".png "${3}"
|
|
8838
menu/icon.svg
8838
menu/icon.svg
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 509 KiB |
|
@ -207,10 +207,6 @@ end
|
||||||
function mcl_autogroup.can_harvest(nodename, toolname)
|
function mcl_autogroup.can_harvest(nodename, toolname)
|
||||||
local ndef = minetest.registered_nodes[nodename]
|
local ndef = minetest.registered_nodes[nodename]
|
||||||
|
|
||||||
if not ndef then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
|
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Adds additional ways for nodes to be attached.
|
|
@ -1,2 +0,0 @@
|
||||||
name = mcl_attached
|
|
||||||
description = Adds additional ways for nodes to be attached.
|
|
|
@ -1,8 +0,0 @@
|
||||||
# mcl_colors
|
|
||||||
Mod providing global table containing legacy minecraft colors to be used in mods.
|
|
||||||
|
|
||||||
## mcl_colors.*
|
|
||||||
Colors by upper name, in hex value.
|
|
||||||
|
|
||||||
## mcl_colors.background.*
|
|
||||||
Background colors by upper name, in hex value.
|
|
|
@ -1,36 +0,0 @@
|
||||||
mcl_colors = {
|
|
||||||
BLACK = "#000000",
|
|
||||||
DARK_BLUE = "#0000AA",
|
|
||||||
DARK_GREEN = "#00AA00",
|
|
||||||
DARK_AQUA = "#00AAAA",
|
|
||||||
DARK_RED = "#AA0000",
|
|
||||||
DARK_PURPLE = "#AA00AA",
|
|
||||||
GOLD = "#FFAA00",
|
|
||||||
GRAY = "#AAAAAA",
|
|
||||||
DARK_GRAY = "#555555",
|
|
||||||
BLUE = "#5555FF",
|
|
||||||
GREEN = "#55FF55",
|
|
||||||
AQUA = "#55FFFF",
|
|
||||||
RED = "#FF5555",
|
|
||||||
LIGHT_PURPLE = "#FF55FF",
|
|
||||||
YELLOW = "#FFFF55",
|
|
||||||
WHITE = "#FFFFFF",
|
|
||||||
background = {
|
|
||||||
BLACK = "#000000",
|
|
||||||
DARK_BLUE = "#00002A",
|
|
||||||
DARK_GREEN = "#002A00",
|
|
||||||
DARK_AQUA = "#002A2A",
|
|
||||||
DARK_RED = "#2A0000",
|
|
||||||
DARK_PURPLE = "#2A002A",
|
|
||||||
GOLD = "#2A2A00",
|
|
||||||
GRAY = "#2A2A2A",
|
|
||||||
DARK_GRAY = "#151515",
|
|
||||||
BLUE = "#15153F",
|
|
||||||
GREEN = "#153F15",
|
|
||||||
AQUA = "#153F3F",
|
|
||||||
RED = "#3F1515",
|
|
||||||
LIGHT_PURPLE = "#3F153F",
|
|
||||||
YELLOW = "#3F3F15",
|
|
||||||
WHITE = "#373501",
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
name = mcl_colors
|
|
||||||
author = Fleckenstein
|
|
||||||
description = The HTML sequences for the minecraft colors
|
|
|
@ -57,48 +57,50 @@ local function compute_sphere_rays(radius)
|
||||||
local rays = {}
|
local rays = {}
|
||||||
local sphere = {}
|
local sphere = {}
|
||||||
|
|
||||||
local function add_ray(pos)
|
for i=1, 2 do
|
||||||
|
for y = -radius, radius do
|
||||||
|
for z = -radius, radius do
|
||||||
|
for x = -radius, 0, 1 do
|
||||||
|
local d = x * x + y * y + z * z
|
||||||
|
if d <= radius * radius then
|
||||||
|
local pos = { x = x, y = y, z = z }
|
||||||
sphere[minetest.hash_node_position(pos)] = pos
|
sphere[minetest.hash_node_position(pos)] = pos
|
||||||
end
|
|
||||||
|
|
||||||
for y = -radius, radius do
|
|
||||||
for z = -radius, radius do
|
|
||||||
for x = -radius, 0 do
|
|
||||||
local d = x * x + y * y + z * z
|
|
||||||
if d <= radius * radius then
|
|
||||||
add_ray(vector.new(x, y, z))
|
|
||||||
add_ray(vector.new(-x, y, z))
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for i=1,2 do
|
||||||
for x = -radius, radius do
|
for x = -radius, radius do
|
||||||
for z = -radius, radius do
|
for z = -radius, radius do
|
||||||
for y = -radius, 0 do
|
for y = -radius, 0, 1 do
|
||||||
local d = x * x + y * y + z * z
|
local d = x * x + y * y + z * z
|
||||||
if d <= radius * radius then
|
if d <= radius * radius then
|
||||||
add_ray(vector.new(x, y, z))
|
local pos = { x = x, y = y, z = z }
|
||||||
add_ray(vector.new(x, -y, z))
|
sphere[minetest.hash_node_position(pos)] = pos
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for i=1,2 do
|
||||||
for x = -radius, radius do
|
for x = -radius, radius do
|
||||||
for y = -radius, radius do
|
for y = -radius, radius do
|
||||||
for z = -radius, 0 do
|
for z = -radius, 0, 1 do
|
||||||
local d = x * x + y * y + z * z
|
local d = x * x + y * y + z * z
|
||||||
if d <= radius * radius then
|
if d <= radius * radius then
|
||||||
add_ray(vector.new(x, y, z))
|
local pos = { x = x, y = y, z = z }
|
||||||
add_ray(vector.new(x, y, -z))
|
sphere[minetest.hash_node_position(pos)] = pos
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for _, pos in pairs(sphere) do
|
for _, pos in pairs(sphere) do
|
||||||
rays[#rays + 1] = vector.normalize(pos)
|
rays[#rays + 1] = vector.normalize(pos)
|
||||||
|
@ -251,12 +253,12 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher)
|
||||||
|
|
||||||
if collisionbox then
|
if collisionbox then
|
||||||
-- Create rays from random points in the collision box
|
-- Create rays from random points in the collision box
|
||||||
local x1 = collisionbox[1]
|
local x1 = collisionbox[1] * 2
|
||||||
local y1 = collisionbox[2]
|
local y1 = collisionbox[2] * 2
|
||||||
local z1 = collisionbox[3]
|
local z1 = collisionbox[3] * 2
|
||||||
local x2 = collisionbox[4]
|
local x2 = collisionbox[4] * 2
|
||||||
local y2 = collisionbox[5]
|
local y2 = collisionbox[5] * 2
|
||||||
local z2 = collisionbox[6]
|
local z2 = collisionbox[6] * 2
|
||||||
local x_len = math.abs(x2 - x1)
|
local x_len = math.abs(x2 - x1)
|
||||||
local y_len = math.abs(y2 - y1)
|
local y_len = math.abs(y2 - y1)
|
||||||
local z_len = math.abs(z2 - z1)
|
local z_len = math.abs(z2 - z1)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Initialization mod of MineClone 2. Defines some common shared variables and sets up initial default settings which have to be set at the beginning.
|
|
@ -33,25 +33,26 @@ mcl_vars.MAP_BLOCKSIZE = math.max(1, core.MAP_BLOCKSIZE or 16)
|
||||||
mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000)
|
mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000)
|
||||||
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, core.MAX_MAP_GENERATION_LIMIT or 31000)
|
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, core.MAX_MAP_GENERATION_LIMIT or 31000)
|
||||||
local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2)
|
local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2)
|
||||||
local chunk_size_in_nodes = mcl_vars.chunksize * mcl_vars.MAP_BLOCKSIZE
|
mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
|
||||||
|
mcl_vars.chunk_size_in_nodes = mcl_vars.chunksize * mcl_vars.MAP_BLOCKSIZE
|
||||||
local central_chunk_min_pos = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
|
local central_chunk_min_pos = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
|
||||||
local central_chunk_max_pos = central_chunk_min_pos + chunk_size_in_nodes - 1
|
local central_chunk_max_pos = central_chunk_min_pos + mcl_vars.chunk_size_in_nodes - 1
|
||||||
local ccfmin = central_chunk_min_pos - mcl_vars.MAP_BLOCKSIZE -- Fullminp/fullmaxp of central chunk, in nodes
|
local ccfmin = central_chunk_min_pos - mcl_vars.MAP_BLOCKSIZE -- Fullminp/fullmaxp of central chunk, in nodes
|
||||||
local ccfmax = central_chunk_max_pos + mcl_vars.MAP_BLOCKSIZE
|
local ccfmax = central_chunk_max_pos + mcl_vars.MAP_BLOCKSIZE
|
||||||
local mapgen_limit_b = math.floor(math.min(mcl_vars.mapgen_limit, mcl_vars.MAX_MAP_GENERATION_LIMIT) / mcl_vars.MAP_BLOCKSIZE)
|
local mapgen_limit_b = math.floor(math.min(mcl_vars.mapgen_limit, mcl_vars.MAX_MAP_GENERATION_LIMIT) / mcl_vars.MAP_BLOCKSIZE)
|
||||||
local mapgen_limit_min = -mapgen_limit_b * mcl_vars.MAP_BLOCKSIZE
|
local mapgen_limit_min = -mapgen_limit_b * mcl_vars.MAP_BLOCKSIZE
|
||||||
local mapgen_limit_max = (mapgen_limit_b + 1) * mcl_vars.MAP_BLOCKSIZE - 1
|
local mapgen_limit_max = (mapgen_limit_b + 1) * mcl_vars.MAP_BLOCKSIZE - 1
|
||||||
local numcmin = math.max(math.floor((ccfmin - mapgen_limit_min) / chunk_size_in_nodes), 0) -- Number of complete chunks from central chunk
|
local numcmin = math.max(math.floor((ccfmin - mapgen_limit_min) / mcl_vars.chunk_size_in_nodes), 0) -- Number of complete chunks from central chunk
|
||||||
local numcmax = math.max(math.floor((mapgen_limit_max - ccfmax) / chunk_size_in_nodes), 0) -- fullminp/fullmaxp to effective mapgen limits.
|
local numcmax = math.max(math.floor((mapgen_limit_max - ccfmax) / mcl_vars.chunk_size_in_nodes), 0) -- fullminp/fullmaxp to effective mapgen limits.
|
||||||
mcl_vars.mapgen_edge_min = central_chunk_min_pos - numcmin * chunk_size_in_nodes
|
mcl_vars.mapgen_edge_min = central_chunk_min_pos - numcmin * mcl_vars.chunk_size_in_nodes
|
||||||
mcl_vars.mapgen_edge_max = central_chunk_max_pos + numcmax * chunk_size_in_nodes
|
mcl_vars.mapgen_edge_max = central_chunk_max_pos + numcmax * mcl_vars.chunk_size_in_nodes
|
||||||
|
|
||||||
local function coordinate_to_block(x)
|
local function coordinate_to_block(x)
|
||||||
return math.floor(x / mcl_vars.MAP_BLOCKSIZE)
|
return math.floor(x / mcl_vars.MAP_BLOCKSIZE)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function coordinate_to_chunk(x)
|
local function coordinate_to_chunk(x)
|
||||||
return math.floor((coordinate_to_block(x) + central_chunk_offset) / mcl_vars.chunksize)
|
return math.floor((coordinate_to_block(x) - central_chunk_offset) / mcl_vars.chunksize)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_vars.pos_to_block(pos)
|
function mcl_vars.pos_to_block(pos)
|
||||||
|
@ -70,7 +71,7 @@ function mcl_vars.pos_to_chunk(pos)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local k_positive = math.ceil(mcl_vars.MAX_MAP_GENERATION_LIMIT / chunk_size_in_nodes)
|
local k_positive = math.ceil(mcl_vars.MAX_MAP_GENERATION_LIMIT / mcl_vars.chunk_size_in_nodes)
|
||||||
local k_positive_z = k_positive * 2
|
local k_positive_z = k_positive * 2
|
||||||
local k_positive_y = k_positive_z * k_positive_z
|
local k_positive_y = k_positive_z * k_positive_z
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_init
|
name = mcl_init
|
||||||
description = Initialization mod of MineClone 2. Defines some common shared variables and sets up initial default settings which have to be set at the beginning.
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
API for filling a chest with random treasures.
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_loot
|
name = mcl_loot
|
||||||
description = API for filling a chest with random treasures.
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Contains particle images of MineClone 2. No code.
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_particles
|
name = mcl_particles
|
||||||
description = Contains particle images of MineClone 2. No code.
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them.
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_sounds
|
name = mcl_sounds
|
||||||
description = This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them.
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
mcl_init
|
|
@ -0,0 +1 @@
|
||||||
|
Helper functions for MineClone 2.
|
|
@ -1,3 +1 @@
|
||||||
name = mcl_util
|
name = mcl_util
|
||||||
description = Helper functions for MineClone 2.
|
|
||||||
depends = mcl_init
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
mcl_init
|
|
@ -0,0 +1 @@
|
||||||
|
Utility functions for worlds and the “dimensions”.
|
|
@ -6,7 +6,7 @@ mcl_worlds = {}
|
||||||
function mcl_worlds.is_in_void(pos)
|
function mcl_worlds.is_in_void(pos)
|
||||||
local void =
|
local void =
|
||||||
not ((pos.y < mcl_vars.mg_overworld_max and pos.y > mcl_vars.mg_overworld_min) or
|
not ((pos.y < mcl_vars.mg_overworld_max and pos.y > mcl_vars.mg_overworld_min) or
|
||||||
(pos.y < mcl_vars.mg_nether_max and pos.y > mcl_vars.mg_nether_min) or
|
(pos.y < mcl_vars.mg_nether_max+128 and pos.y > mcl_vars.mg_nether_min) or
|
||||||
(pos.y < mcl_vars.mg_end_max and pos.y > mcl_vars.mg_end_min))
|
(pos.y < mcl_vars.mg_end_max and pos.y > mcl_vars.mg_end_min))
|
||||||
|
|
||||||
local void_deadly = false
|
local void_deadly = false
|
||||||
|
@ -15,11 +15,11 @@ function mcl_worlds.is_in_void(pos)
|
||||||
-- Overworld → Void → End → Void → Nether → Void
|
-- Overworld → Void → End → Void → Nether → Void
|
||||||
if pos.y < mcl_vars.mg_overworld_min and pos.y > mcl_vars.mg_end_max then
|
if pos.y < mcl_vars.mg_overworld_min and pos.y > mcl_vars.mg_end_max then
|
||||||
void_deadly = pos.y < mcl_vars.mg_overworld_min - deadly_tolerance
|
void_deadly = pos.y < mcl_vars.mg_overworld_min - deadly_tolerance
|
||||||
elseif pos.y < mcl_vars.mg_end_min and pos.y > mcl_vars.mg_nether_max then
|
elseif pos.y < mcl_vars.mg_end_min and pos.y > mcl_vars.mg_nether_max+128 then
|
||||||
-- The void between End and Nether. Like usual, but here, the void
|
-- The void between End and Nether. Like usual, but here, the void
|
||||||
-- *above* the Nether also has a small tolerance area, so player
|
-- *above* the Nether also has a small tolerance area, so player
|
||||||
-- can fly above the Nether without getting hurt instantly.
|
-- can fly above the Nether without getting hurt instantly.
|
||||||
void_deadly = (pos.y < mcl_vars.mg_end_min - deadly_tolerance) and (pos.y > mcl_vars.mg_nether_max + deadly_tolerance)
|
void_deadly = (pos.y < mcl_vars.mg_end_min - deadly_tolerance) and (pos.y > mcl_vars.mg_nether_max+128 + deadly_tolerance)
|
||||||
elseif pos.y < mcl_vars.mg_nether_min then
|
elseif pos.y < mcl_vars.mg_nether_min then
|
||||||
void_deadly = pos.y < mcl_vars.mg_nether_min - deadly_tolerance
|
void_deadly = pos.y < mcl_vars.mg_nether_min - deadly_tolerance
|
||||||
end
|
end
|
||||||
|
@ -35,7 +35,7 @@ end
|
||||||
function mcl_worlds.y_to_layer(y)
|
function mcl_worlds.y_to_layer(y)
|
||||||
if y >= mcl_vars.mg_overworld_min then
|
if y >= mcl_vars.mg_overworld_min then
|
||||||
return y - mcl_vars.mg_overworld_min, "overworld"
|
return y - mcl_vars.mg_overworld_min, "overworld"
|
||||||
elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max then
|
elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max+128 then
|
||||||
return y - mcl_vars.mg_nether_min, "nether"
|
return y - mcl_vars.mg_nether_min, "nether"
|
||||||
elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then
|
elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then
|
||||||
return y - mcl_vars.mg_end_min, "end"
|
return y - mcl_vars.mg_end_min, "end"
|
||||||
|
@ -73,7 +73,7 @@ end
|
||||||
-- Takes a position and returns true if this position can have Nether dust
|
-- Takes a position and returns true if this position can have Nether dust
|
||||||
function mcl_worlds.has_dust(pos)
|
function mcl_worlds.has_dust(pos)
|
||||||
-- Weather in the Overworld and the high part of the void below
|
-- Weather in the Overworld and the high part of the void below
|
||||||
return pos.y <= mcl_vars.mg_nether_max + 64 and pos.y >= mcl_vars.mg_nether_min - 64
|
return pos.y <= mcl_vars.mg_nether_max + 138 and pos.y >= mcl_vars.mg_nether_min - 10
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Takes a position (pos) and returns true if compasses are working here
|
-- Takes a position (pos) and returns true if compasses are working here
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
name = mcl_worlds
|
|
||||||
description = Utility functions for worlds and the “dimensions”.
|
|
||||||
depends = mcl_init
|
|
|
@ -0,0 +1 @@
|
||||||
|
mcl_core
|
|
@ -1,2 +0,0 @@
|
||||||
name = drippingwater
|
|
||||||
depends = mcl_core
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
mcl_player
|
||||||
|
mcl_core?
|
||||||
|
doc_identifier?
|
|
@ -0,0 +1 @@
|
||||||
|
Adds drivable boats.
|
|
@ -243,7 +243,7 @@ function boat.on_step(self, dtime, moveresult)
|
||||||
else
|
else
|
||||||
local ctrl = self._passenger:get_player_control()
|
local ctrl = self._passenger:get_player_control()
|
||||||
if ctrl and ctrl.sneak then
|
if ctrl and ctrl.sneak then
|
||||||
detach_object(self._passenger, true)
|
detach_player(self._passenger, true)
|
||||||
self._passenger = nil
|
self._passenger = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1 @@
|
||||||
name = mcl_boats
|
name = mcl_boats
|
||||||
description = Adds drivable boats.
|
|
||||||
depends = mcl_player
|
|
||||||
optional_depends = mcl_core, doc_identifier
|
|
||||||
|
|
|
@ -155,16 +155,6 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
|
||||||
}) + 1
|
}) + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local already_burning = mcl_burning.is_burning(obj)
|
|
||||||
|
|
||||||
|
|
||||||
mcl_burning.set(obj, "float", "burn_time", burn_time)
|
|
||||||
mcl_burning.set(obj, "string", "reason", reason)
|
|
||||||
|
|
||||||
if already_burning then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local hud_id
|
local hud_id
|
||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
hud_id = mcl_burning.get(obj, "int", "hud_id")
|
hud_id = mcl_burning.get(obj, "int", "hud_id")
|
||||||
|
@ -178,7 +168,8 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
|
||||||
}) + 1
|
}) + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
mcl_burning.set(obj, "float", "burn_time", burn_time)
|
||||||
|
mcl_burning.set(obj, "string", "reason", reason)
|
||||||
mcl_burning.set(obj, "int", "hud_id", hud_id)
|
mcl_burning.set(obj, "int", "hud_id", hud_id)
|
||||||
mcl_burning.set(obj, "int", "sound_id", sound_id)
|
mcl_burning.set(obj, "int", "sound_id", sound_id)
|
||||||
|
|
||||||
|
@ -294,7 +285,7 @@ function mcl_burning.fire_entity_step(self, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
local animation_timer = self.animation_timer + dtime
|
local animation_timer = self.animation_timer + dtime
|
||||||
if animation_timer >= ( 1 / mcl_burning.animation_fps ) then
|
if animation_timer >= 0.015 then
|
||||||
animation_timer = 0
|
animation_timer = 0
|
||||||
local animation_frame = self.animation_frame + 1
|
local animation_frame = self.animation_frame + 1
|
||||||
if animation_frame > mcl_burning.animation_frames - 1 then
|
if animation_frame > mcl_burning.animation_frames - 1 then
|
||||||
|
@ -305,48 +296,3 @@ function mcl_burning.fire_entity_step(self, dtime)
|
||||||
end
|
end
|
||||||
self.animation_timer = animation_timer
|
self.animation_timer = animation_timer
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_chatcommand("burn", {
|
|
||||||
params = S("<playername> <duration> <reason>"),
|
|
||||||
description = S("Sets a player on fire for the given amount of seconds with the given reason."),
|
|
||||||
privs = { debug = true },
|
|
||||||
func = function(name, params)
|
|
||||||
local playername, duration, reason = params:match("^(.+) (.+) (.+)$")
|
|
||||||
if not (playername and duration and reason) then
|
|
||||||
return false, S("Error: Parameter missing.")
|
|
||||||
end
|
|
||||||
local player = minetest.get_player_by_name(playername)
|
|
||||||
if not player then
|
|
||||||
return false, S(
|
|
||||||
"Error: Player “@1” not found.",
|
|
||||||
playername
|
|
||||||
)
|
|
||||||
end
|
|
||||||
local duration_number = tonumber(duration)
|
|
||||||
-- Lua numbers are truthy
|
|
||||||
-- NaN is not equal to NaN
|
|
||||||
if not duration_number or (duration_number ~= duration_number) then
|
|
||||||
return false, S(
|
|
||||||
"Error: Duration “@1” is not a number.",
|
|
||||||
duration
|
|
||||||
)
|
|
||||||
end
|
|
||||||
if duration_number < 0 then
|
|
||||||
return false, S(
|
|
||||||
"Error: Duration “@1” is negative.",
|
|
||||||
duration
|
|
||||||
)
|
|
||||||
end
|
|
||||||
mcl_burning.set_on_fire(
|
|
||||||
player,
|
|
||||||
duration_number,
|
|
||||||
reason
|
|
||||||
)
|
|
||||||
return true, S(
|
|
||||||
"Set @1 on fire for @2s for the following reason: @3",
|
|
||||||
playername,
|
|
||||||
duration,
|
|
||||||
reason
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
|
@ -2,8 +2,7 @@ local S = minetest.get_translator("mcl_burning")
|
||||||
local modpath = minetest.get_modpath("mcl_burning")
|
local modpath = minetest.get_modpath("mcl_burning")
|
||||||
|
|
||||||
mcl_burning = {
|
mcl_burning = {
|
||||||
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8,
|
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8
|
||||||
animation_fps = tonumber(minetest.settings:get("fire_animation_fps")) or 30
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dofile(modpath .. "/api.lua")
|
dofile(modpath .. "/api.lua")
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Falling node entities, Minecraft-style
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_falling_nodes
|
name = mcl_falling_nodes
|
||||||
description = Falling node entities, Minecraft-style
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
flowlib
|
||||||
|
mcl_enchanting
|
|
@ -0,0 +1 @@
|
||||||
|
Dropped items will be attracted to the player like a magnet.
|
|
@ -1,4 +1,3 @@
|
||||||
local S = minetest.get_translator("mcl_item_entity")
|
|
||||||
--basic settings
|
--basic settings
|
||||||
local item_drop_settings = {} --settings table
|
local item_drop_settings = {} --settings table
|
||||||
item_drop_settings.age = 1.0 --how old a dropped item (_insta_collect==false) has to be before collecting
|
item_drop_settings.age = 1.0 --how old a dropped item (_insta_collect==false) has to be before collecting
|
||||||
|
@ -449,7 +448,7 @@ minetest.register_entity(":__builtin:item", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
get_staticdata = function(self)
|
get_staticdata = function(self)
|
||||||
local data = minetest.serialize({
|
return minetest.serialize({
|
||||||
itemstring = self.itemstring,
|
itemstring = self.itemstring,
|
||||||
always_collect = self.always_collect,
|
always_collect = self.always_collect,
|
||||||
age = self.age,
|
age = self.age,
|
||||||
|
@ -457,39 +456,6 @@ minetest.register_entity(":__builtin:item", {
|
||||||
_flowing = self._flowing,
|
_flowing = self._flowing,
|
||||||
_removed = self._removed,
|
_removed = self._removed,
|
||||||
})
|
})
|
||||||
-- sfan5 guessed that the biggest serializable item
|
|
||||||
-- entity would have a size of 65530 bytes. This has
|
|
||||||
-- been experimentally verified to be still too large.
|
|
||||||
--
|
|
||||||
-- anon5 has calculated that the biggest serializable
|
|
||||||
-- item entity has a size of exactly 65487 bytes:
|
|
||||||
--
|
|
||||||
-- 1. serializeString16 can handle max. 65535 bytes.
|
|
||||||
-- 2. The following engine metadata is always saved:
|
|
||||||
-- • 1 byte (version)
|
|
||||||
-- • 2 byte (length prefix)
|
|
||||||
-- • 14 byte “__builtin:item”
|
|
||||||
-- • 4 byte (length prefix)
|
|
||||||
-- • 2 byte (health)
|
|
||||||
-- • 3 × 4 byte = 12 byte (position)
|
|
||||||
-- • 4 byte (yaw)
|
|
||||||
-- • 1 byte (version 2)
|
|
||||||
-- • 2 × 4 byte = 8 byte (pitch and roll)
|
|
||||||
-- 3. This leaves 65487 bytes for the serialization.
|
|
||||||
if #data > 65487 then -- would crash the engine
|
|
||||||
local stack = ItemStack(self.itemstring)
|
|
||||||
stack:get_meta():from_table(nil)
|
|
||||||
self.itemstring = stack:to_string()
|
|
||||||
minetest.log(
|
|
||||||
"warning",
|
|
||||||
"Overlong item entity metadata removed: “" ..
|
|
||||||
self.itemstring ..
|
|
||||||
"” had serialized length of " ..
|
|
||||||
#data
|
|
||||||
)
|
|
||||||
return self:get_staticdata()
|
|
||||||
end
|
|
||||||
return data
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_activate = function(self, staticdata, dtime_s)
|
on_activate = function(self, staticdata, dtime_s)
|
||||||
|
@ -782,29 +748,3 @@ minetest.register_entity(":__builtin:item", {
|
||||||
|
|
||||||
-- Note: on_punch intentionally left out. The player should *not* be able to collect items by punching
|
-- Note: on_punch intentionally left out. The player should *not* be able to collect items by punching
|
||||||
})
|
})
|
||||||
|
|
||||||
-- The “getwrittenbook” command was added as a debug aid. It can help
|
|
||||||
-- reproducing situations in which items with lots of metadata trigger
|
|
||||||
-- issues like heavy lag or server crashes. Do not remove this command
|
|
||||||
-- unless another easy way of getting items with overlong meta exists!
|
|
||||||
--
|
|
||||||
-- “/getwrittenbook 65323” creates an item that creates the largest
|
|
||||||
-- possible serializable written book item entity when dropped.
|
|
||||||
--
|
|
||||||
-- “/getwrittenbook 65324” creates an item that creates the smallest
|
|
||||||
-- possible non-serializable written book item entity when dropped.
|
|
||||||
minetest.register_chatcommand("getwrittenbook", {
|
|
||||||
params = S("<Count>"),
|
|
||||||
description = S("Get a written book with a configurable amount of characters."),
|
|
||||||
privs = {debug=true},
|
|
||||||
func = function(name, param)
|
|
||||||
local count = tonumber(param)
|
|
||||||
local itemstack = ItemStack("mcl_books:written_book")
|
|
||||||
local meta = itemstack:get_meta()
|
|
||||||
meta:set_string("description", "")
|
|
||||||
meta:set_string("text", string.rep("x", count))
|
|
||||||
local player = minetest.get_player_by_name(name)
|
|
||||||
local inv = player:get_inventory()
|
|
||||||
inv:add_item("main", itemstack)
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
name = mcl_item_entity
|
name = mcl_item_entity
|
||||||
description = Dropped items will be attracted to the player like a magnet.
|
|
||||||
depends = flowlib, mcl_enchanting
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
mcl_explosions
|
||||||
|
mcl_core
|
||||||
|
mcl_sounds
|
||||||
|
mcl_player
|
||||||
|
mcl_achievements
|
||||||
|
mcl_chests
|
||||||
|
mcl_furnaces
|
||||||
|
mesecons_commandblock
|
||||||
|
mcl_hoppers
|
||||||
|
mcl_tnt
|
||||||
|
mesecons
|
||||||
|
doc_identifier?
|
|
@ -0,0 +1 @@
|
||||||
|
Minecarts are vehicles to move players quickly on rails.
|
|
@ -1,4 +1 @@
|
||||||
name = mcl_minecarts
|
name = mcl_minecarts
|
||||||
description = Minecarts are vehicles to move players quickly on rails.
|
|
||||||
depends = mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons
|
|
||||||
optional_depends = doc_identifier
|
|
||||||
|
|
|
@ -14,8 +14,6 @@ local DEFAULT_FALL_SPEED = -10
|
||||||
local FLOP_HEIGHT = 5.0
|
local FLOP_HEIGHT = 5.0
|
||||||
local FLOP_HOR_SPEED = 1.5
|
local FLOP_HOR_SPEED = 1.5
|
||||||
|
|
||||||
local LIGHT_SUN = minetest.LIGHT_MAX + 1
|
|
||||||
|
|
||||||
local MOB_CAP = {}
|
local MOB_CAP = {}
|
||||||
MOB_CAP.hostile = 70
|
MOB_CAP.hostile = 70
|
||||||
MOB_CAP.passive = 10
|
MOB_CAP.passive = 10
|
||||||
|
@ -1059,7 +1057,7 @@ local do_env_damage = function(self)
|
||||||
if mod_worlds then
|
if mod_worlds then
|
||||||
_, dim = mcl_worlds.y_to_layer(pos.y)
|
_, dim = mcl_worlds.y_to_layer(pos.y)
|
||||||
end
|
end
|
||||||
if (self.sunlight_damage ~= 0 or self.ignited_by_sunlight) and (minetest.get_node_light(pos) or 0) == LIGHT_SUN and dim == "overworld" then
|
if (self.sunlight_damage ~= 0 or self.ignited_by_sunlight) and (minetest.get_node_light(pos) or 0) >= minetest.LIGHT_MAX and dim == "overworld" then
|
||||||
if self.ignited_by_sunlight then
|
if self.ignited_by_sunlight then
|
||||||
mcl_burning.set_on_fire(self.object, 10)
|
mcl_burning.set_on_fire(self.object, 10)
|
||||||
else
|
else
|
||||||
|
@ -2823,7 +2821,7 @@ local falling = function(self, pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
if mcl_portals ~= nil then
|
if mcl_portals ~= nil then
|
||||||
if mcl_portals.nether_portal_cooloff[self.object] then
|
if mcl_portals.nether_portal_cooloff(self.object) then
|
||||||
return false -- mob has teleported through Nether portal - it's 99% not falling
|
return false -- mob has teleported through Nether portal - it's 99% not falling
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Adds a mob API for mods to add animals or monsters, etc.
|
|
@ -1,4 +1,3 @@
|
||||||
name = mcl_mobs
|
name = mcl_mobs
|
||||||
depends = mcl_particles
|
depends = mcl_particles
|
||||||
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience
|
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience
|
||||||
description = Adds a mob API for mods to add animals or monsters, etc.
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
mcl_init
|
||||||
|
mcl_particles
|
||||||
|
default?
|
||||||
|
mcl_mobs
|
||||||
|
mcl_tnt?
|
||||||
|
mcl_bows?
|
||||||
|
mcl_throwing?
|
||||||
|
mcl_fishing?
|
||||||
|
bones?
|
||||||
|
mesecons_materials?
|
||||||
|
mobs_mc_gameconfig?
|
||||||
|
doc_items?
|
|
@ -0,0 +1 @@
|
||||||
|
Adds Minecraft-like monsters and animals.
|
|
@ -1,4 +1 @@
|
||||||
name = mobs_mc
|
name = mobs_mc
|
||||||
description = Adds Minecraft-like monsters and animals.
|
|
||||||
depends = mcl_init, mcl_particles, mcl_mobs
|
|
||||||
optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, mobs_mc_gameconfig, doc_items
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
mcl_init
|
||||||
|
mcl_core
|
|
@ -1,2 +0,0 @@
|
||||||
name = mobs_mc_gameconfig
|
|
||||||
depends = mcl_init, mcl_core
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
mcl_fire
|
||||||
|
mcl_death_messages?
|
|
@ -0,0 +1 @@
|
||||||
|
A mod that adds thunder and lightning effects.
|
|
@ -1,4 +1 @@
|
||||||
name = lightning
|
name = lightning
|
||||||
description = A mod that adds thunder and lightning effects.
|
|
||||||
depends = mcl_fire
|
|
||||||
optional_depends = mcl_death_messages
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
mcl_worlds
|
||||||
|
mcl_death_messages
|
|
@ -0,0 +1 @@
|
||||||
|
Deal damage to entities stuck in the deep void
|
|
@ -1,3 +1 @@
|
||||||
name = mcl_void_damage
|
name = mcl_void_damage
|
||||||
description = Deal damage to entities stuck in the deep void
|
|
||||||
depends = mcl_worlds, mcl_death_messages
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
mcl_init
|
||||||
|
mcl_worlds
|
||||||
|
lightning?
|
|
@ -0,0 +1 @@
|
||||||
|
Weather and sky handling: Rain, snow, thunderstorm, End and Nether ambience
|
|
@ -1,4 +1 @@
|
||||||
name = mcl_weather
|
name = mcl_weather
|
||||||
description = Weather and sky handling: Rain, snow, thunderstorm, End and Nether ambience
|
|
||||||
depends = mcl_init, mcl_worlds
|
|
||||||
optional_depends = lightning
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Provides an extensible in-game help with texts about gameplay basics (such a crafting), items and advanced usage.
|
|
@ -1,2 +0,0 @@
|
||||||
name = doc
|
|
||||||
description = Provides an extensible in-game help with texts about gameplay basics (such a crafting), items and advanced usage.
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
mcl_core
|
||||||
|
mcl_compass
|
||||||
|
mcl_clock
|
||||||
|
doc
|
||||||
|
sfinv?
|
||||||
|
sfinv_buttons?
|
|
@ -0,0 +1,2 @@
|
||||||
|
The most comprehensive Crafting Guide
|
||||||
|
on Minetest.
|
|
@ -1,5 +1 @@
|
||||||
name = mcl_craftguide
|
name = mcl_craftguide
|
||||||
description = The most comprehensive Crafting Guide
|
|
||||||
on Minetest.
|
|
||||||
depends = mcl_core, mcl_compass, mcl_clock, doc
|
|
||||||
optional_depends = sfinv, sfinv_buttons
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
doc
|
||||||
|
doc_items
|
|
@ -0,0 +1 @@
|
||||||
|
This MineClone 2 mod sets up and configures the Help modpack mods to tailor the help towards MineClone 2.
|
|
@ -1,3 +1 @@
|
||||||
name = mcl_doc
|
name = mcl_doc
|
||||||
description = This MineClone 2 mod sets up and configures the Help modpack mods to tailor the help towards MineClone 2.
|
|
||||||
depends = doc, doc_items
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
tt
|
||||||
|
mcl_enchanting
|
|
@ -1,2 +0,0 @@
|
||||||
name = mcl_tt
|
|
||||||
depends = tt, mcl_enchanting
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
sfinv?
|
||||||
|
unified_inventory?
|
|
@ -0,0 +1 @@
|
||||||
|
Adds achievements to Minetest, and an API to register new ones.
|
|
@ -5,4 +5,3 @@ description = Adds achievements to Minetest, and an API to register new ones.
|
||||||
license = LGPL 2.1 or later
|
license = LGPL 2.1 or later
|
||||||
forum = https://forum.minetest.net/viewtopic.php?t=4870
|
forum = https://forum.minetest.net/viewtopic.php?t=4870
|
||||||
version = 2.3.0
|
version = 2.3.0
|
||||||
optional_depends = sfinv, unified_inventory
|
|
||||||
|
|
|
@ -413,7 +413,6 @@ function hb.hide_hudbar(player, identifier)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local hudtable = hb.get_hudtable(identifier)
|
local hudtable = hb.get_hudtable(identifier)
|
||||||
if hudtable == nil then return false end
|
if hudtable == nil then return false end
|
||||||
if hudtable.hudstate[name].hidden == true then return true end
|
|
||||||
if hb.settings.bar_type == "progress_bar" then
|
if hb.settings.bar_type == "progress_bar" then
|
||||||
if hudtable.hudids[name].icon ~= nil then
|
if hudtable.hudids[name].icon ~= nil then
|
||||||
player:hud_change(hudtable.hudids[name].icon, "scale", {x=0,y=0})
|
player:hud_change(hudtable.hudids[name].icon, "scale", {x=0,y=0})
|
||||||
|
@ -432,7 +431,6 @@ function hb.unhide_hudbar(player, identifier)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local hudtable = hb.get_hudtable(identifier)
|
local hudtable = hb.get_hudtable(identifier)
|
||||||
if hudtable == nil then return false end
|
if hudtable == nil then return false end
|
||||||
if hudtable.hudstate[name].hidden == false then return true end
|
|
||||||
local value = hudtable.hudstate[name].value
|
local value = hudtable.hudstate[name].value
|
||||||
local max = hudtable.hudstate[name].max
|
local max = hudtable.hudstate[name].max
|
||||||
if hb.settings.bar_type == "progress_bar" then
|
if hb.settings.bar_type == "progress_bar" then
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
awards
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_achievements
|
name = mcl_achievements
|
||||||
depends = awards
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Provides core textures needed by Minetest.
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_base_textures
|
name = mcl_base_textures
|
||||||
description = Provides core textures needed by Minetest.
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Shows messages in chat when a player dies.
|
|
@ -3,105 +3,12 @@ local N = function(s) return s end
|
||||||
|
|
||||||
local function get_tool_name(item)
|
local function get_tool_name(item)
|
||||||
local name = item:get_meta():get_string("name")
|
local name = item:get_meta():get_string("name")
|
||||||
if name == "" then
|
if name ~= "" then
|
||||||
|
return name
|
||||||
|
end
|
||||||
local def = item:get_definition()
|
local def = item:get_definition()
|
||||||
name=def._tt_original_description or def.description
|
return def._tt_original_description or def.description
|
||||||
end
|
end
|
||||||
local sanitized_name, substitution_count = name:gsub("[\r\n]"," ")
|
|
||||||
return sanitized_name
|
|
||||||
end
|
|
||||||
|
|
||||||
local test_tool_1a = {
|
|
||||||
get_meta = function()
|
|
||||||
return {
|
|
||||||
get_string = function()
|
|
||||||
return "foo 1a"
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
assert( get_tool_name(test_tool_1a) == "foo 1a" )
|
|
||||||
|
|
||||||
local test_tool_1b = {
|
|
||||||
get_meta = function()
|
|
||||||
return {
|
|
||||||
get_string = function()
|
|
||||||
return "bar\rbaz\n1b"
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
assert( get_tool_name(test_tool_1b) == "bar baz 1b" )
|
|
||||||
|
|
||||||
local test_tool_2a = {
|
|
||||||
get_definition = function()
|
|
||||||
return {
|
|
||||||
_tt_original_description = "foo 2a"
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
get_meta = function()
|
|
||||||
return {
|
|
||||||
get_string = function()
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
assert( get_tool_name(test_tool_2a) == "foo 2a" )
|
|
||||||
|
|
||||||
local test_tool_2b = {
|
|
||||||
get_definition = function()
|
|
||||||
return {
|
|
||||||
_tt_original_description = "bar\rbaz\n2b"
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
get_meta = function()
|
|
||||||
return {
|
|
||||||
get_string = function()
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
assert( get_tool_name(test_tool_2b) == "bar baz 2b" )
|
|
||||||
|
|
||||||
local test_tool_3a = {
|
|
||||||
get_definition = function()
|
|
||||||
return {
|
|
||||||
description = "foo 3a"
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
get_meta = function()
|
|
||||||
return {
|
|
||||||
get_string = function()
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
assert( get_tool_name(test_tool_3a) == "foo 3a" )
|
|
||||||
|
|
||||||
local test_tool_3b = {
|
|
||||||
get_definition = function()
|
|
||||||
return {
|
|
||||||
description = "bar\rbaz\n3b"
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
get_meta = function()
|
|
||||||
return {
|
|
||||||
get_string = function()
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
assert( get_tool_name(test_tool_3b) == "bar baz 3b" )
|
|
||||||
|
|
||||||
mcl_death_messages = {}
|
mcl_death_messages = {}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
@1 drowned.=@1 ertrank.
|
@1 drowned.=@1 ertrank.
|
||||||
@1 ran out of oxygen.=@1 ging die Luft aus.
|
@1 ran out of oxygen.=@1 ging die Luft aus.
|
||||||
@1 was killed by @2.=@1 wurde von @2 getötet.
|
@1 was killed by @2.=@1 wurde von @2 getötet.
|
||||||
@1 was slain by @2.=@1 wurde von @2 getötet.
|
|
||||||
@1 was killed.=@1 wurde getötet.
|
@1 was killed.=@1 wurde getötet.
|
||||||
@1 was killed by a mob.=@1 wurde von einem Mob getötet.
|
@1 was killed by a mob.=@1 wurde von einem Mob getötet.
|
||||||
@1 was burned to death by a blaze's fireball.=@1 wurde von einem Feuerball einer Lohe zu Tode verbrannt.
|
@1 was burned to death by a blaze's fireball.=@1 wurde von einem Feuerball einer Lohe zu Tode verbrannt.
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
@1 drowned.=
|
@1 drowned.=
|
||||||
@1 ran out of oxygen.=
|
@1 ran out of oxygen.=
|
||||||
@1 was killed by @2.=
|
@1 was killed by @2.=
|
||||||
@1 was slain by @2.=
|
|
||||||
@1 was killed.=
|
@1 was killed.=
|
||||||
@1 was killed by a mob.=
|
@1 was killed by a mob.=
|
||||||
@1 was burned to death by a blaze's fireball.=
|
@1 was burned to death by a blaze's fireball.=
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_death_messages
|
name = mcl_death_messages
|
||||||
description = Shows messages in chat when a player dies.
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
mcl_init
|
|
@ -1,2 +1 @@
|
||||||
name = mcl_formspec_prepend
|
name = mcl_formspec_prepend
|
||||||
depends = mcl_init
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Adds a HUD bar displaying the current damage of the player's armor.
|
|
@ -1,3 +1,2 @@
|
||||||
name = mcl_hbarmor
|
name = mcl_hbarmor
|
||||||
depends = hudbars, mcl_armor
|
depends = hudbars, mcl_armor
|
||||||
description = Adds a HUD bar displaying the current damage of the player's armor.
|
|
||||||
|
|
|
@ -28,9 +28,10 @@ local function replace_enchanted_books(tbl)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Populate all the item tables. We only do this once. Note this code must be
|
--[[ Populate all the item tables. We only do this once. Note this mod must be
|
||||||
executed after loading all the other mods in order to work. ]]
|
loaded after _mcl_autogroup for this to work, because it required certain
|
||||||
minetest.register_on_mods_loaded(function()
|
groups to be set. ]]
|
||||||
|
do
|
||||||
for name,def in pairs(minetest.registered_items) do
|
for name,def in pairs(minetest.registered_items) do
|
||||||
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then
|
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then
|
||||||
local is_redstone = function(def)
|
local is_redstone = function(def)
|
||||||
|
@ -108,7 +109,7 @@ minetest.register_on_mods_loaded(function()
|
||||||
table.sort(to_sort)
|
table.sort(to_sort)
|
||||||
replace_enchanted_books(to_sort)
|
replace_enchanted_books(to_sort)
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
|
|
||||||
local function filter_item(name, description, lang, filter)
|
local function filter_item(name, description, lang, filter)
|
||||||
local desc
|
local desc
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
mcl_init
|
||||||
|
mcl_formspec
|
||||||
|
mcl_player?
|
||||||
|
_mcl_autogroup?
|
||||||
|
mcl_armor?
|
||||||
|
mcl_brewing?
|
||||||
|
mcl_potions?
|
||||||
|
mcl_enchanting
|
|
@ -0,0 +1 @@
|
||||||
|
Adds the player inventory and creative inventory.
|
|
@ -1,4 +1 @@
|
||||||
name = mcl_inventory
|
name = mcl_inventory
|
||||||
description = Adds the player inventory and creative inventory.
|
|
||||||
depends = mcl_init, mcl_formspec, mcl_enchanting
|
|
||||||
optional_depends = mcl_player, mcl_armor, mcl_brewing, mcl_potions
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
hudbars?
|
|
@ -0,0 +1 @@
|
||||||
|
Displays the name of the wielded item.
|
|
@ -1,3 +1 @@
|
||||||
name = show_wielded_item
|
name = show_wielded_item
|
||||||
description = Displays the name of the wielded item.
|
|
||||||
optional_depends = hudbars
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue