Compare commits

..

18 Commits

Author SHA1 Message Date
kay27 ae7563727e
Spawn Nether portals higher than lava level 2021-05-13 23:22:44 +02:00
kay27 fefc3a95d4
Fix Nether portal teleportation bugs 2021-05-13 23:14:23 +02:00
kay27 47bf494996
Nether portals: Implement travel up, add debug info to compare 2 searches 2021-05-13 23:07:43 +02:00
kay27 e7ec91edb7
Make Nether portals work when built on Nether roof 2021-05-13 20:52:12 +02:00
Nils Dagsson Moskopp ed1849ed81
Add command to generate Nether portal (“/spawnstruct nether_portal”) 2021-05-13 20:52:11 +02:00
kay27 56a8736149
Make Nether portals fully playable (reduce y scale to 2), fix critical bugs 2021-05-13 20:52:10 +02:00
kay27 989607142e
Fix orientational bug in portals 2021-05-13 20:52:09 +02:00
kay27 cb0d8af818
Add portal debug info, test alternative portal search algorithm 2021-05-13 20:52:08 +02:00
kay27 f182b75c66
Add teleporters queue to portals to avoid multiple searches 2021-05-13 20:52:08 +02:00
Nils Dagsson Moskopp 2f0fa1edb3
Add description to mcl_portals mod 2021-05-13 20:52:07 +02:00
kay27 db86ad52e5
Add alternative suitable place search for Nether portals in portals branch 2021-05-13 20:52:06 +02:00
kay27 5e229a24fb
Localize several API functions for Nether portals 2021-05-13 20:52:05 +02:00
kay27 6c2b6326c7
Fix old bugs, add new bugs to Nether portals 2021-05-13 20:52:04 +02:00
kay27 edf6d080c1
Fix errors with Nether portal destination calcs 2021-05-13 20:52:04 +02:00
kay27 ae3453e197
Fix chunk offset for building arrival Nether portal, log generating chunk coordinates 2021-05-13 20:52:03 +02:00
kay27 ec11b73dc3
Implement optimized Nether portals 2021-05-13 20:51:57 +02:00
iliekprogrammar 9a7237b68e
Add Nether portal breaking sounds. 2021-05-10 21:29:40 +02:00
iliekprogrammar 7a7c4215d8
Allow portals to break only in creative and to be pointed. 2021-05-10 21:22:04 +02:00
403 changed files with 1738 additions and 11800 deletions

View File

@ -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:

View File

@ -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. -->

View File

@ -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
-->

View File

@ -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

View File

@ -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_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_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
* `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
* `glass=1`: Glass (full cubes only)
* `rail=1`: Rail
* `music_record=1`: Music Disc
* `music_record`: Music Disc (rating is track ID)
* `tnt=1`: Block is TNT
* `boat=1`: Boat
* `minecart=1`: Minecart
@ -182,10 +182,6 @@ These groups are used mostly for informational purposes
* `redstone_torch=1`: Redstone Torch (lit)
* `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
* `double_plant`: Part of a double-sized plant. 1 = lower part, 2 = upper part

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -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}"

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 509 KiB

View File

@ -207,10 +207,6 @@ end
function mcl_autogroup.can_harvest(nodename, toolname)
local ndef = minetest.registered_nodes[nodename]
if not ndef then
return false
end
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
return true
end

View File

@ -0,0 +1 @@
Adds additional ways for nodes to be attached.

View File

@ -1,2 +0,0 @@
name = mcl_attached
description = Adds additional ways for nodes to be attached.

View File

@ -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.

View File

@ -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",
}
}

View File

@ -1,3 +0,0 @@
name = mcl_colors
author = Fleckenstein
description = The HTML sequences for the minecraft colors

View File

