Skip to content

Commit

Permalink
more tweaks, place and pick-up sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Dec 14, 2019
1 parent c246877 commit 9bc7612
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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")

Expand Down Expand Up @@ -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

Expand All @@ -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 changes: 4 additions & 4 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
})
Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = powerbanks
description = Adds portable powerbanks used to charge technic tools
depends = technic
depends = default, technic

0 comments on commit 9bc7612

Please sign in to comment.