mirror of
https://github.com/OgelGames/powerbanks.git
synced 2024-11-22 07:13:50 +01:00
more tweaks, place and pick-up sounds
This commit is contained in:
parent
c2468774a3
commit
9bc76121e3
@ -1,6 +1,6 @@
|
||||
## License
|
||||
|
||||
Except for the exceptions stated below, all code is licensed under the [MIT License](LICENSE.md#mit-license), with all other assets licensed under the [CC BY-SA 4.0 License](LICENSE.md#cc-by-sa-40-license).
|
||||
Except for the exceptions stated below, all code is licensed under the [MIT License](LICENSE.md#mit-license), with textures licensed under the [CC BY-SA 4.0 License](LICENSE.md#cc-by-sa-40-license).
|
||||
|
||||
## Exceptions
|
||||
|
||||
|
10
README.md
10
README.md
@ -1,7 +1,7 @@
|
||||
# powerbanks
|
||||
|
||||
[![Build Status](https://travis-ci.org/OgelGames/powerbanks.svg?branch=master)](https://travis-ci.org/OgelGames/powerbanks)
|
||||
[![License](https://img.shields.io/badge/License-MIT%20and%20CC%20BY--SA%204.0-brightgreen.svg)](LICENSE.md)
|
||||
[![License](https://img.shields.io/badge/License-MIT%20and%20CC%20BY--SA%204.0-green.svg)](LICENSE.md)
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@ -23,13 +23,13 @@ This mod adds portable powerbanks used to charge technic tools.
|
||||
|
||||
- **Fully portable** - charge will remain no matter how many times you place and pick it up!
|
||||
- **Self-protected** - no need to worry about leaving your powerbank while it's charging your tools, only you can pick it up!
|
||||
- **Fast charging** - each version charges faster than its technic battery equivalent.
|
||||
- **Fast charging** - each version charges faster than its technic battery equivalent (LV, MV, HV).
|
||||
- **Multiple charging slots** - powerbanks can charge more than one tool at once! (except for Mk1)
|
||||
|
||||
## Usage
|
||||
|
||||
1. Obtain a powerbank (obviously :P).
|
||||
2. Charge the powerbank in a technic battery.
|
||||
2. Charge the powerbank.
|
||||
|
||||
![Charging a Powerbank](screenshots/charging.png?raw=true "Charging a Powerbank")
|
||||
|
||||
@ -74,7 +74,7 @@ Currently there are three different powerbanks:
|
||||
|
||||
## Dependencies
|
||||
|
||||
Currently this mod only depends on the [technic](https://github.com/minetest-mods/technic) mod.
|
||||
Currently this mod only depends on the default and [technic](https://github.com/minetest-mods/technic) mods.
|
||||
|
||||
## Installation
|
||||
|
||||
@ -86,4 +86,4 @@ To install this mod, simply download it using one of the methods below, and plac
|
||||
|
||||
## License
|
||||
|
||||
Except for the exceptions stated in [LICENSE.md](LICENSE.md#exceptions), all code is licensed under the [MIT License](LICENSE.md#mit-license), with all other assets licensed under the [CC BY-SA 4.0 License](LICENSE.md#cc-by-sa-40-license).
|
||||
Except for the exceptions stated in [LICENSE.md](LICENSE.md#exceptions), all code is licensed under the [MIT License](LICENSE.md#mit-license), with textures licensed under the [CC BY-SA 4.0 License](LICENSE.md#cc-by-sa-40-license).
|
||||
|
8
init.lua
8
init.lua
@ -14,10 +14,7 @@ end
|
||||
|
||||
local function is_chargeable(stack)
|
||||
local item_name = stack:get_name()
|
||||
if not technic.power_tools[item_name] then
|
||||
return false
|
||||
end
|
||||
if item_name:find("powerbanks:powerbank") then
|
||||
if (not technic.power_tools[item_name]) or item_name:find("powerbanks:powerbank") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
@ -173,6 +170,8 @@ local function register_powerbank(data)
|
||||
|
||||
update_infotext(pos, false, data)
|
||||
update_formspec(pos, itemstack_meta.charge, data)
|
||||
|
||||
minetest.sound_play({name = "default_place_node_hard"}, {pos = pos})
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
@ -212,6 +211,7 @@ local function register_powerbank(data)
|
||||
minetest.add_item(pos, item)
|
||||
end
|
||||
|
||||
minetest.sound_play({name = "default_dug_node"}, {pos = pos})
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
})
|
||||
|
2
mod.conf
2
mod.conf
@ -1,3 +1,3 @@
|
||||
name = powerbanks
|
||||
description = Adds portable powerbanks used to charge technic tools
|
||||
depends = technic
|
||||
depends = default, technic
|
||||
|
Loading…
Reference in New Issue
Block a user