@ -57,44 +57,46 @@ local function compute_sphere_rays(radius)
local rays = {}
local sphere = {}
local function add_ray(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
end
end
end
end
for x = -radius, radius do
for z = -radius, radius do
for y = -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
end
end
end
end
for x = -radius, radius do
for i=1, 2 do
for y = -radius, radius do
for z = -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
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
break
end
end
end
end
end
for i=1,2 do
for x = -radius, radius do
for z = -radius, radius do
for y = -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
break
end
end
end
end
end
for i=1,2 do
for x = -radius, radius do
for y = -radius, radius do
for z = -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
break
end
end
end
end
@ -251,12 +253,12 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher)
if collisionbox then
-- Create rays from random points in the collision box
local x1 = collisionbox[1]
local y1 = collisionbox[2]
local z1 = collisionbox[3]
local x2 = collisionbox[4]
local y2 = collisionbox[5]
local z2 = collisionbox[6]
local x1 = collisionbox[1] * 2
local y1 = collisionbox[2] * 2
local z1 = collisionbox[3] * 2
local x2 = collisionbox[4] * 2
local y2 = collisionbox[5] * 2
local z2 = collisionbox[6] * 2
local x_len = math.abs(x2 - x1)
local y_len = math.abs(y2 - y1)
local z_len = math.abs(z2 - z1)

View File

@ -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.

View File

@ -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.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 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_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 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_min = -mapgen_limit_b * mcl_vars.MAP_BLOCKSIZE
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 numcmax = math.max(math.floor((mapgen_limit_max - ccfmax) / 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_max = central_chunk_max_pos + numcmax * chunk_size_in_nodes
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) / mcl_vars.chunk_size_in_nodes), 0) -- fullminp/fullmaxp to effective mapgen limits.
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 * mcl_vars.chunk_size_in_nodes
local function coordinate_to_block(x)
return math.floor(x / mcl_vars.MAP_BLOCKSIZE)
end
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
function mcl_vars.pos_to_block(pos)
@ -70,7 +71,7 @@ function mcl_vars.pos_to_chunk(pos)
}
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_y = k_positive_z * k_positive_z

View File

@ -1,2 +1 @@
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.

View File

@ -0,0 +1 @@
API for filling a chest with random treasures.

View File

@ -1,2 +1 @@
name = mcl_loot
description = API for filling a chest with random treasures.

View File

@ -0,0 +1 @@
Contains particle images of MineClone 2. No code.

View File

@ -1,2 +1 @@
name = mcl_particles
description = Contains particle images of MineClone 2. No code.

View File

@ -0,0 +1 @@
This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them.

View File

@ -1,2 +1 @@
name = mcl_sounds
description = This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them.

View File

@ -0,0 +1 @@
mcl_init

View File

@ -0,0 +1 @@
Helper functions for MineClone 2.

View File

@ -1,3 +1 @@
name = mcl_util
description = Helper functions for MineClone 2.
depends = mcl_init

View File

@ -0,0 +1 @@
mcl_init

View File

@ -0,0 +1 @@
Utility functions for worlds and the “dimensions”.

View File

@ -6,7 +6,7 @@ mcl_worlds = {}
function mcl_worlds.is_in_void(pos)
local void =
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))
local void_deadly = false
@ -15,11 +15,11 @@ function mcl_worlds.is_in_void(pos)
-- Overworld → Void → End → Void → Nether → Void
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
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
-- *above* the Nether also has a small tolerance area, so player
-- 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
void_deadly = pos.y < mcl_vars.mg_nether_min - deadly_tolerance
end
@ -35,7 +35,7 @@ end
function mcl_worlds.y_to_layer(y)
if y >= mcl_vars.mg_overworld_min then
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"
elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then
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
function mcl_worlds.has_dust(pos)
-- 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
-- Takes a position (pos) and returns true if compasses are working here

View File

@ -1,3 +0,0 @@
name = mcl_worlds
description = Utility functions for worlds and the “dimensions”.
depends = mcl_init

View File

@ -1 +0,0 @@
name = walkover

View File

@ -0,0 +1 @@
mcl_core

View File

@ -1,2 +0,0 @@
name = drippingwater
depends = mcl_core

