Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Separate player code into new mod
- Loading branch information
1 parent
7ffd176
commit 5d19fd6
Showing
16 changed files
with
122 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
player_api? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Minetest Game mod: player_api | ||
============================ | ||
See license.txt for license information. | ||
|
||
Provides an API to allow multiple mods to set player models and textures. | ||
Also sets the default model, texture, and player flags. | ||
|
||
Authors of source code | ||
---------------------- | ||
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1) | ||
Various Minetest developers and contributors (LGPL 2.1) | ||
|
||
Authors of media (textures, models and sounds) | ||
---------------------------------------------- | ||
|
||
MirceaKitsune (CC BY-SA 3.0): | ||
character.x | ||
|
||
Jordach (CC BY-SA 3.0): | ||
character.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
dofile(minetest.get_modpath("player_api") .. "/api.lua") | ||
|
||
-- Default player appearance | ||
player_api.register_model("character.b3d", { | ||
animation_speed = 30, | ||
textures = {"character.png", }, | ||
animations = { | ||
-- Standard animations. | ||
stand = { x= 0, y= 79, }, | ||
lay = { x=162, y=166, }, | ||
walk = { x=168, y=187, }, | ||
mine = { x=189, y=198, }, | ||
walk_mine = { x=200, y=219, }, | ||
sit = { x= 81, y=160, }, | ||
}, | ||
}) | ||
|
||
-- Update appearance when the player joins | ||
minetest.register_on_joinplayer(function(player) | ||
player_api.player_attached[player:get_player_name()] = false | ||
player_api.set_model(player, "character.b3d") | ||
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30) | ||
|
||
player:hud_set_hotbar_image("gui_hotbar.png") | ||
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") | ||
end) |
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes