New mesh door models, and extensive door API
authorAuke Kok <sofar@foo-projects.org>
Sat, 16 Jan 2016 02:50:32 +0000 (18:50 -0800)
committerparamat <mat.gregory@virginmedia.com>
Sat, 13 Feb 2016 03:47:28 +0000 (03:47 +0000)
commitf600a9f645af40d22c8eb7c17aff89507b71816e
tree5ee3560f400990c9c1adb6e7b9e27a3e2e9eba32
parent9e54b379c8ba50228f3773a158cc5e4aa8b427a8
New mesh door models, and extensive door API

This patch replaces the default door nodes with a new mesh model
and nodes.

Two new models were added that are 2 blocks high. One for left-hinge
and one for right-hinge doors. This allows us to make a single texture
fit on both models. The alternative would have been 1 model and 2
unmapped textures, which is more work for mod developers.

Doors work exactly like the old doors, including ownership, breaking
doors, opening and closing.

Under the hood, we can prevent the top part of the door from being
obstructed by placing an invisible node. This prevents liquids from
flowing through doors or people placing sand or other blocks in the
top half. The door code automatically places and removes these as
needed.

Metadata is used to store door state, just like the old version.

A doors API is added, it allows mods to use the API to open/close or
toggle door states without worrying about sounds, permissions and
other details. This is intended for e.g. mesecons. This API allows
mods to manipulate or inspect doors for players or for themselves.

In-game old door nodes are automatically converted using an ABM and
preserve ownership and orientation and state.

TNT blows up all doors and trapdoors except for the steel ones,
who can survive a blast. We return an itemstack in on_blast(),
which requires a TNT API patch which is also pending.

We enable backface culling for most of these doors, as this gives
the identical visual appearance that the old doors had. In the case
of the glass door, there's a slight twist.

The texture files used by the new doors have new names that do
not conflict with previous texture file names to avoid texture
pack conflicts.

Thanks to red-001 <red-001@users.noreply.github.com> for some
of the conversion code, cleanups, and extra textures.
29 files changed:
game_api.txt
mods/doors/README.txt
mods/doors/init.lua
mods/doors/models/door_a.obj [new file with mode: 0644]
mods/doors/models/door_b.obj [new file with mode: 0644]
mods/doors/textures/doors_brown.png [deleted file]
mods/doors/textures/doors_door_glass.png [new file with mode: 0644]
mods/doors/textures/doors_door_obsidian_glass.png [new file with mode: 0644]
mods/doors/textures/doors_door_steel.png [new file with mode: 0644]
mods/doors/textures/doors_door_wood.png [new file with mode: 0644]
mods/doors/textures/doors_glass.png [deleted file]
mods/doors/textures/doors_glass_a.png [deleted file]
mods/doors/textures/doors_glass_b.png [deleted file]
mods/doors/textures/doors_glass_side.png [deleted file]
mods/doors/textures/doors_grey.png [deleted file]
mods/doors/textures/doors_item_glass.png [new file with mode: 0644]
mods/doors/textures/doors_item_obsidian_glass.png [new file with mode: 0644]
mods/doors/textures/doors_item_steel.png [new file with mode: 0644]
mods/doors/textures/doors_item_wood.png [new file with mode: 0644]
mods/doors/textures/doors_obsidian_glass.png [deleted file]
mods/doors/textures/doors_obsidian_glass_a.png [deleted file]
mods/doors/textures/doors_obsidian_glass_b.png [deleted file]
mods/doors/textures/doors_obsidian_glass_side.png [deleted file]
mods/doors/textures/doors_steel.png [deleted file]
mods/doors/textures/doors_steel_a.png [deleted file]
mods/doors/textures/doors_steel_b.png [deleted file]
mods/doors/textures/doors_wood.png [deleted file]
mods/doors/textures/doors_wood_a.png [deleted file]
mods/doors/textures/doors_wood_b.png [deleted file]