View File

@ -0,0 +1,3 @@
mcl_player
mcl_core?
doc_identifier?

View File

@ -0,0 +1 @@
Adds drivable boats.

View File

@ -243,7 +243,7 @@ function boat.on_step(self, dtime, moveresult)
else
local ctrl = self._passenger:get_player_control()
if ctrl and ctrl.sneak then
detach_object(self._passenger, true)
detach_player(self._passenger, true)
self._passenger = nil
end
end
@ -260,7 +260,7 @@ function boat.on_step(self, dtime, moveresult)
return
end
local yaw = self.object:get_yaw()
if ctrl and ctrl.up then
if ctrl.up then
-- Forwards
self._v = self._v + 0.1 * v_factor
@ -269,7 +269,7 @@ function boat.on_step(self, dtime, moveresult)
self.object:set_animation({x=0, y=40}, paddling_speed, 0, true)
self._animation = 1
end
elseif ctrl and ctrl.down then
elseif ctrl.down then
-- Backwards
self._v = self._v - 0.1 * v_factor

View File

@ -1,4 +1 @@
name = mcl_boats
description = Adds drivable boats.
depends = mcl_player
optional_depends = mcl_core, doc_identifier

View File

@ -155,16 +155,6 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
}) + 1
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
if obj:is_player() then
hud_id = mcl_burning.get(obj, "int", "hud_id")
@ -178,7 +168,8 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
}) + 1
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", "sound_id", sound_id)
@ -294,7 +285,7 @@ function mcl_burning.fire_entity_step(self, dtime)
end
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
local animation_frame = self.animation_frame + 1
if animation_frame > mcl_burning.animation_frames - 1 then
@ -305,48 +296,3 @@ function mcl_burning.fire_entity_step(self, dtime)
end
self.animation_timer = animation_timer
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,
})

View File

@ -2,8 +2,7 @@ local S = minetest.get_translator("mcl_burning")
local modpath = minetest.get_modpath("mcl_burning")
mcl_burning = {
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8,
animation_fps = tonumber(minetest.settings:get("fire_animation_fps")) or 30
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8
}
dofile(modpath .. "/api.lua")

View File

@ -0,0 +1 @@
Falling node entities, Minecraft-style

View File

@ -1,2 +1 @@
name = mcl_falling_nodes
description = Falling node entities, Minecraft-style

View File

@ -0,0 +1,2 @@
flowlib
mcl_enchanting

View File

@ -0,0 +1 @@
Dropped items will be attracted to the player like a magnet.

View File

