Detect automatically if rubber band can be used instead...
...of setting slingshot.require_rubber_bandmaster
parent
fc5af06c0c
commit
c2799b208d
|
@ -7,6 +7,7 @@ v0.3
|
|||
- slingshots can be repaired with workbench if "xdecor.register_repairable" method available
|
||||
- craft recipes & aliases no longer registered with slingshot registration
|
||||
- technic:rubber outputs 6 rubber bands instead of 10
|
||||
- detect automatically if rubber band can be used instead of setting slingshot.require_rubber_band
|
||||
|
||||
v0.2
|
||||
----
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-06-10 11:48:27 </i>
|
||||
<i style="float:right;">Last updated 2021-06-10 12:02:02 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
@ -196,7 +196,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-06-10 11:48:27 </i>
|
||||
<i style="float:right;">Last updated 2021-06-10 12:02:02 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
@ -57,10 +57,6 @@
|
|||
|
||||
<h2><a href="#Slingshot_specific_settings">Slingshot specific settings </a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#slingshot.require_rubber_band">slingshot.require_rubber_band</a></td>
|
||||
<td class="summary">Require rubber band for slingshot craft recipe.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#slingshot.old_textures">slingshot.old_textures</a></td>
|
||||
<td class="summary">Use old 16x16 textures.</td>
|
||||
|
@ -108,28 +104,6 @@
|
|||
Settings unique to this mod.
|
||||
</div>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "slingshot.require_rubber_band"></a>
|
||||
<strong>slingshot.require_rubber_band</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Require rubber band for slingshot craft recipe.
|
||||
|
||||
<h3>Type:</h3>
|
||||
<ul>
|
||||
<i>bool</i>
|
||||
</ul>
|
||||
<h3>Default:</h3>
|
||||
<ul>
|
||||
<i>true</i>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "slingshot.old_textures"></a>
|
||||
<strong>slingshot.old_textures</strong>
|
||||
|
@ -322,7 +296,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-06-10 11:48:27 </i>
|
||||
<i style="float:right;">Last updated 2021-06-10 12:02:02 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
5
init.lua
5
init.lua
|
@ -39,8 +39,3 @@ local scripts = {
|
|||
for index, script in ipairs(scripts) do
|
||||
dofile(slingshot.modpath .. "/" .. script .. ".lua")
|
||||
end
|
||||
|
||||
|
||||
if slingshot.log_mods then
|
||||
core.log("action", "[slingshot] Require rubber band: " .. tostring(slingshot.require_rubber_band))
|
||||
end
|
||||
|
|
|
@ -12,13 +12,6 @@
|
|||
-- @section settings_specific
|
||||
|
||||
|
||||
--- Require rubber band for slingshot craft recipe.
|
||||
--
|
||||
-- @setting slingshot.require_rubber_band
|
||||
-- @settype bool
|
||||
-- @default true
|
||||
slingshot.require_rubber_band = core.settings:get_bool("slingshot.require_rubber_band", true)
|
||||
|
||||
--- Use old 16x16 textures.
|
||||
--
|
||||
-- @setting slingshot.old_textures
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
# Require rubber band as additional ingredient in slingshot craft recipes.
|
||||
slingshot.require_rubber_band (Require rubber band in craft recipe) bool true
|
||||
|
||||
# Use old 16x16 textures.
|
||||
slingshot.old_textures (Old slingshot textures) bool false
|
||||
|
||||
|
|
19
weapons.lua
19
weapons.lua
|
@ -13,18 +13,25 @@ if slingshot.old_textures then
|
|||
end
|
||||
|
||||
|
||||
core.register_craftitem("slingshot:rubber_band", {
|
||||
description = "Rubber band",
|
||||
inventory_image = "slingshot_" .. textures.rubber_band .. ".png",
|
||||
})
|
||||
local rubber_available = core.registered_items["technic:rubber"] ~= nil
|
||||
local latex_available = core.registered_items["technic:raw_latext"] ~= nil
|
||||
|
||||
if core.global_exists("technic") then
|
||||
if rubber_available or latex_available then
|
||||
core.register_craftitem("slingshot:rubber_band", {
|
||||
description = "Rubber band",
|
||||
inventory_image = "slingshot_" .. textures.rubber_band .. ".png",
|
||||
})
|
||||
end
|
||||
|
||||
if rubber_available then
|
||||
core.register_craft({
|
||||
output = "slingshot:rubber_band 6",
|
||||
type = "shapeless",
|
||||
recipe = {"technic:rubber"},
|
||||
})
|
||||
end
|
||||
|
||||
if latex_available then
|
||||
core.register_craft({
|
||||
output = "slingshot:rubber_band 2",
|
||||
recipe = {
|
||||
|
@ -38,7 +45,7 @@ end
|
|||
|
||||
local ing_1 = "group:stick"
|
||||
local ing_2 = ""
|
||||
if core.global_exists("technic") and slingshot.require_rubber_band then
|
||||
if core.registered_items["slingshot:rubber_band"] then
|
||||
ing_2 = "slingshot:rubber_band"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue