Update trapdoor climbable behavior #3938
No reviewers
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-Minecraft feature
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#3938
Loading…
Reference in New Issue
No description provided.
Delete Branch "Dehydrate6684/MineClone2:trapdoor-ladder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Trapdoors are now only claimable below a ladder as stated in the TODO.
Relevant Wiki Entry: https://minecraft.fandom.com/wiki/Trapdoor#Properties
Testing
Place trapdoors below ladders and try climbing.
Update trapdoor climbable behaviorto WIP: Update trapdoor climbable behaviorWIP: Update trapdoor climbable behaviorto Update trapdoor climbable behaviorSome feedback I have after reading the code for the first time and testing for a few minutes
As of right now (on your branch), whenever placing a trapdoor, reagrdless of it's position, it gets placed as open, and closes right away, which is pretty annoying in my opinion, as it also plays the sound.
Also, it doesn't work with other climbable blocks, such as vines...
Hardcoding for a specific block like ladders isn't the way to go in this case I think, it should work with all climbable blocks no matter what.
In my test case, the trapdoors only became climbable in some very specific rotations, which I (personally) don't like, though I am not too sure if that is intended in this case
@ -14,0 +18,4 @@
---@param trapdoor integer The param2 value of the trapdoor.
---@return boolean If the ladder and trapdoor are in the same direction.
local function check_direction(ladder, trapdoor)
local convert_table = {};
Please out the hardcoded values in the array directly, like
Also, please remove the semicolon, this isn't C ;)
@ -14,0 +25,4 @@
convert_table[5] = { 2, 22 }
local conversion = convert_table[ladder];
if conversion == nil then
Unless you have some special case where this should not be executes when the value = false (which it can't in this case, please use
not
if not conversion then
@ -14,0 +40,4 @@
---@param ladder integer The param2 value of the ladder.
---@param event "place" | "destruct" The place or destruct event.
local function update_trapdoor(pos, ladder, event)
local top_pos = vector.add(pos, { x = 0, y = 1, z = 0 })
This needs no change, but you could simply say
{ y = 1 }
The others are needed otherwise it will cause the game to crash.
Could be
vector.offset(pos, 0, 1, 0)
@ -14,0 +43,4 @@
local top_pos = vector.add(pos, { x = 0, y = 1, z = 0 })
local top_node = minetest.get_node_or_nil(top_pos)
if top_node then
local new_name = top_node.name
You may check if it's a trapdoor RIGHT here, and return if not, as otherwise, this won't do anything
@ -51,0 +54,4 @@
---@param ladder integer The param2 value of the ladder.
---@param trapdoor integer The param2 value of the trapdoor.
---@return boolean If the ladder and trapdoor are in the same direction.
function check_direction(ladder, trapdoor)
This seems like code duplication to me...
Also, when making something global, it should contain the modname, for example
mcl_doors.check_direction
@ -206,0 +248,4 @@
fixed = {-0.5, -0.5, 5/16, 0.5, 0.5, 0.5}
},
on_rightclick = on_rightclick,
mesecons = {effector = {
This one is nitpicky, but please fix the indention here
@ -206,0 +260,4 @@
minetest.register_node(name.."_ladder", {
drawtype = "nodebox",
tiles = tiles_open,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
Isn't this always true no matter what?
I copied from the code above. I am not sure what is should be so I just left it there.
I think this was a thing before my changes but I do agree it should be changed.
EDIT: I tested this but this doesn't seem to be the case for me.
This is intended as in Minecraft only ladders have this kind of behavior with trapdoors. Hence, this property does not apply to vines, weeping vines and other climbable blocks.
This is also intended behavior. The trap door only behaves like a ladder when has the same orientation (facing the same direction as the ladder).
In my opinion, this should be implemented for all climbables, regardless of what MC does.
I think we should create an issue tracker for this and put this in a different pull request. However, imo it might be weird to apply for all climbable because not all climbable are wall mounted.
Fine, then utilize the "ladder" group that you implemented.
Also, what is the reason to restrict the trapdoor to helping you climb only wall-mounted nodes? Logic? If you think about the logic of it though, why can't a trapdoor assist with climbing the climbable non-wall-mounted (centered) nodes? At this point, why would it be restricted to a single trapdoor? Can't you climb a stack of trapdoors (especially those with holes in their texture) like ladders? Speaking about ladders, you can place ladders on opposite or perpendicular surfaces and they're still climbable. Why can't a trapdoor be used the same way? Considering these, why change anything at all?
Anyway, go through the review you received and implement all the points. Mark all those you have already implemented as done, too.
@ -14,0 +19,4 @@
---@return boolean If the ladder and trapdoor are in the same direction.
function mcl_core.check_direction(ladder, trapdoor)
local convert_table = {
nil,
why exactly do you have nil in a hard coded array?
This is due to the param2 of ladder. This way I can access the values I need without transforming the value for the array.
That being said probably could have minus one and it will still work.
A simple question on this, and hopefully I don't sound ignorant in asking, but... Why not have a "climbable" group?
Ahh, you made a ladder group. hmmn.
If you look at the way that minecraft does it, trapdoors are only climbable in certain instances. (I remember sometime last year asking about this.) I found it weird that the trapdoors used as shudders on the outside of buildings were able to be climbed.
Though, putting ladders one one side of a stack of trapdoors, is a cool way to have a ladder in the middle of a room. Though, in MC, the trapdoor side of that is not climbable.
I've got mixed feelings about this, because you can climb ladder configurations like the one in the attached screenshot, while you can't climb trapdoors with different orientation. I guess you could explain that ladders are more handy, but still...
Add vine and skulk vein to the ladder group.
Remove the orientation requirement. So, if the trapdoor is perpendicular or opposite to the ladder, it should also be climbable. The rest of the constraints from the PR are accepted. If you implement this and the above request, we're merging this.
How's it going? Are you going to finish it, or you would like somebody to pick this up? You could enable edits from maintainers if you want.
Sorry I was a little busy lately but I manage to find some time and finish the requests.