@ -1,4 +1,3 @@
local S = minetest.get_translator("mcl_item_entity")
--basic settings
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
@ -449,7 +448,7 @@ minetest.register_entity(":__builtin:item", {
end,
get_staticdata = function(self)
local data = minetest.serialize({
return minetest.serialize({
itemstring = self.itemstring,
always_collect = self.always_collect,
age = self.age,
@ -457,39 +456,6 @@ minetest.register_entity(":__builtin:item", {
_flowing = self._flowing,
_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,
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
})
-- 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
})

View File

@ -1,3 +1 @@
name = mcl_item_entity
description = Dropped items will be attracted to the player like a magnet.
depends = flowlib, mcl_enchanting

View File

@ -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?

View File

@ -0,0 +1 @@
Minecarts are vehicles to move players quickly on rails.

View File

@ -1,4 +1 @@
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

View File

@ -14,8 +14,6 @@ local DEFAULT_FALL_SPEED = -10
local FLOP_HEIGHT = 5.0
local FLOP_HOR_SPEED = 1.5
local LIGHT_SUN = minetest.LIGHT_MAX + 1
local MOB_CAP = {}
MOB_CAP.hostile = 70
MOB_CAP.passive = 10
@ -1059,7 +1057,7 @@ local do_env_damage = function(self)
if mod_worlds then
_, dim = mcl_worlds.y_to_layer(pos.y)
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
mcl_burning.set_on_fire(self.object, 10)
else
@ -2823,7 +2821,7 @@ local falling = function(self, pos)
end
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
end
end

View File

@ -0,0 +1 @@
Adds a mob API for mods to add animals or monsters, etc.

View File

@ -1,4 +1,3 @@
name = mcl_mobs
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
description = Adds a mob API for mods to add animals or monsters, etc.

View File

@ -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?

View File

@ -0,0 +1 @@
Adds Minecraft-like monsters and animals.

View File

@ -1,4 +1 @@
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

View File

@ -123,10 +123,6 @@ mobs:register_mob("mobs_mc:snowman", {
local pos = self.object:get_pos()
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
if minetest.registered_items["mcl_farming:pumpkin_face"] then
minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, "mcl_farming:pumpkin_face")
end
-- Wear out
if not minetest.is_creative_enabled(clicker:get_player_name()) then
item:add_wear(mobs_mc.misc.shears_wear)

View File

@ -74,7 +74,7 @@ local professions = {
},
{
{ { "mcl_farming:pumpkin", 8, 13 }, E1 },
{ { "mcl_farming:pumpkin_face", 8, 13 }, E1 },
{ E1, { "mcl_farming:pumpkin_pie", 2, 3} },
},

View File

@ -0,0 +1,2 @@
mcl_init
mcl_core

View File

@ -1,2 +0,0 @@
name = mobs_mc_gameconfig
depends = mcl_init, mcl_core

View File

@ -0,0 +1,2 @@
mcl_fire
mcl_death_messages?

View File

@ -0,0 +1 @@
A mod that adds thunder and lightning effects.

View File

@ -1,4 +1 @@
name = lightning
description = A mod that adds thunder and lightning effects.
depends = mcl_fire
optional_depends = mcl_death_messages

View File

@ -0,0 +1,2 @@
mcl_worlds
mcl_death_messages

View File

@ -0,0 +1 @@
Deal damage to entities stuck in the deep void

View File

@ -1,3 +1 @@
name = mcl_void_damage
description = Deal damage to entities stuck in the deep void
depends = mcl_worlds, mcl_death_messages

View File

@ -0,0 +1,3 @@
mcl_init
mcl_worlds
lightning?

View File

@ -0,0 +1 @@
Weather and sky handling: Rain, snow, thunderstorm, End and Nether ambience

View File

@ -1,4 +1 @@
name = mcl_weather
description = Weather and sky handling: Rain, snow, thunderstorm, End and Nether ambience
depends = mcl_init, mcl_worlds
optional_depends = lightning

View File

@ -0,0 +1 @@
Provides an extensible in-game help with texts about gameplay basics (such a crafting), items and advanced usage.

View File

@ -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.

View File

@ -0,0 +1,6 @@
mcl_core
mcl_compass
mcl_clock
doc
sfinv?
sfinv_buttons?

View File

@ -0,0 +1,2 @@
The most comprehensive Crafting Guide
on Minetest.

View File

@ -1,5 +1 @@
name = mcl_craftguide
description = The most comprehensive Crafting Guide
on Minetest.
depends = mcl_core, mcl_compass, mcl_clock, doc
optional_depends = sfinv, sfinv_buttons

View File

@ -0,0 +1,2 @@
doc
doc_items

View File

@ -0,0 +1 @@
This MineClone 2 mod sets up and configures the Help modpack mods to tailor the help towards MineClone 2.

View File

@ -1,3 +1 @@
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

View File

@ -0,0 +1,2 @@
tt
mcl_enchanting

View File

@ -1,2 +0,0 @@
name = mcl_tt
depends = tt, mcl_enchanting

View File

@ -0,0 +1,2 @@
sfinv?
unified_inventory?

View File

@ -0,0 +1 @@
Adds achievements to Minetest, and an API to register new ones.

View File

@ -5,4 +5,3 @@ description = Adds achievements to Minetest, and an API to register new ones.
license = LGPL 2.1 or later
forum = https://forum.minetest.net/viewtopic.php?t=4870
version = 2.3.0
optional_depends = sfinv, unified_inventory

View File

@ -413,7 +413,6 @@ function hb.hide_hudbar(player, identifier)
local name = player:get_player_name()
local hudtable = hb.get_hudtable(identifier)
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 hudtable.hudids[name].icon ~= nil then
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 hudtable = hb.get_hudtable(identifier)
if hudtable == nil then return false end
if hudtable.hudstate[name].hidden == false then return true end
local value = hudtable.hudstate[name].value
local max = hudtable.hudstate[name].max
if hb.settings.bar_type == "progress_bar" then

View File

@ -0,0 +1 @@
awards

View File

@ -1,2 +1 @@
name = mcl_achievements
depends = awards

View File

@ -0,0 +1 @@
Provides core textures needed by Minetest.

View File

@ -1,2 +1 @@
name = mcl_base_textures
description = Provides core textures needed by Minetest.

View File

@ -0,0 +1 @@
Shows messages in chat when a player dies.

View File

@ -3,106 +3,13 @@ local N = function(s) return s end
local function get_tool_name(item)
local name = item:get_meta():get_string("name")
if name == "" then
local def = item:get_definition()
name=def._tt_original_description or def.description
if name ~= "" then
return name
end
local sanitized_name, substitution_count = name:gsub("[\r\n]"," ")
return sanitized_name
local def = item:get_definition()
return def._tt_original_description or def.description
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 = {}
-- Death messages

View File

@ -10,7 +10,6 @@
@1 drowned.=@1 ertrank.
@1 ran out of oxygen.=@1 ging die Luft aus.
@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 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.

View File

@ -10,7 +10,6 @@
@1 drowned.=
@1 ran out of oxygen.=
@1 was killed by @2.=
@1 was slain by @2.=
@1 was killed.=
@1 was killed by a mob.=
@1 was burned to death by a blaze's fireball.=

View File

@ -1,2 +1 @@
name = mcl_death_messages
description = Shows messages in chat when a player dies.

View File

@ -1 +0,0 @@
name = mcl_experience

View File

@ -1,2 +1 @@
name = mcl_formspec
description = Helper mod to simplify creation of formspecs a little bit

View File

@ -0,0 +1 @@
mcl_init

View File

@ -1,2 +1 @@
name = mcl_formspec_prepend
depends = mcl_init

View File

@ -0,0 +1 @@
Adds a HUD bar displaying the current damage of the player's armor.

View File

@ -1,3 +1,2 @@
name = mcl_hbarmor
depends = hudbars, mcl_armor
description = Adds a HUD bar displaying the current damage of the player's armor.

View File

@ -28,9 +28,10 @@ local function replace_enchanted_books(tbl)
end
end
--[[ Populate all the item tables. We only do this once. Note this code must be
executed after loading all the other mods in order to work. ]]
minetest.register_on_mods_loaded(function()
--[[ Populate all the item tables. We only do this once. Note this mod must be
loaded after _mcl_autogroup for this to work, because it required certain
groups to be set. ]]
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
local is_redstone = function(def)
@ -108,7 +109,7 @@ minetest.register_on_mods_loaded(function()
table.sort(to_sort)
replace_enchanted_books(to_sort)
end
end)
end
local function filter_item(name, description, lang, filter)
local desc
@ -117,7 +118,7 @@ local function filter_item(name, description, lang, filter)
else
desc = string.lower(minetest.get_translated_string(lang, description))
end
return string.find(name, filter, nil, true) or string.find(desc, filter, nil, true)
return string.find(name, filter) or string.find(desc, filter)
end
local function set_inv_search(filter, player)

View File

@ -0,0 +1,8 @@
mcl_init
mcl_formspec
mcl_player?
_mcl_autogroup?
mcl_armor?
mcl_brewing?
mcl_potions?
mcl_enchanting

Some files were not shown because too many files have changed in this diff Show More