Codebase list minetest-mod-throwing / 2712d17
Update upstream source from tag 'upstream/1.1' Update to upstream version '1.1' with Debian dir 136e42b18c418728f4fc732d5e9a0b82a8ba2521 Julien Puydt 4 years ago
63 changed file(s) with 962 addition(s) and 1523 deletion(s). Raw diff Collapse all Expand all
0 Mozilla Public License Version 2.0
1 ==================================
2
3 1. Definitions
4 --------------
5
6 1.1. "Contributor"
7 means each individual or legal entity that creates, contributes to
8 the creation of, or owns Covered Software.
9
10 1.2. "Contributor Version"
11 means the combination of the Contributions of others (if any) used
12 by a Contributor and that particular Contributor's Contribution.
13
14 1.3. "Contribution"
15 means Covered Software of a particular Contributor.
16
17 1.4. "Covered Software"
18 means Source Code Form to which the initial Contributor has attached
19 the notice in Exhibit A, the Executable Form of such Source Code
20 Form, and Modifications of such Source Code Form, in each case
21 including portions thereof.
22
23 1.5. "Incompatible With Secondary Licenses"
24 means
25
26 (a) that the initial Contributor has attached the notice described
27 in Exhibit B to the Covered Software; or
28
29 (b) that the Covered Software was made available under the terms of
30 version 1.1 or earlier of the License, but not also under the
31 terms of a Secondary License.
32
33 1.6. "Executable Form"
34 means any form of the work other than Source Code Form.
35
36 1.7. "Larger Work"
37 means a work that combines Covered Software with other material, in
38 a separate file or files, that is not Covered Software.
39
40 1.8. "License"
41 means this document.
42
43 1.9. "Licensable"
44 means having the right to grant, to the maximum extent possible,
45 whether at the time of the initial grant or subsequently, any and
46 all of the rights conveyed by this License.
47
48 1.10. "Modifications"
49 means any of the following:
50
51 (a) any file in Source Code Form that results from an addition to,
52 deletion from, or modification of the contents of Covered
53 Software; or
54
55 (b) any new file in Source Code Form that contains any Covered
56 Software.
57
58 1.11. "Patent Claims" of a Contributor
59 means any patent claim(s), including without limitation, method,
60 process, and apparatus claims, in any patent Licensable by such
61 Contributor that would be infringed, but for the grant of the
62 License, by the making, using, selling, offering for sale, having
63 made, import, or transfer of either its Contributions or its
64 Contributor Version.
65
66 1.12. "Secondary License"
67 means either the GNU General Public License, Version 2.0, the GNU
68 Lesser General Public License, Version 2.1, the GNU Affero General
69 Public License, Version 3.0, or any later versions of those
70 licenses.
71
72 1.13. "Source Code Form"
73 means the form of the work preferred for making modifications.
74
75 1.14. "You" (or "Your")
76 means an individual or a legal entity exercising rights under this
77 License. For legal entities, "You" includes any entity that
78 controls, is controlled by, or is under common control with You. For
79 purposes of this definition, "control" means (a) the power, direct
80 or indirect, to cause the direction or management of such entity,
81 whether by contract or otherwise, or (b) ownership of more than
82 fifty percent (50%) of the outstanding shares or beneficial
83 ownership of such entity.
84
85 2. License Grants and Conditions
86 --------------------------------
87
88 2.1. Grants
89
90 Each Contributor hereby grants You a world-wide, royalty-free,
91 non-exclusive license:
92
93 (a) under intellectual property rights (other than patent or trademark)
94 Licensable by such Contributor to use, reproduce, make available,
95 modify, display, perform, distribute, and otherwise exploit its
96 Contributions, either on an unmodified basis, with Modifications, or
97 as part of a Larger Work; and
98
99 (b) under Patent Claims of such Contributor to make, use, sell, offer
100 for sale, have made, import, and otherwise transfer either its
101 Contributions or its Contributor Version.
102
103 2.2. Effective Date
104
105 The licenses granted in Section 2.1 with respect to any Contribution
106 become effective for each Contribution on the date the Contributor first
107 distributes such Contribution.
108
109 2.3. Limitations on Grant Scope
110
111 The licenses granted in this Section 2 are the only rights granted under
112 this License. No additional rights or licenses will be implied from the
113 distribution or licensing of Covered Software under this License.
114 Notwithstanding Section 2.1(b) above, no patent license is granted by a
115 Contributor:
116
117 (a) for any code that a Contributor has removed from Covered Software;
118 or
119
120 (b) for infringements caused by: (i) Your and any other third party's
121 modifications of Covered Software, or (ii) the combination of its
122 Contributions with other software (except as part of its Contributor
123 Version); or
124
125 (c) under Patent Claims infringed by Covered Software in the absence of
126 its Contributions.
127
128 This License does not grant any rights in the trademarks, service marks,
129 or logos of any Contributor (except as may be necessary to comply with
130 the notice requirements in Section 3.4).
131
132 2.4. Subsequent Licenses
133
134 No Contributor makes additional grants as a result of Your choice to
135 distribute the Covered Software under a subsequent version of this
136 License (see Section 10.2) or under the terms of a Secondary License (if
137 permitted under the terms of Section 3.3).
138
139 2.5. Representation
140
141 Each Contributor represents that the Contributor believes its
142 Contributions are its original creation(s) or it has sufficient rights
143 to grant the rights to its Contributions conveyed by this License.
144
145 2.6. Fair Use
146
147 This License is not intended to limit any rights You have under
148 applicable copyright doctrines of fair use, fair dealing, or other
149 equivalents.
150
151 2.7. Conditions
152
153 Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
154 in Section 2.1.
155
156 3. Responsibilities
157 -------------------
158
159 3.1. Distribution of Source Form
160
161 All distribution of Covered Software in Source Code Form, including any
162 Modifications that You create or to which You contribute, must be under
163 the terms of this License. You must inform recipients that the Source
164 Code Form of the Covered Software is governed by the terms of this
165 License, and how they can obtain a copy of this License. You may not
166 attempt to alter or restrict the recipients' rights in the Source Code
167 Form.
168
169 3.2. Distribution of Executable Form
170
171 If You distribute Covered Software in Executable Form then:
172
173 (a) such Covered Software must also be made available in Source Code
174 Form, as described in Section 3.1, and You must inform recipients of
175 the Executable Form how they can obtain a copy of such Source Code
176 Form by reasonable means in a timely manner, at a charge no more
177 than the cost of distribution to the recipient; and
178
179 (b) You may distribute such Executable Form under the terms of this
180 License, or sublicense it under different terms, provided that the
181 license for the Executable Form does not attempt to limit or alter
182 the recipients' rights in the Source Code Form under this License.
183
184 3.3. Distribution of a Larger Work
185
186 You may create and distribute a Larger Work under terms of Your choice,
187 provided that You also comply with the requirements of this License for
188 the Covered Software. If the Larger Work is a combination of Covered
189 Software with a work governed by one or more Secondary Licenses, and the
190 Covered Software is not Incompatible With Secondary Licenses, this
191 License permits You to additionally distribute such Covered Software
192 under the terms of such Secondary License(s), so that the recipient of
193 the Larger Work may, at their option, further distribute the Covered
194 Software under the terms of either this License or such Secondary
195 License(s).
196
197 3.4. Notices
198
199 You may not remove or alter the substance of any license notices
200 (including copyright notices, patent notices, disclaimers of warranty,
201 or limitations of liability) contained within the Source Code Form of
202 the Covered Software, except that You may alter any license notices to
203 the extent required to remedy known factual inaccuracies.
204
205 3.5. Application of Additional Terms
206
207 You may choose to offer, and to charge a fee for, warranty, support,
208 indemnity or liability obligations to one or more recipients of Covered
209 Software. However, You may do so only on Your own behalf, and not on
210 behalf of any Contributor. You must make it absolutely clear that any
211 such warranty, support, indemnity, or liability obligation is offered by
212 You alone, and You hereby agree to indemnify every Contributor for any
213 liability incurred by such Contributor as a result of warranty, support,
214 indemnity or liability terms You offer. You may include additional
215 disclaimers of warranty and limitations of liability specific to any
216 jurisdiction.
217
218 4. Inability to Comply Due to Statute or Regulation
219 ---------------------------------------------------
220
221 If it is impossible for You to comply with any of the terms of this
222 License with respect to some or all of the Covered Software due to
223 statute, judicial order, or regulation then You must: (a) comply with
224 the terms of this License to the maximum extent possible; and (b)
225 describe the limitations and the code they affect. Such description must
226 be placed in a text file included with all distributions of the Covered
227 Software under this License. Except to the extent prohibited by statute
228 or regulation, such description must be sufficiently detailed for a
229 recipient of ordinary skill to be able to understand it.
230
231 5. Termination
232 --------------
233
234 5.1. The rights granted under this License will terminate automatically
235 if You fail to comply with any of its terms. However, if You become
236 compliant, then the rights granted under this License from a particular
237 Contributor are reinstated (a) provisionally, unless and until such
238 Contributor explicitly and finally terminates Your grants, and (b) on an
239 ongoing basis, if such Contributor fails to notify You of the
240 non-compliance by some reasonable means prior to 60 days after You have
241 come back into compliance. Moreover, Your grants from a particular
242 Contributor are reinstated on an ongoing basis if such Contributor
243 notifies You of the non-compliance by some reasonable means, this is the
244 first time You have received notice of non-compliance with this License
245 from such Contributor, and You become compliant prior to 30 days after
246 Your receipt of the notice.
247
248 5.2. If You initiate litigation against any entity by asserting a patent
249 infringement claim (excluding declaratory judgment actions,
250 counter-claims, and cross-claims) alleging that a Contributor Version
251 directly or indirectly infringes any patent, then the rights granted to
252 You by any and all Contributors for the Covered Software under Section
253 2.1 of this License shall terminate.
254
255 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
256 end user license agreements (excluding distributors and resellers) which
257 have been validly granted by You or Your distributors under this License
258 prior to termination shall survive termination.
259
260 ************************************************************************
261 * *
262 * 6. Disclaimer of Warranty *
263 * ------------------------- *
264 * *
265 * Covered Software is provided under this License on an "as is" *
266 * basis, without warranty of any kind, either expressed, implied, or *
267 * statutory, including, without limitation, warranties that the *
268 * Covered Software is free of defects, merchantable, fit for a *
269 * particular purpose or non-infringing. The entire risk as to the *
270 * quality and performance of the Covered Software is with You. *
271 * Should any Covered Software prove defective in any respect, You *
272 * (not any Contributor) assume the cost of any necessary servicing, *
273 * repair, or correction. This disclaimer of warranty constitutes an *
274 * essential part of this License. No use of any Covered Software is *
275 * authorized under this License except under this disclaimer. *
276 * *
277 ************************************************************************
278
279 ************************************************************************
280 * *
281 * 7. Limitation of Liability *
282 * -------------------------- *
283 * *
284 * Under no circumstances and under no legal theory, whether tort *
285 * (including negligence), contract, or otherwise, shall any *
286 * Contributor, or anyone who distributes Covered Software as *
287 * permitted above, be liable to You for any direct, indirect, *
288 * special, incidental, or consequential damages of any character *
289 * including, without limitation, damages for lost profits, loss of *
290 * goodwill, work stoppage, computer failure or malfunction, or any *
291 * and all other commercial damages or losses, even if such party *
292 * shall have been informed of the possibility of such damages. This *
293 * limitation of liability shall not apply to liability for death or *
294 * personal injury resulting from such party's negligence to the *
295 * extent applicable law prohibits such limitation. Some *
296 * jurisdictions do not allow the exclusion or limitation of *
297 * incidental or consequential damages, so this exclusion and *
298 * limitation may not apply to You. *
299 * *
300 ************************************************************************
301
302 8. Litigation
303 -------------
304
305 Any litigation relating to this License may be brought only in the
306 courts of a jurisdiction where the defendant maintains its principal
307 place of business and such litigation shall be governed by laws of that
308 jurisdiction, without reference to its conflict-of-law provisions.
309 Nothing in this Section shall prevent a party's ability to bring
310 cross-claims or counter-claims.
311
312 9. Miscellaneous
313 ----------------
314
315 This License represents the complete agreement concerning the subject
316 matter hereof. If any provision of this License is held to be
317 unenforceable, such provision shall be reformed only to the extent
318 necessary to make it enforceable. Any law or regulation which provides
319 that the language of a contract shall be construed against the drafter
320 shall not be used to construe this License against a Contributor.
321
322 10. Versions of the License
323 ---------------------------
324
325 10.1. New Versions
326
327 Mozilla Foundation is the license steward. Except as provided in Section
328 10.3, no one other than the license steward has the right to modify or
329 publish new versions of this License. Each version will be given a
330 distinguishing version number.
331
332 10.2. Effect of New Versions
333
334 You may distribute the Covered Software under the terms of the version
335 of the License under which You originally received the Covered Software,
336 or under the terms of any subsequent version published by the license
337 steward.
338
339 10.3. Modified Versions
340
341 If you create software not governed by this License, and you want to
342 create a new license for such software, you may create and use a
343 modified version of this License if you rename the license and remove
344 any references to the name of the license steward (except to note that
345 such modified license differs from this License).
346
347 10.4. Distributing Source Code Form that is Incompatible With Secondary
348 Licenses
349
350 If You choose to distribute Source Code Form that is Incompatible With
351 Secondary Licenses under the terms of this version of the License, the
352 notice described in Exhibit B of this License must be attached.
353
354 Exhibit A - Source Code Form License Notice
355 -------------------------------------------
356
357 This Source Code Form is subject to the terms of the Mozilla Public
358 License, v. 2.0. If a copy of the MPL was not distributed with this
359 file, You can obtain one at http://mozilla.org/MPL/2.0/.
360
361 If it is not possible or desirable to put the notice in a particular
362 file, then You may include the notice in a location (such as a LICENSE
363 file in a relevant directory) where a recipient would be likely to look
364 for such a notice.
365
366 You may add additional accurate notices of copyright ownership.
367
368 Exhibit B - "Incompatible With Secondary Licenses" Notice
369 ---------------------------------------------------------
370
371 This Source Code Form is "Incompatible With Secondary Licenses", as
372 defined by the Mozilla Public License, v. 2.0.
373
0 This modpack contains:
1 * `throwing`, an API for registering throwing and throwable things,
2 * `throwing_arrow`, a compatible replacement for the throwing mod by PilzAdam using the throwing API.
0 # Throwing
31
4 Please refer to the mods individual README for more information.
2 ## Developed by the Eurythmia team
3
4 This mod is an API for registering throwing and throwable things.
5
6 Mods based on this API:
7 * [throwing_arrows](https://github.com/minetest-mods/throwing_arrows) is a compatible replacement for the throwing mod by PilzAdam.
8 * [sling](https://github.com/minetest-mods/sling) is a mod written by @tacotexmex that enables item stack and single item throwing of any item.
9 * [Native American Village](https://github.com/Steamed-Punk/Native-American-Village), by Steamed-Punk, adds, among many other various items, a tomahawk that can be thrown.
10
11 ## Configuration
12
13 The settings are the following:
14 ```
15 # Trajectory parameters
16 throwing.vertical_acceleration = -10
17 throwing.realistic_trajectory = false
18 throwing.frictional_coefficient = -.5
19
20 # How the initial velocity of arrows is computed: simple, strength, or momentum
21 throwing.velocity_mode = strength
22 throwing.velocity_factor = 19
23
24 # Whether to allow placing an arrow as a node
25 throwing.allow_arrow_placing = false
26
27 # Minimum time between two shots
28 throwing.bow_cooldown = 0.2
29
30 # Whether to enable toolranks for bows
31 throwing.toolranks = true
32 ```
33
34 ### Trajectory parameters
35
36 By default, the trajectory of the arrow is a simple parabola. You can set the vertical acceleration (acceleration of gravity) using `throwing.vertical_acceleration`.
37
38 If you want a more realistic trajectory that uses a first-order modelling of air friction, you can set `throwing.realistic_trajectory` to true. In this mode, `throwing.frictional_coefficient` indicates the ratio between the friction force on the arrow and its velocity. It should be negative. The acceleration of the arrow is subsequently determined by dividing the force by the "mass" of the arrow, the reference mass of 1 being the mass of a simple steel arrow. Generally, the frictional coefficient should be quite small; a value of -1 will already drastically shorten the range of the arrow. The default is -0.5.
39
40 ### Initial velocity computation
41
42 The mod provides three modes to compute the initial speed of an arrow: simple, strength or strengthmass.
43
44 In simple mode, the initial velocity of the arrow is always the same. The `throwing.velocity_factor` contains the value of this velocity.
45
46 In strength mode (the default), the initial velocity of the arrow only depends on the bow that is used---the more expensive the bow, the faster the arrow. The arrow strength is multiplied by the velocity factor to compute the speed of the arrow, an arrow strength of 1 is about the strength of the steel bow in `throwing_arrows`.
47
48 Finally, momentum mode is the most realistic. It computes the velocity of the arrow based on the bow strength, as in the strength mode, and on the mass of the arrow: the heavier the arrow, the slower it will be shot. It is called the momentum mode because, in this mode, the strength of a bow indicates the initial momentum of the arrow rather than its initial speed.
49
50 ## API
51
52 There are two available functions in the mod API:
53 ```lua
54 function throwing.register_bow(name, definition)
55 --[[
56 Name: Bow name. If it doesn't contain ":", the "throwing:" prefix will be added.
57 Definition: definition table, containing:
58 * description (highly recommended): description of the bow.
59 * texture (essential): texture of the bow, shown in inventory.
60 * groups (optional): groups of the item.
61 * uses: number of uses of the bow (the default is 50).
62 * allow_shot (optional): function(player, itemstack, index, last_run):
63 - player: the player using the bow
64 - itemstack: the itemstack of the bow
65 - index: index of the arrow in the inventory
66 - last_run: whether this is the last time this function is called before actually calling `spawn_arrow_entity`.
67 Currently, `allow_shot` is actually run twice (once before the delay, and once after).
68 - should return true if the shot can be made, and false otherwise
69 - the default function checks that the arrow to be thrown is a registered arrow
70 - it can return a second return value, which is the new itemstack to replace the arrow after the shot
71 * throw_itself (optional): whether the bow should throw itself instead of the arrow next to it in the inventory.
72 The default is false.
73 * cooldown: bow cooldown. Default is setting throwing.bow_cooldown
74 * function spawn_arrow_entity(position, arrow, player): defaults to throwing.spawn_arrow_entity
75 * sound: sound to be played when the bow is used
76 * delay: delay before throwing the arrow
77 * no_toolranks: If true, toolranks support is disabled for this item. Defaults to false.
78 ]]
79
80 -- Example:
81 throwing.register_bow("bow_wood", {
82 itemcraft = "default:wood",
83 description = "Wooden Bow",
84 texture = "throwing_bow_wood.png"
85 })
86
87 itemcraft, craft_quantity, description, tiles, on_hit_sound, on_hit[, on_throw[, groups]]
88 function throwing.register_arrow(name, definition table)
89 --[[
90 Name: Arrow name. If it doesn't contain ":", the "throwing:" prefix will be added.
91 Definition: definition table, containing:
92 * tiles (essential): tiles of the arrow.
93 * target (optional, defaulting to throwing.target_both): what the arrow is able to hit (throwing.target_node, throwing.target_object, throwing.target_both).
94 * allow_protected (optional, defaulting to false): whether the arrow can be throw in a protected area
95 * on_hit_sound (optional): sound played when the arrow hits a node or an object.
96 * on_hit(self, pos, last_pos, node, object, hitter, data) (optional but very useful): callback function:
97 - pos: the position of the hit node or object.
98 - last_pos: the last air node where the arrow was
99 - node and object: hit node or object. Either node or object is nil, depending
100 whether the arrow hit a node or an object.
101 - hitter: an ObjectRef to the thrower player.
102 - data: a data table associated to the entity where you can store what you want
103 - self: the arrow entity table (it allows you to hack a lot!)
104 - If it fails, it should return:
105 false[, reason]
106 * on_throw(self, pos, thrower, itemstack, index, data) (optional): callback function: on_throw:
107 - pos: the position from where the arrow is throw (which a bit higher than the hitter position)
108 - thrower: an ObjectRef to the thrower player
109 - next_index: the index next to the arrow in the "main" inventory
110 - data: a data table associated to the entity where you can store what you want
111 - self: the arrow entity table
112 - If the arrow shouldn't be thrown, it should return false.
113 * on_throw_sound (optional, there is a default sound, specify "" for no sound): sound to be played when the arrow is throw
114 * on_hit_fails(self, pos, thrower, data) (optional): callback function called if the hit failed (e.g. because on_hit returned false or because the area was protected)
115 ]]
116
117 -- Example:
118 throwing.register_arrow("arrow", {
119 itemcraft = "default:steel_ingot",
120 craft_quantity = 16,
121 description = "Arrow",
122 tiles = {"throwing_arrow.png", "throwing_arrow.png", "throwing_arrow_back.png", "throwing_arrow_front.png", "throwing_arrow_2.png", "throwing_arrow.png"},
123 target = throwing.target_object,
124 on_hit_sound = "throwing_arrow",
125 on_hit = function(pos, _, _, object, hitter)
126 object:punch(hitter, 1, {
127 full_punch_interval = 1,
128 damage_groups = {fleshy = 3}
129 })
130 end
131 })
132 ```
133
134 If the item to throw is an arrow registered using `throwing.register_arrow`, the entity used will be the entity automatically registered by this function.
135 Otherwise, if its definition contains a `throwing_entity` field, this field will be used as the entity name if it is a string, otherwise it will be called as a `function(pos, player)` that has to spawn the object and return the corresponding ObjectRef.
136 If the item is neither an arrow nor has a `throwing_entity` field, the corresponding `__builtin:item` will be used.
0 throwing = {}
1
2 throwing.arrows = {}
3
4 throwing.target_object = 1
5 throwing.target_node = 2
6 throwing.target_both = 3
7
8 throwing.modname = minetest.get_current_modname()
9 local use_toolranks = minetest.get_modpath("toolranks") and minetest.settings:get_bool("throwing.toolranks", true)
10
11 --------- Arrows functions ---------
12 function throwing.is_arrow(itemstack)
13 return throwing.arrows[ItemStack(itemstack):get_name()]
14 end
15
16 function throwing.spawn_arrow_entity(pos, arrow, player)
17 if throwing.is_arrow(arrow) then
18 return minetest.add_entity(pos, arrow.."_entity")
19 elseif minetest.registered_items[arrow].throwing_entity then
20 if type(minetest.registered_items[arrow].throwing_entity) == "string" then
21 return minetest.add_entity(pos, minetest.registered_items[arrow].throwing_entity)
22 else -- Type is a function
23 return minetest.registered_items[arrow].throwing_entity(pos, player)
24 end
25 else
26 obj = minetest.add_entity(pos, "__builtin:item", arrow)
27 end
28 end
29
30 local function apply_realistic_acceleration(obj, mass)
31 if not minetest.settings:get_bool("throwing.realistic_trajectory", false) then
32 return
33 end
34
35 local vertical_acceleration = tonumber(minetest.settings:get("throwing.vertical_acceleration")) or -10
36 local friction_coef = tonumber(minetest.settings:get("throwing.frictional_coefficient")) or -3
37
38 local velocity = obj:get_velocity()
39 obj:set_acceleration({
40 x = friction_coef * velocity.x / mass,
41 y = friction_coef * velocity.y / mass + vertical_acceleration,
42 z = friction_coef * velocity.z / mass
43 })
44 end
45
46 local function shoot_arrow(def, toolranks_data, player, bow_index, throw_itself, new_stack)
47 local inventory = player:get_inventory()
48 local arrow_index
49 if throw_itself then
50 arrow_index = bow_index
51 else
52 if bow_index >= player:get_inventory():get_size("main") then
53 return false
54 end
55 arrow_index = bow_index + 1
56 end
57 local arrow_stack = inventory:get_stack("main", arrow_index)
58 local arrow = arrow_stack:get_name()
59
60 local playerpos = player:get_pos()
61 local pos = {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}
62 local obj = (def.spawn_arrow_entity or throwing.spawn_arrow_entity)(pos, arrow, player)
63
64 local luaentity = obj:get_luaentity()
65
66 -- Set custom data in the entity
67 luaentity.player = player:get_player_name()
68 if not luaentity.item then
69 luaentity.item = arrow
70 end
71 luaentity.data = {}
72 luaentity.timer = 0
73 luaentity.toolranks = toolranks_data -- May be nil if toolranks is disabled
74
75 if luaentity.on_throw then
76 if luaentity:on_throw(pos, player, arrow_stack, arrow_index, luaentity.data) == false then
77 obj:remove()
78 return false
79 end
80 end
81
82 local dir = player:get_look_dir()
83 local vertical_acceleration = tonumber(minetest.settings:get("throwing.vertical_acceleration")) or -10
84 local velocity_factor = tonumber(minetest.settings:get("throwing.velocity_factor")) or 19
85 local velocity_mode = minetest.settings:get("throwing.velocity_mode") or "strength"
86
87 local velocity
88 if velocity_mode == "simple" then
89 velocity = velocity_factor
90 elseif velocity_mode == "momentum" then
91 velocity = def.strength * velocity_factor / luaentity.mass
92 else
93 velocity = def.strength * velocity_factor
94 end
95
96 obj:set_velocity({
97 x = dir.x * velocity,
98 y = dir.y * velocity,
99 z = dir.z * velocity
100 })
101 obj:set_acceleration({x = 0, y = vertical_acceleration, z = 0})
102 obj:set_yaw(player:get_look_horizontal()-math.pi/2)
103
104 apply_realistic_acceleration(obj, luaentity.mass)
105
106 if luaentity.on_throw_sound ~= "" then
107 minetest.sound_play(luaentity.on_throw_sound or "throwing_sound", {pos=playerpos, gain = 0.5})
108 end
109
110 if not minetest.settings:get_bool("creative_mode") then
111 if new_stack then
112 inventory:set_stack("main", arrrow_index, new_stack)
113 else
114 local stack = inventory:get_stack("main", arrow_index)
115 stack:take_item()
116 inventory:set_stack("main", arrow_index, stack)
117 end
118 end
119
120 return true
121 end
122
123 function throwing.arrow_step(self, dtime)
124 if not self.timer or not self.player then
125 self.object:remove()
126 return
127 end
128
129 self.timer = self.timer + dtime
130 local pos = self.object:get_pos()
131 local node = minetest.get_node(pos)
132
133 local logging = function(message, level)
134 minetest.log(level or "action", "[throwing] Arrow "..(self.item or self.name).." throwed by player "..self.player.." "..tostring(self.timer).."s ago "..message)
135 end
136
137 local hit = function(pos, node, obj)
138 if obj then
139 if obj:is_player() then
140 if obj:get_player_name() == self.player then -- Avoid hitting the hitter
141 return false
142 end
143 end
144 end
145
146 local player = minetest.get_player_by_name(self.player)
147 if not player then -- Possible if the player disconnected
148 return
149 end
150
151 local function hit_failed()
152 if not minetest.settings:get_bool("creative_mode") and self.item then
153 player:get_inventory():add_item("main", self.item)
154 end
155 if self.on_hit_fails then
156 self:on_hit_fails(pos, player, self.data)
157 end
158 end
159
160 if not self.last_pos then
161 logging("hitted a node during its first call to the step function")
162 hit_failed()
163 return
164 end
165
166 if node and minetest.is_protected(pos, self.player) and not self.allow_protected then -- Forbid hitting nodes in protected areas
167 minetest.record_protection_violation(pos, self.player)
168 logging("hitted a node into a protected area")
169 return
170 end
171
172 if self.on_hit then
173 local ret, reason = self:on_hit(pos, self.last_pos, node, obj, player, self.data)
174 if ret == false then
175 if reason then
176 logging(": on_hit function failed for reason: "..reason)
177 else
178 logging(": on_hit function failed")
179 end
180
181 hit_failed()
182 return
183 end
184 end
185
186 if self.on_hit_sound then
187 minetest.sound_play(self.on_hit_sound, {pos = pos, gain = 0.8})
188 end
189 if node then
190 logging("collided with node "..node.name.." at ("..pos.x..","..pos.y..","..pos.z..")")
191 elseif obj then
192 if obj:get_luaentity() then
193 logging("collided with luaentity "..obj:get_luaentity().name.." at ("..pos.x..","..pos.y..","..pos.z..")")
194 elseif obj:is_player() then
195 logging("collided with player "..obj:get_player_name().." at ("..pos.x..","..pos.y..","..pos.z..")")
196 else
197 logging("collided with object at ("..pos.x..","..pos.y..","..pos.z..")")
198 end
199 end
200
201 -- Toolranks support: update bow uses
202 if self.toolranks then
203 local inventory = player:get_inventory()
204 -- Check that the player did not move the bow
205 if inventory:get_stack("main", self.toolranks.index):get_name() == self.toolranks.itemstack:get_name() then
206 local new_itemstack = toolranks.new_afteruse(self.toolranks.itemstack, player, nil, {wear = self.toolranks.wear})
207 inventory:set_stack("main", self.toolranks.index, new_itemstack)
208 end
209 end
210 end
211
212 -- Collision with a node
213 if node.name == "ignore" then
214 self.object:remove()
215 logging("reached ignore. Removing.")
216 return
217 elseif (minetest.registered_items[node.name] or {}).drawtype ~= "airlike" then
218 if self.target ~= throwing.target_object then -- throwing.target_both, nil, throwing.target_node, or any invalid value
219 if hit(pos, node, nil) ~= false then
220 self.object:remove()
221 end
222 else
223 self.object:remove()
224 end
225 return
226 end
227
228 -- Collision with an object
229 local objs = minetest.get_objects_inside_radius(pos, 1)
230 for k, obj in pairs(objs) do
231 if obj:get_luaentity() then
232 if obj:get_luaentity().name ~= self.name and obj:get_luaentity().name ~= "__builtin:item" then
233 if self.target ~= throwing.target_node then -- throwing.target_both, nil, throwing.target_object, or any invalid value
234 if hit(pos, nil, obj) ~= false then
235 self.object:remove()
236 end
237 else
238 self.object:remove()
239 end
240 end
241 else
242 if self.target ~= throwing.target_node then -- throwing.target_both, nil, throwing.target_object, or any invalid value
243 if hit(pos, nil, obj) ~= false then
244 self.object:remove()
245 end
246 else
247 self.object:remove()
248 end
249 end
250 end
251
252 -- Support for shining items using wielded light
253 if minetest.global_exists("wielded_light") and self.object then
254 wielded_light.update_light_by_item(self.item, self.object:get_pos())
255 end
256
257 apply_realistic_acceleration(self.object, self.mass) -- Physics: air friction
258
259 self.last_pos = pos -- Used by the build arrow
260 end
261
262 -- Backwards compatibility
263 function throwing.make_arrow_def(def)
264 def.on_step = throwing.arrow_step
265 return def
266 end
267
268 --[[
269 on_hit(pos, last_pos, node, object, hitter)
270 Either node or object is nil, depending whether the arrow collided with an object (luaentity or player) or with a node.
271 No log message is needed in this function (a generic log message is automatically emitted), except on error or warning.
272 Should return false or false, reason on failure.
273
274 on_throw(pos, hitter)
275 Unlike on_hit, it is optional.
276 ]]
277 function throwing.register_arrow(name, def)
278 throwing.arrows[name] = true
279
280 local registration_name = name
281 if name:sub(1,9) == "throwing:" then
282 registration_name = ":"..name
283 end
284
285 if not def.groups then
286 def.groups = {}
287 end
288 if not def.groups.dig_immediate then
289 def.groups.dig_immediate = 3
290 end
291
292 def.inventory_image = def.tiles[1]
293 def.on_place = function(itemstack, placer, pointed_thing)
294 if minetest.settings:get_bool("throwing.allow_arrow_placing") and pointed_thing.above then
295 local playername = placer:get_player_name()
296 if not minetest.is_protected(pointed_thing.above, playername) then
297 minetest.log("action", "Player "..playername.." placed arrow "..name.." at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
298 minetest.set_node(pointed_thing.above, {name = name})
299 itemstack:take_item()
300 return itemstack
301 else
302 minetest.log("warning", "Player "..playername.." tried to place arrow "..name.." into a protected area at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
303 minetest.record_protection_violation(pointed_thing.above, playername)
304 return itemstack
305 end
306 else
307 return itemstack
308 end
309 end
310 def.drawtype = "nodebox"
311 def.paramtype = "light"
312 def.node_box = {
313 type = "fixed",
314 fixed = {
315 -- Shaft
316 {-6.5/17, -1.5/17, -1.5/17, 6.5/17, 1.5/17, 1.5/17},
317 -- Spitze
318 {-4.5/17, 2.5/17, 2.5/17, -3.5/17, -2.5/17, -2.5/17},
319 {-8.5/17, 0.5/17, 0.5/17, -6.5/17, -0.5/17, -0.5/17},
320 -- Federn
321 {6.5/17, 1.5/17, 1.5/17, 7.5/17, 2.5/17, 2.5/17},
322 {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17},
323 {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17},
324 {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17},
325
326 {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17},
327 {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17},
328 {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17},
329 {7.5/17, -2.5/17, -2.5/17, 8.5/17, -3.5/17, -3.5/17},
330 }
331 }
332 minetest.register_node(registration_name, def)
333
334 minetest.register_entity(registration_name.."_entity", {
335 physical = false,
336 visual = "wielditem",
337 visual_size = {x = 0.125, y = 0.125},
338 textures = {name},
339 collisionbox = {0, 0, 0, 0, 0, 0},
340 on_hit = def.on_hit,
341 on_hit_sound = def.on_hit_sound,
342 on_throw_sound = def.on_throw_sound,
343 on_throw = def.on_throw,
344 allow_protected = def.allow_protected,
345 target = def.target,
346 on_hit_fails = def.on_hit_fails,
347 on_step = throwing.arrow_step,
348 item = name,
349 mass = def.mass or 1,
350 })
351 end
352
353
354 ---------- Bows -----------
355 function throwing.register_bow(name, def)
356 local enable_toolranks = use_toolranks and not def.no_toolranks
357
358 def.name = name
359
360 if not def.allow_shot then
361 def.allow_shot = function(player, itemstack, index)
362 if index >= player:get_inventory():get_size("main") and not def.throw_itself then
363 return false
364 end
365 return throwing.is_arrow(itemstack) or def.throw_itself
366 end
367 end
368
369 if not def.inventory_image then
370 def.inventory_image = def.texture
371 end
372
373 if not def.strength then
374 def.strength = 20
375 end
376
377 def.on_use = function(itemstack, user, pointed_thing)
378 -- Cooldown
379 local meta = itemstack:get_meta()
380 local cooldown = def.cooldown or tonumber(minetest.settings:get("throwing.bow_cooldown")) or 0.2
381
382 if cooldown > 0 and meta:get_int("cooldown") > os.time()
383 or meta:get_int("delay") > os.time() then
384 return
385 end
386
387 local bow_index = user:get_wield_index()
388 local arrow_index = (def.throw_itself and bow_index) or bow_index+1
389 local res, new_stack = def.allow_shot(user, user:get_inventory():get_stack("main", arrow_index), arrow_index, false)
390 if not res then
391 return (def.throw_itself and new_stack) or itemstack
392 end
393
394 -- Sound
395 if def.sound then
396 minetest.sound_play(def.sound, {to_player=user:get_player_name()})
397 end
398
399 meta:set_int("delay", os.time() + (def.delay or 0))
400 minetest.after(def.delay or 0, function()
401 -- Re-check that the arrow can be thrown. Overwrite the new_stack
402 local old_new_stack = new_stack
403 res, new_stack = def.allow_shot(user, user:get_inventory():get_stack("main", arrow_index), arrow_index, true)
404 if not new_stack then
405 new_stack = old_new_stack
406 end
407 if not res then
408 return
409 end
410
411 -- Shoot arrow
412 local uses = 65535 / (def.uses or 50)
413 local toolranks_data
414 if enable_toolranks then
415 toolranks_data = {
416 itemstack = itemstack,
417 index = bow_index,
418 wear = uses
419 }
420 end
421 if shoot_arrow(def, toolranks_data, user, bow_index, def.throw_itself, new_stack) then
422 if not minetest.settings:get_bool("creative_mode") then
423 itemstack:add_wear(uses)
424 end
425 end
426
427
428 if def.throw_itself then
429 -- This is a bug. If we return ItemStack(nil), the player punches the entity,
430 -- and if the entity if a __builtin:item, it gets back to his inventory.
431 minetest.after(0.1, function()
432 user:get_inventory():remove_item("main", itemstack)
433 end)
434 elseif cooldown > 0 then
435 meta:set_int("cooldown", os.time() + cooldown)
436 end
437 user:get_inventory():set_stack("main", bow_index, itemstack)
438 end)
439 return itemstack
440 end
441
442 if enable_toolranks then
443 def.original_description = def.original_description or def.description
444 def.description = toolranks.create_description(def.description, 0, 1)
445 end
446
447 minetest.register_tool(name, def)
448 end
0 name = throwing
1 optional_depends = wielded_light, toolranks
2 description = Throwing library: provides an API for registering throwing and throwable things
+0
-0
modpack.txt less more
(Empty file)
+0
-374
throwing/LICENSE.txt less more
0 Mozilla Public License Version 2.0
1 ==================================
2
3 1. Definitions
4 --------------
5
6 1.1. "Contributor"
7 means each individual or legal entity that creates, contributes to
8 the creation of, or owns Covered Software.
9
10 1.2. "Contributor Version"
11 means the combination of the Contributions of others (if any) used
12 by a Contributor and that particular Contributor's Contribution.
13
14 1.3. "Contribution"
15 means Covered Software of a particular Contributor.
16
17 1.4. "Covered Software"
18 means Source Code Form to which the initial Contributor has attached
19 the notice in Exhibit A, the Executable Form of such Source Code
20 Form, and Modifications of such Source Code Form, in each case
21 including portions thereof.
22
23 1.5. "Incompatible With Secondary Licenses"
24 means
25
26 (a) that the initial Contributor has attached the notice described
27 in Exhibit B to the Covered Software; or
28
29 (b) that the Covered Software was made available under the terms of
30 version 1.1 or earlier of the License, but not also under the
31 terms of a Secondary License.
32
33 1.6. "Executable Form"
34 means any form of the work other than Source Code Form.
35
36 1.7. "Larger Work"
37 means a work that combines Covered Software with other material, in
38 a separate file or files, that is not Covered Software.
39
40 1.8. "License"
41 means this document.
42
43 1.9. "Licensable"
44 means having the right to grant, to the maximum extent possible,
45 whether at the time of the initial grant or subsequently, any and
46 all of the rights conveyed by this License.
47
48 1.10. "Modifications"
49 means any of the following:
50
51 (a) any file in Source Code Form that results from an addition to,
52 deletion from, or modification of the contents of Covered
53 Software; or
54
55 (b) any new file in Source Code Form that contains any Covered
56 Software.
57
58 1.11. "Patent Claims" of a Contributor
59 means any patent claim(s), including without limitation, method,
60 process, and apparatus claims, in any patent Licensable by such
61 Contributor that would be infringed, but for the grant of the
62 License, by the making, using, selling, offering for sale, having
63 made, import, or transfer of either its Contributions or its
64 Contributor Version.
65
66 1.12. "Secondary License"
67 means either the GNU General Public License, Version 2.0, the GNU
68 Lesser General Public License, Version 2.1, the GNU Affero General
69 Public License, Version 3.0, or any later versions of those
70 licenses.
71
72 1.13. "Source Code Form"
73 means the form of the work preferred for making modifications.
74
75 1.14. "You" (or "Your")
76 means an individual or a legal entity exercising rights under this
77 License. For legal entities, "You" includes any entity that
78 controls, is controlled by, or is under common control with You. For
79 purposes of this definition, "control" means (a) the power, direct
80 or indirect, to cause the direction or management of such entity,
81 whether by contract or otherwise, or (b) ownership of more than
82 fifty percent (50%) of the outstanding shares or beneficial
83 ownership of such entity.
84
85 2. License Grants and Conditions
86 --------------------------------
87
88 2.1. Grants
89
90 Each Contributor hereby grants You a world-wide, royalty-free,
91 non-exclusive license:
92
93 (a) under intellectual property rights (other than patent or trademark)
94 Licensable by such Contributor to use, reproduce, make available,
95 modify, display, perform, distribute, and otherwise exploit its
96 Contributions, either on an unmodified basis, with Modifications, or
97 as part of a Larger Work; and
98
99 (b) under Patent Claims of such Contributor to make, use, sell, offer
100 for sale, have made, import, and otherwise transfer either its
101 Contributions or its Contributor Version.
102
103 2.2. Effective Date
104
105 The licenses granted in Section 2.1 with respect to any Contribution
106 become effective for each Contribution on the date the Contributor first
107 distributes such Contribution.
108
109 2.3. Limitations on Grant Scope
110
111 The licenses granted in this Section 2 are the only rights granted under
112 this License. No additional rights or licenses will be implied from the
113 distribution or licensing of Covered Software under this License.
114 Notwithstanding Section 2.1(b) above, no patent license is granted by a
115 Contributor:
116
117 (a) for any code that a Contributor has removed from Covered Software;
118 or
119
120 (b) for infringements caused by: (i) Your and any other third party's
121 modifications of Covered Software, or (ii) the combination of its
122 Contributions with other software (except as part of its Contributor
123 Version); or
124
125 (c) under Patent Claims infringed by Covered Software in the absence of
126 its Contributions.
127
128 This License does not grant any rights in the trademarks, service marks,
129 or logos of any Contributor (except as may be necessary to comply with
130 the notice requirements in Section 3.4).
131
132 2.4. Subsequent Licenses
133
134 No Contributor makes additional grants as a result of Your choice to
135 distribute the Covered Software under a subsequent version of this
136 License (see Section 10.2) or under the terms of a Secondary License (if
137 permitted under the terms of Section 3.3).
138
139 2.5. Representation
140
141 Each Contributor represents that the Contributor believes its
142 Contributions are its original creation(s) or it has sufficient rights
143 to grant the rights to its Contributions conveyed by this License.
144
145 2.6. Fair Use
146
147 This License is not intended to limit any rights You have under
148 applicable copyright doctrines of fair use, fair dealing, or other
149 equivalents.
150
151 2.7. Conditions
152
153 Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
154 in Section 2.1.
155
156 3. Responsibilities
157 -------------------
158
159 3.1. Distribution of Source Form
160
161 All distribution of Covered Software in Source Code Form, including any
162 Modifications that You create or to which You contribute, must be under
163 the terms of this License. You must inform recipients that the Source
164 Code Form of the Covered Software is governed by the terms of this
165 License, and how they can obtain a copy of this License. You may not
166 attempt to alter or restrict the recipients' rights in the Source Code
167 Form.
168
169 3.2. Distribution of Executable Form
170
171 If You distribute Covered Software in Executable Form then:
172
173 (a) such Covered Software must also be made available in Source Code
174 Form, as described in Section 3.1, and You must inform recipients of
175 the Executable Form how they can obtain a copy of such Source Code
176 Form by reasonable means in a timely manner, at a charge no more
177 than the cost of distribution to the recipient; and
178
179 (b) You may distribute such Executable Form under the terms of this
180 License, or sublicense it under different terms, provided that the
181 license for the Executable Form does not attempt to limit or alter
182 the recipients' rights in the Source Code Form under this License.
183
184 3.3. Distribution of a Larger Work
185
186 You may create and distribute a Larger Work under terms of Your choice,
187 provided that You also comply with the requirements of this License for
188 the Covered Software. If the Larger Work is a combination of Covered
189 Software with a work governed by one or more Secondary Licenses, and the
190 Covered Software is not Incompatible With Secondary Licenses, this
191 License permits You to additionally distribute such Covered Software
192 under the terms of such Secondary License(s), so that the recipient of
193 the Larger Work may, at their option, further distribute the Covered
194 Software under the terms of either this License or such Secondary
195 License(s).
196
197 3.4. Notices
198
199 You may not remove or alter the substance of any license notices
200 (including copyright notices, patent notices, disclaimers of warranty,
201 or limitations of liability) contained within the Source Code Form of
202 the Covered Software, except that You may alter any license notices to
203 the extent required to remedy known factual inaccuracies.
204
205 3.5. Application of Additional Terms
206
207 You may choose to offer, and to charge a fee for, warranty, support,
208 indemnity or liability obligations to one or more recipients of Covered
209 Software. However, You may do so only on Your own behalf, and not on
210 behalf of any Contributor. You must make it absolutely clear that any
211 such warranty, support, indemnity, or liability obligation is offered by
212 You alone, and You hereby agree to indemnify every Contributor for any
213 liability incurred by such Contributor as a result of warranty, support,
214 indemnity or liability terms You offer. You may include additional
215 disclaimers of warranty and limitations of liability specific to any
216 jurisdiction.
217
218 4. Inability to Comply Due to Statute or Regulation
219 ---------------------------------------------------
220
221 If it is impossible for You to comply with any of the terms of this
222 License with respect to some or all of the Covered Software due to
223 statute, judicial order, or regulation then You must: (a) comply with
224 the terms of this License to the maximum extent possible; and (b)
225 describe the limitations and the code they affect. Such description must
226 be placed in a text file included with all distributions of the Covered
227 Software under this License. Except to the extent prohibited by statute
228 or regulation, such description must be sufficiently detailed for a
229 recipient of ordinary skill to be able to understand it.
230
231 5. Termination
232 --------------
233
234 5.1. The rights granted under this License will terminate automatically
235 if You fail to comply with any of its terms. However, if You become
236 compliant, then the rights granted under this License from a particular
237 Contributor are reinstated (a) provisionally, unless and until such
238 Contributor explicitly and finally terminates Your grants, and (b) on an
239 ongoing basis, if such Contributor fails to notify You of the
240 non-compliance by some reasonable means prior to 60 days after You have
241 come back into compliance. Moreover, Your grants from a particular
242 Contributor are reinstated on an ongoing basis if such Contributor
243 notifies You of the non-compliance by some reasonable means, this is the
244 first time You have received notice of non-compliance with this License
245 from such Contributor, and You become compliant prior to 30 days after
246 Your receipt of the notice.
247
248 5.2. If You initiate litigation against any entity by asserting a patent
249 infringement claim (excluding declaratory judgment actions,
250 counter-claims, and cross-claims) alleging that a Contributor Version
251 directly or indirectly infringes any patent, then the rights granted to
252 You by any and all Contributors for the Covered Software under Section
253 2.1 of this License shall terminate.
254
255 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
256 end user license agreements (excluding distributors and resellers) which
257 have been validly granted by You or Your distributors under this License
258 prior to termination shall survive termination.
259
260 ************************************************************************
261 * *
262 * 6. Disclaimer of Warranty *
263 * ------------------------- *
264 * *
265 * Covered Software is provided under this License on an "as is" *
266 * basis, without warranty of any kind, either expressed, implied, or *
267 * statutory, including, without limitation, warranties that the *
268 * Covered Software is free of defects, merchantable, fit for a *
269 * particular purpose or non-infringing. The entire risk as to the *
270 * quality and performance of the Covered Software is with You. *
271 * Should any Covered Software prove defective in any respect, You *
272 * (not any Contributor) assume the cost of any necessary servicing, *
273 * repair, or correction. This disclaimer of warranty constitutes an *
274 * essential part of this License. No use of any Covered Software is *
275 * authorized under this License except under this disclaimer. *
276 * *
277 ************************************************************************
278
279 ************************************************************************
280 * *
281 * 7. Limitation of Liability *
282 * -------------------------- *
283 * *
284 * Under no circumstances and under no legal theory, whether tort *
285 * (including negligence), contract, or otherwise, shall any *
286 * Contributor, or anyone who distributes Covered Software as *
287 * permitted above, be liable to You for any direct, indirect, *
288 * special, incidental, or consequential damages of any character *
289 * including, without limitation, damages for lost profits, loss of *
290 * goodwill, work stoppage, computer failure or malfunction, or any *
291 * and all other commercial damages or losses, even if such party *
292 * shall have been informed of the possibility of such damages. This *
293 * limitation of liability shall not apply to liability for death or *
294 * personal injury resulting from such party's negligence to the *
295 * extent applicable law prohibits such limitation. Some *
296 * jurisdictions do not allow the exclusion or limitation of *
297 * incidental or consequential damages, so this exclusion and *
298 * limitation may not apply to You. *
299 * *
300 ************************************************************************
301
302 8. Litigation
303 -------------
304
305 Any litigation relating to this License may be brought only in the
306 courts of a jurisdiction where the defendant maintains its principal
307 place of business and such litigation shall be governed by laws of that
308 jurisdiction, without reference to its conflict-of-law provisions.
309 Nothing in this Section shall prevent a party's ability to bring
310 cross-claims or counter-claims.
311
312 9. Miscellaneous
313 ----------------
314
315 This License represents the complete agreement concerning the subject
316 matter hereof. If any provision of this License is held to be
317 unenforceable, such provision shall be reformed only to the extent
318 necessary to make it enforceable. Any law or regulation which provides
319 that the language of a contract shall be construed against the drafter
320 shall not be used to construe this License against a Contributor.
321
322 10. Versions of the License
323 ---------------------------
324
325 10.1. New Versions
326
327 Mozilla Foundation is the license steward. Except as provided in Section
328 10.3, no one other than the license steward has the right to modify or
329 publish new versions of this License. Each version will be given a
330 distinguishing version number.
331
332 10.2. Effect of New Versions
333
334 You may distribute the Covered Software under the terms of the version
335 of the License under which You originally received the Covered Software,
336 or under the terms of any subsequent version published by the license
337 steward.
338
339 10.3. Modified Versions
340
341 If you create software not governed by this License, and you want to
342 create a new license for such software, you may create and use a
343 modified version of this License if you rename the license and remove
344 any references to the name of the license steward (except to note that
345 such modified license differs from this License).
346
347 10.4. Distributing Source Code Form that is Incompatible With Secondary
348 Licenses
349
350 If You choose to distribute Source Code Form that is Incompatible With
351 Secondary Licenses under the terms of this version of the License, the
352 notice described in Exhibit B of this License must be attached.
353
354 Exhibit A - Source Code Form License Notice
355 -------------------------------------------
356
357 This Source Code Form is subject to the terms of the Mozilla Public
358 License, v. 2.0. If a copy of the MPL was not distributed with this
359 file, You can obtain one at http://mozilla.org/MPL/2.0/.
360
361 If it is not possible or desirable to put the notice in a particular
362 file, then You may include the notice in a location (such as a LICENSE
363 file in a relevant directory) where a recipient would be likely to look
364 for such a notice.
365
366 You may add additional accurate notices of copyright ownership.
367
368 Exhibit B - "Incompatible With Secondary Licenses" Notice
369 ---------------------------------------------------------
370
371 This Source Code Form is "Incompatible With Secondary Licenses", as
372 defined by the Mozilla Public License, v. 2.0.
373
+0
-115
throwing/README.md less more
0 # Throwing
1
2 ## Developed by the Eurythmia team
3
4 This mod is an API for registering throwing and throwable things.
5
6 Mods based on this API:
7 * [throwing_arrows](https://github.com/MT-Eurythmia/throwing/tree/master/throwing_arrows) is a compatible replacement for the throwing mod by PilzAdam.
8 * [sling](https://github.com/tacotexmex/sling) is a mod written by @tacotexmex that enables item stack and single item throwing of any item.
9
10 ## Configuration
11
12 The settings are the following:
13 ```
14 throwing.velocity_factor = 19
15 throwing.horizontal_acceleration_factor = -3
16 throwing.vertical_acceleration = -10
17
18 throwing.allow_arrow_placing = false
19
20 throwing.bow_cooldown = 0.2
21 ```
22
23 ## API
24
25 There are two available functions in the mod API:
26 ```lua
27 function throwing.register_bow(name, definition)
28 --[[
29 Name: Bow name. If it doesn't contain ":", the "throwing:" prefix will be added.
30 Definition: definition table, containing:
31 * itemcraft (optional, you may want to register your own craft or to make the bow uncraftable): item used to craft the bow.
32 * description (highly recommended): description of the bow.
33 * texture (essential): texture of the bow, shown in inventory.
34 * groups (optional): groups of the item.
35 * uses: number of uses of the bow (default is 50).
36 * allow_shot (optional): function(player, itemstack, index, last_run):
37 - player: the player using the bow
38 - itemstack: the itemstack of the bow
39 - index: index of the arrow in the inventory
40 - last_run: whether this is the last time this function is called before actually calling `spawn_arrow_entity`.
41 Currently, `allow_shot` is actually run twice (once before the delay, and once after).
42 - should return true if the shot can be made, and false otherwise
43 - the default function checks that the arrow to be thrown is a registered arrow
44 - it can return a second return value, which is the new itemstack
45 * throw_itself (optional): whether the bow should throw itself instead of the arrow next to it in the inventory.
46 If present, allow_shot is ignored.
47 Default is false.
48 *Warning*: this field is not known to be currently used by a mod. If you encounter bugs using it, please open
49 an issue!
50 * cooldown: bow cooldown. Default is setting throwing.bow_cooldown
51 * function spawn_arrow_entity(position, arrow, player): defaults to throwing.spawn_arrow_entity
52 * sound: sound to be played when the bow is used
53 * delay: delay before throwing the arrow
54 ]]
55
56 -- Example:
57 throwing.register_bow("bow_wood", {
58 itemcraft = "default:wood",
59 description = "Wooden Bow",
60 texture = "throwing_bow_wood.png"
61 })
62
63 itemcraft, craft_quantity, description, tiles, on_hit_sound, on_hit[, on_throw[, groups]]
64 function throwing.register_arrow(name, definition table)
65 --[[
66 Name: Arrow name. If it doesn't contain ":", the "throwing:" prefix will be added.
67 Definition: definition table, containing:
68 * itemcraft (optional, you may want to register your own craft or to make the arrow uncraftable): item used to craft the arrow.
69 * craft_quantity (optional, defaulting to 1 if itemcraft is non-nil, pointless otherwise): quantity of arrows in the craft output.
70 * tiles (essential): tiles of the arrow.
71 * target (optional, defaulting to throwing.target_both): what the arrow is able to hit (throwing.target_node, throwing.target_object, throwing.target_both).
72 * allow_protected (optional, defaulting to false): whether the arrow can be throw in a protected area
73 * on_hit_sound (optional): sound played when the arrow hits a node or an object.
74 * on_hit(self, pos, last_pos, node, object, hitter, data) (optional but very useful): callback function:
75 - pos: the position of the hit node or object.
76 - last_pos: the last air node where the arrow was
77 - node and object: hit node or object. Either node or object is nil, depending
78 whether the arrow hit a node or an object.
79 - hitter: an ObjectRef to the thrower player.
80 - data: a data table associated to the entity where you can store what you want
81 - self: the arrow entity table (it allows you to hack a lot!)
82 - If it fails, it should return:
83 false[, reason]
84 * on_throw(self, pos, thrower, itemstack, index, data) (optional): callback function: on_throw:
85 - pos: the position from where the arrow is throw (which a bit higher than the hitter position)
86 - thrower: an ObjectRef to the thrower player
87 - next_index: the index next to the arrow in the "main" inventory
88 - data: a data table associated to the entity where you can store what you want
89 - self: the arrow entity table
90 - If the arrow shouldn't be thrown, it should return false.
91 * on_throw_sound (optional, there is a default sound, specify "" for no sound): sound to be played when the arrow is throw
92 * on_hit_fails(self, pos, thrower, data) (optional): callback function called if the hit failed (e.g. because on_hit returned false or because the area was protected)
93 ]]
94
95 -- Example:
96 throwing.register_arrow("arrow", {
97 itemcraft = "default:steel_ingot",
98 craft_quantity = 16,
99 description = "Arrow",
100 tiles = {"throwing_arrow.png", "throwing_arrow.png", "throwing_arrow_back.png", "throwing_arrow_front.png", "throwing_arrow_2.png", "throwing_arrow.png"},
101 target = throwing.target_object,
102 on_hit_sound = "throwing_arrow",
103 on_hit = function(pos, _, _, object, hitter)
104 object:punch(hitter, 1, {
105 full_punch_interval = 1,
106 damage_groups = {fleshy = 3}
107 })
108 end
109 })
110 ```
111
112 If the item to throw is an arrow registered using `throwing.register_arrow`, the entity used will be the entity automatically registered by this function.
113 Otherwise, if its definition contains a `throwing_entity` field, this field will be used as the entity name if it is a string, otherwise it will be called as a `function(pos, player)` that has to spawn the object and return the corresponding ObjectRef.
114 If the item is neither an arrow nor has a `throwing_entity` field, the corresponding `__builtin:item` will be used.
+0
-3
throwing/depends.txt less more
0 mesecons?
1 mesecons_button?
2 wielded_light?
+0
-1
throwing/description.txt less more
0 Throwing, formally throwing_redo - This mod provides an API for registering throwing and throwable things
+0
-398
throwing/init.lua less more
0 throwing = {}
1
2 throwing.arrows = {}
3
4 throwing.target_object = 1
5 throwing.target_node = 2
6 throwing.target_both = 3
7
8 throwing.modname = minetest.get_current_modname()
9
10 --------- Arrows functions ---------
11 function throwing.is_arrow(itemstack)
12 return throwing.arrows[ItemStack(itemstack):get_name()]
13 end
14
15 function throwing.spawn_arrow_entity(pos, arrow, player)
16 if throwing.is_arrow(arrow) then
17 return minetest.add_entity(pos, arrow.."_entity")
18 elseif minetest.registered_items[arrow].throwing_entity then
19 if type(minetest.registered_items[arrow].throwing_entity) == "string" then
20 return minetest.add_entity(pos, minetest.registered_items[arrow].throwing_entity)
21 else -- Type is a function
22 return minetest.registered_items[arrow].throwing_entity(pos, player)
23 end
24 else
25 obj = minetest.add_entity(pos, "__builtin:item", arrow)
26 end
27 end
28
29 local function shoot_arrow(itemstack, player, index, throw_itself, new_stack)
30 local inventory = player:get_inventory()
31 if not throw_itself then
32 if index >= player:get_inventory():get_size("main") then
33 return false
34 end
35 index = index + 1
36 end
37 local arrow_stack = inventory:get_stack("main", index)
38 local arrow = arrow_stack:get_name()
39
40 local playerpos = player:getpos()
41 local pos = {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}
42 local obj = (minetest.registered_items[itemstack:get_name()].spawn_arrow_entity or throwing.spawn_arrow_entity)(pos, arrow, player)
43
44 local luaentity = obj:get_luaentity()
45 luaentity.player = player:get_player_name()
46 if not luaentity.item then
47 luaentity.item = arrow
48 end
49
50 if luaentity.on_throw then
51 if luaentity:on_throw(pos, player, arrow_stack, index, luaentity.data) == false then
52 obj:remove()
53 return false
54 end
55 end
56
57 local dir = player:get_look_dir()
58 local velocity_factor = tonumber(minetest.settings:get("throwing.velocity_factor")) or 19
59 local horizontal_acceleration_factor = tonumber(minetest.settings:get("throwing.horizontal_acceleration_factor")) or -3
60 local vertical_acceleration = tonumber(minetest.settings:get("throwing.vertical_acceleration")) or -10
61
62 obj:setvelocity({x=dir.x*velocity_factor, y=dir.y*velocity_factor, z=dir.z*velocity_factor})
63 obj:setacceleration({x=dir.x*horizontal_acceleration_factor, y=vertical_acceleration, z=dir.z*horizontal_acceleration_factor})
64 obj:setyaw(player:get_look_horizontal()-math.pi/2)
65
66 if luaentity.on_throw_sound ~= "" then
67 minetest.sound_play(luaentity.on_throw_sound or "throwing_sound", {pos=playerpos, gain = 0.5})
68 end
69
70 if not minetest.settings:get_bool("creative_mode") then
71 if new_stack then
72 inventory:set_stack("main", index, new_stack)
73 else
74 local stack = inventory:get_stack("main", index)
75 stack:take_item()
76 inventory:set_stack("main", index, stack)
77 end
78 end
79
80 return true
81 end
82
83 local function arrow_step(self, dtime)
84 self.timer = self.timer + dtime
85 local pos = self.object:getpos()
86 local node = minetest.get_node(pos)
87
88 local logging = function(message, level)
89 minetest.log(level or "action", "[throwing] Arrow "..(self.item or self.name).." throwed by player "..self.player.." "..tostring(self.timer).."s ago "..message)
90 end
91
92 local hit = function(pos, node, obj)
93 if obj then
94 if obj:is_player() then
95 if obj:get_player_name() == self.player then -- Avoid hitting the hitter
96 return false
97 end
98 end
99 end
100
101 local player = minetest.get_player_by_name(self.player)
102 if not player then -- Possible if the player disconnected
103 return
104 end
105
106 local function hit_failed()
107 if not minetest.settings:get_bool("creative_mode") and self.item then
108 player:get_inventory():add_item("main", self.item)
109 end
110 if self.on_hit_fails then
111 self:on_hit_fails(pos, player, self.data)
112 end
113 end
114
115 if not self.last_pos then
116 logging("hitted a node during its first call to the step function")
117 hit_failed()
118 return
119 end
120
121 if node and minetest.is_protected(pos, self.player) and not self.allow_protected then -- Forbid hitting nodes in protected areas
122 minetest.record_protection_violation(pos, self.player)
123 logging("hitted a node into a protected area")
124 return
125 end
126
127 if self.on_hit then
128 local ret, reason = self:on_hit(pos, self.last_pos, node, obj, player, self.data)
129 if ret == false then
130 if reason then
131 logging(": on_hit function failed for reason: "..reason)
132 else
133 logging(": on_hit function failed")
134 end
135
136 hit_failed()
137 return
138 end
139 end
140
141 if self.on_hit_sound then
142 minetest.sound_play(self.on_hit_sound, {pos = pos, gain = 0.8})
143 end
144 if node then
145 logging("collided with node "..node.name.." at ("..pos.x..","..pos.y..","..pos.z..")")
146 elseif obj then
147 if obj:get_luaentity() then
148 logging("collided with luaentity "..obj:get_luaentity().name.." at ("..pos.x..","..pos.y..","..pos.z..")")
149 elseif obj:is_player() then
150 logging("collided with player "..obj:get_player_name().." at ("..pos.x..","..pos.y..","..pos.z..")")
151 else
152 logging("collided with object at ("..pos.x..","..pos.y..","..pos.z..")")
153 end
154 end
155 end
156
157 -- Collision with a node
158 if node.name == "ignore" then
159 self.object:remove()
160 logging("reached ignore. Removing.")
161 return
162 elseif (minetest.registered_items[node.name] or {}).drawtype ~= "airlike" then
163 if self.target ~= throwing.target_object then -- throwing.target_both, nil, throwing.target_node, or any invalid value
164 if hit(pos, node, nil) ~= false then
165 self.object:remove()
166 end
167 else
168 self.object:remove()
169 end
170 return
171 end
172
173 -- Collision with an object
174 local objs = minetest.get_objects_inside_radius(pos, 1)
175 for k, obj in pairs(objs) do
176 if obj:get_luaentity() then
177 if obj:get_luaentity().name ~= self.name and obj:get_luaentity().name ~= "__builtin:item" then
178 if self.target ~= throwing.target_node then -- throwing.target_both, nil, throwing.target_object, or any invalid value
179 if hit(pos, nil, obj) ~= false then
180 self.object:remove()
181 end
182 else
183 self.object:remove()
184 end
185 end
186 else
187 if self.target ~= throwing.target_node then -- throwing.target_both, nil, throwing.target_object, or any invalid value
188 if hit(pos, nil, obj) ~= false then
189 self.object:remove()
190 end
191 else
192 self.object:remove()
193 end
194 end
195 end
196
197 -- Support for shining items using wielded light
198 if minetest.global_exists("wielded_light") and self.object then
199 wielded_light.update_light_by_item(self.item, self.object:get_pos())
200 end
201
202 self.last_pos = pos -- Used by the build arrow
203 end
204
205 function throwing.make_arrow_def(def)
206 def.timer = 0
207 def.player = ""
208 def.on_step = arrow_step
209 def.data = {}
210 return def
211 end
212
213 --[[
214 on_hit(pos, last_pos, node, object, hitter)
215 Either node or object is nil, depending whether the arrow collided with an object (luaentity or player) or with a node.
216 No log message is needed in this function (a generic log message is automatically emitted), except on error or warning.
217 Should return false or false, reason on failure.
218
219 on_throw(pos, hitter)
220 Unlike on_hit, it is optional.
221 ]]
222 function throwing.register_arrow(name, def)
223 throwing.arrows[name] = true
224
225 local registration_name = name
226 if name:sub(1,9) == "throwing:" then
227 registration_name = ":"..name
228 end
229
230 if not def.groups then
231 def.groups = {}
232 end
233 if not def.groups.dig_immediate then
234 def.groups.dig_immediate = 3
235 end
236 def.inventory_image = def.tiles[1]
237 def.on_place = function(itemstack, placer, pointed_thing)
238 if minetest.settings:get_bool("throwing.allow_arrow_placing") and pointed_thing.above then
239 local playername = placer:get_player_name()
240 if not minetest.is_protected(pointed_thing.above, playername) then
241 minetest.log("action", "Player "..playername.." placed arrow "..name.." at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
242 minetest.set_node(pointed_thing.above, {name = name})
243 itemstack:take_item()
244 return itemstack
245 else
246 minetest.log("warning", "Player "..playername.." tried to place arrow "..name.." into a protected area at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
247 minetest.record_protection_violation(pointed_thing.above, playername)
248 return itemstack
249 end
250 else
251 return itemstack
252 end
253 end
254 def.drawtype = "nodebox"
255 def.paramtype = "light"
256 def.node_box = {
257 type = "fixed",
258 fixed = {
259 -- Shaft
260 {-6.5/17, -1.5/17, -1.5/17, 6.5/17, 1.5/17, 1.5/17},
261 -- Spitze
262 {-4.5/17, 2.5/17, 2.5/17, -3.5/17, -2.5/17, -2.5/17},
263 {-8.5/17, 0.5/17, 0.5/17, -6.5/17, -0.5/17, -0.5/17},
264 -- Federn
265 {6.5/17, 1.5/17, 1.5/17, 7.5/17, 2.5/17, 2.5/17},
266 {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17},
267 {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17},
268 {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17},
269
270 {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17},
271 {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17},
272 {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17},
273 {7.5/17, -2.5/17, -2.5/17, 8.5/17, -3.5/17, -3.5/17},
274 }
275 }
276 minetest.register_node(registration_name, def)
277
278 minetest.register_entity(registration_name.."_entity", throwing.make_arrow_def{
279 physical = false,
280 visual = "wielditem",
281 visual_size = {x = 0.125, y = 0.125},
282 textures = {name},
283 collisionbox = {0, 0, 0, 0, 0, 0},
284 on_hit = def.on_hit,
285 on_hit_sound = def.on_hit_sound,
286 on_throw_sound = def.on_throw_sound,
287 on_throw = def.on_throw,
288 allow_protected = def.allow_protected,
289 target = def.target,
290 on_hit_fails = def.on_hit_fails,
291 item = name,
292 })
293
294 if def.itemcraft then
295 minetest.register_craft({
296 output = name.." "..tostring(def.craft_quantity or 1),
297 recipe = {
298 {def.itemcraft, "default:stick", "default:stick"}
299 }
300 })
301 minetest.register_craft({
302 output = name.." "..tostring(def.craft_quantity or 1),
303 recipe = {
304 { "default:stick", "default:stick", def.itemcraft}
305 }
306 })
307 end
308 end
309
310
311 ---------- Bows -----------
312 function throwing.register_bow(name, def)
313 if not def.allow_shot then
314 def.allow_shot = function(player, itemstack, index)
315 if index >= player:get_inventory():get_size("main") and not def.throw_itself then
316 return false
317 end
318 return throwing.is_arrow(itemstack)
319 end
320 end
321 if not def.inventory_image then
322 def.inventory_image = def.texture
323 end
324 def.on_use = function(itemstack, user, pointed_thing)
325 -- Cooldown
326 local meta = itemstack:get_meta()
327 local cooldown = def.cooldown or tonumber(minetest.settings:get("throwing.bow_cooldown")) or 0.2
328
329 if cooldown > 0 and meta:get_int("cooldown") > os.time()
330 or meta:get_int("delay") > os.time() then
331 return
332 end
333
334 local bow_index = user:get_wield_index()
335 local arrow_index = (def.throw_itself and bow_index) or bow_index+1
336 local res, new_stack = def.allow_shot(user, user:get_inventory():get_stack("main", arrow_index), arrow_index, false)
337 if not res then
338 return (def.throw_itself and new_stack) or itemstack
339 end
340
341 -- Sound
342 if def.sound then
343 minetest.sound_play(def.sound, {to_player=user:get_player_name()})
344 end
345
346 meta:set_int("delay", os.time() + (def.delay or 0))
347 minetest.after(def.delay or 0, function()
348 -- Re-check that the arrow can be thrown. Overwrite the new_stack
349 local old_new_stack = new_stack
350 res, new_stack = def.allow_shot(user, user:get_inventory():get_stack("main", arrow_index), arrow_index, true)
351 if not new_stack then
352 new_stack = old_new_stack
353 end
354 if not res then
355 return
356 end
357
358 -- Shoot arrow
359 if shoot_arrow(itemstack, user, bow_index, def.throw_itself, new_stack) then
360 if not minetest.settings:get_bool("creative_mode") then
361 itemstack:add_wear(65535 / (def.uses or 50))
362 end
363 end
364
365
366 if def.throw_itself then
367 -- This is a bug. If we return ItemStack(nil), the player punches the entity,
368 -- and if the entity if a __builtin:item, it gets back to his inventory.
369 minetest.after(0.1, function()
370 user:get_inventory():remove_item("main", itemstack)
371 end)
372 elseif cooldown > 0 then
373 meta:set_int("cooldown", os.time() + cooldown)
374 end
375 user:get_inventory():set_stack("main", bow_index, itemstack)
376 end)
377 return itemstack
378 end
379 minetest.register_tool(name, def)
380
381 if def.itemcraft then
382 -- Check for an override name
383 -- because an ``output = ":name"'' can't exist in a recipe
384 local output_name = name
385 if name:sub(1,1) == ":" then
386 output_name = name:sub(2)
387 end
388 minetest.register_craft({
389 output = output_name,
390 recipe = {
391 {"farming:cotton", def.itemcraft, ""},
392 {"farming:cotton", "", def.itemcraft},
393 {"farming:cotton", def.itemcraft, ""},
394 }
395 })
396 end
397 end
+0
-1
throwing/mod.conf less more
0 name = throwing
+0
-374
throwing_arrows/LICENSE.txt less more
0 Mozilla Public License Version 2.0
1 ==================================
2
3 1. Definitions
4 --------------
5
6 1.1. "Contributor"
7 means each individual or legal entity that creates, contributes to
8 the creation of, or owns Covered Software.
9
10 1.2. "Contributor Version"
11 means the combination of the Contributions of others (if any) used
12 by a Contributor and that particular Contributor's Contribution.
13
14 1.3. "Contribution"
15 means Covered Software of a particular Contributor.
16
17 1.4. "Covered Software"
18 means Source Code Form to which the initial Contributor has attached
19 the notice in Exhibit A, the Executable Form of such Source Code
20 Form, and Modifications of such Source Code Form, in each case
21 including portions thereof.
22
23 1.5. "Incompatible With Secondary Licenses"
24 means
25
26 (a) that the initial Contributor has attached the notice described
27 in Exhibit B to the Covered Software; or
28
29 (b) that the Covered Software was made available under the terms of
30 version 1.1 or earlier of the License, but not also under the
31 terms of a Secondary License.
32
33 1.6. "Executable Form"
34 means any form of the work other than Source Code Form.
35
36 1.7. "Larger Work"
37 means a work that combines Covered Software with other material, in
38 a separate file or files, that is not Covered Software.
39
40 1.8. "License"
41 means this document.
42
43 1.9. "Licensable"
44 means having the right to grant, to the maximum extent possible,
45 whether at the time of the initial grant or subsequently, any and
46 all of the rights conveyed by this License.
47
48 1.10. "Modifications"
49 means any of the following:
50
51 (a) any file in Source Code Form that results from an addition to,
52 deletion from, or modification of the contents of Covered
53 Software; or
54
55 (b) any new file in Source Code Form that contains any Covered
56 Software.
57
58 1.11. "Patent Claims" of a Contributor
59 means any patent claim(s), including without limitation, method,
60 process, and apparatus claims, in any patent Licensable by such
61 Contributor that would be infringed, but for the grant of the
62 License, by the making, using, selling, offering for sale, having
63 made, import, or transfer of either its Contributions or its
64 Contributor Version.
65
66 1.12. "Secondary License"
67 means either the GNU General Public License, Version 2.0, the GNU
68 Lesser General Public License, Version 2.1, the GNU Affero General
69 Public License, Version 3.0, or any later versions of those
70 licenses.
71
72 1.13. "Source Code Form"
73 means the form of the work preferred for making modifications.
74
75 1.14. "You" (or "Your")
76 means an individual or a legal entity exercising rights under this
77 License. For legal entities, "You" includes any entity that
78 controls, is controlled by, or is under common control with You. For
79 purposes of this definition, "control" means (a) the power, direct
80 or indirect, to cause the direction or management of such entity,
81 whether by contract or otherwise, or (b) ownership of more than
82 fifty percent (50%) of the outstanding shares or beneficial
83 ownership of such entity.
84
85 2. License Grants and Conditions
86 --------------------------------
87
88 2.1. Grants
89
90 Each Contributor hereby grants You a world-wide, royalty-free,
91 non-exclusive license:
92
93 (a) under intellectual property rights (other than patent or trademark)
94 Licensable by such Contributor to use, reproduce, make available,
95 modify, display, perform, distribute, and otherwise exploit its
96 Contributions, either on an unmodified basis, with Modifications, or
97 as part of a Larger Work; and
98
99 (b) under Patent Claims of such Contributor to make, use, sell, offer
100 for sale, have made, import, and otherwise transfer either its
101 Contributions or its Contributor Version.
102
103 2.2. Effective Date
104
105 The licenses granted in Section 2.1 with respect to any Contribution
106 become effective for each Contribution on the date the Contributor first
107 distributes such Contribution.
108
109 2.3. Limitations on Grant Scope
110
111 The licenses granted in this Section 2 are the only rights granted under
112 this License. No additional rights or licenses will be implied from the
113 distribution or licensing of Covered Software under this License.
114 Notwithstanding Section 2.1(b) above, no patent license is granted by a
115 Contributor:
116
117 (a) for any code that a Contributor has removed from Covered Software;
118 or
119
120 (b) for infringements caused by: (i) Your and any other third party's
121 modifications of Covered Software, or (ii) the combination of its
122 Contributions with other software (except as part of its Contributor
123 Version); or
124
125 (c) under Patent Claims infringed by Covered Software in the absence of
126 its Contributions.
127
128 This License does not grant any rights in the trademarks, service marks,
129 or logos of any Contributor (except as may be necessary to comply with
130 the notice requirements in Section 3.4).
131
132 2.4. Subsequent Licenses
133
134 No Contributor makes additional grants as a result of Your choice to
135 distribute the Covered Software under a subsequent version of this
136 License (see Section 10.2) or under the terms of a Secondary License (if
137 permitted under the terms of Section 3.3).
138
139 2.5. Representation
140
141 Each Contributor represents that the Contributor believes its
142 Contributions are its original creation(s) or it has sufficient rights
143 to grant the rights to its Contributions conveyed by this License.
144
145 2.6. Fair Use
146
147 This License is not intended to limit any rights You have under
148 applicable copyright doctrines of fair use, fair dealing, or other
149 equivalents.
150
151 2.7. Conditions
152
153 Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
154 in Section 2.1.
155
156 3. Responsibilities
157 -------------------
158
159 3.1. Distribution of Source Form
160
161 All distribution of Covered Software in Source Code Form, including any
162 Modifications that You create or to which You contribute, must be under
163 the terms of this License. You must inform recipients that the Source
164 Code Form of the Covered Software is governed by the terms of this
165 License, and how they can obtain a copy of this License. You may not
166 attempt to alter or restrict the recipients' rights in the Source Code
167 Form.
168
169 3.2. Distribution of Executable Form
170
171 If You distribute Covered Software in Executable Form then:
172
173 (a) such Covered Software must also be made available in Source Code
174 Form, as described in Section 3.1, and You must inform recipients of
175 the Executable Form how they can obtain a copy of such Source Code
176 Form by reasonable means in a timely manner, at a charge no more
177 than the cost of distribution to the recipient; and
178
179 (b) You may distribute such Executable Form under the terms of this
180 License, or sublicense it under different terms, provided that the
181 license for the Executable Form does not attempt to limit or alter
182 the recipients' rights in the Source Code Form under this License.
183
184 3.3. Distribution of a Larger Work
185
186 You may create and distribute a Larger Work under terms of Your choice,
187 provided that You also comply with the requirements of this License for
188 the Covered Software. If the Larger Work is a combination of Covered
189 Software with a work governed by one or more Secondary Licenses, and the
190 Covered Software is not Incompatible With Secondary Licenses, this
191 License permits You to additionally distribute such Covered Software
192 under the terms of such Secondary License(s), so that the recipient of
193 the Larger Work may, at their option, further distribute the Covered
194 Software under the terms of either this License or such Secondary
195 License(s).
196
197 3.4. Notices
198
199 You may not remove or alter the substance of any license notices
200 (including copyright notices, patent notices, disclaimers of warranty,
201 or limitations of liability) contained within the Source Code Form of
202 the Covered Software, except that You may alter any license notices to
203 the extent required to remedy known factual inaccuracies.
204
205 3.5. Application of Additional Terms
206
207 You may choose to offer, and to charge a fee for, warranty, support,
208 indemnity or liability obligations to one or more recipients of Covered
209 Software. However, You may do so only on Your own behalf, and not on
210 behalf of any Contributor. You must make it absolutely clear that any
211 such warranty, support, indemnity, or liability obligation is offered by
212 You alone, and You hereby agree to indemnify every Contributor for any
213 liability incurred by such Contributor as a result of warranty, support,
214 indemnity or liability terms You offer. You may include additional
215 disclaimers of warranty and limitations of liability specific to any
216 jurisdiction.
217
218 4. Inability to Comply Due to Statute or Regulation
219 ---------------------------------------------------
220
221 If it is impossible for You to comply with any of the terms of this
222 License with respect to some or all of the Covered Software due to
223 statute, judicial order, or regulation then You must: (a) comply with
224 the terms of this License to the maximum extent possible; and (b)
225 describe the limitations and the code they affect. Such description must
226 be placed in a text file included with all distributions of the Covered
227 Software under this License. Except to the extent prohibited by statute
228 or regulation, such description must be sufficiently detailed for a
229 recipient of ordinary skill to be able to understand it.
230
231 5. Termination
232 --------------
233
234 5.1. The rights granted under this License will terminate automatically
235 if You fail to comply with any of its terms. However, if You become
236 compliant, then the rights granted under this License from a particular
237 Contributor are reinstated (a) provisionally, unless and until such
238 Contributor explicitly and finally terminates Your grants, and (b) on an
239 ongoing basis, if such Contributor fails to notify You of the
240 non-compliance by some reasonable means prior to 60 days after You have
241 come back into compliance. Moreover, Your grants from a particular
242 Contributor are reinstated on an ongoing basis if such Contributor
243 notifies You of the non-compliance by some reasonable means, this is the
244 first time You have received notice of non-compliance with this License
245 from such Contributor, and You become compliant prior to 30 days after
246 Your receipt of the notice.
247
248 5.2. If You initiate litigation against any entity by asserting a patent
249 infringement claim (excluding declaratory judgment actions,
250 counter-claims, and cross-claims) alleging that a Contributor Version
251 directly or indirectly infringes any patent, then the rights granted to
252 You by any and all Contributors for the Covered Software under Section
253 2.1 of this License shall terminate.
254
255 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
256 end user license agreements (excluding distributors and resellers) which
257 have been validly granted by You or Your distributors under this License
258 prior to termination shall survive termination.
259
260 ************************************************************************
261 * *
262 * 6. Disclaimer of Warranty *
263 * ------------------------- *
264 * *
265 * Covered Software is provided under this License on an "as is" *
266 * basis, without warranty of any kind, either expressed, implied, or *
267 * statutory, including, without limitation, warranties that the *
268 * Covered Software is free of defects, merchantable, fit for a *
269 * particular purpose or non-infringing. The entire risk as to the *
270 * quality and performance of the Covered Software is with You. *
271 * Should any Covered Software prove defective in any respect, You *
272 * (not any Contributor) assume the cost of any necessary servicing, *
273 * repair, or correction. This disclaimer of warranty constitutes an *
274 * essential part of this License. No use of any Covered Software is *
275 * authorized under this License except under this disclaimer. *
276 * *
277 ************************************************************************
278
279 ************************************************************************
280 * *
281 * 7. Limitation of Liability *
282 * -------------------------- *
283 * *
284 * Under no circumstances and under no legal theory, whether tort *
285 * (including negligence), contract, or otherwise, shall any *
286 * Contributor, or anyone who distributes Covered Software as *
287 * permitted above, be liable to You for any direct, indirect, *
288 * special, incidental, or consequential damages of any character *
289 * including, without limitation, damages for lost profits, loss of *
290 * goodwill, work stoppage, computer failure or malfunction, or any *
291 * and all other commercial damages or losses, even if such party *
292 * shall have been informed of the possibility of such damages. This *
293 * limitation of liability shall not apply to liability for death or *
294 * personal injury resulting from such party's negligence to the *
295 * extent applicable law prohibits such limitation. Some *
296 * jurisdictions do not allow the exclusion or limitation of *
297 * incidental or consequential damages, so this exclusion and *
298 * limitation may not apply to You. *
299 * *
300 ************************************************************************
301
302 8. Litigation
303 -------------
304
305 Any litigation relating to this License may be brought only in the
306 courts of a jurisdiction where the defendant maintains its principal
307 place of business and such litigation shall be governed by laws of that
308 jurisdiction, without reference to its conflict-of-law provisions.
309 Nothing in this Section shall prevent a party's ability to bring
310 cross-claims or counter-claims.
311
312 9. Miscellaneous
313 ----------------
314
315 This License represents the complete agreement concerning the subject
316 matter hereof. If any provision of this License is held to be
317 unenforceable, such provision shall be reformed only to the extent
318 necessary to make it enforceable. Any law or regulation which provides
319 that the language of a contract shall be construed against the drafter
320 shall not be used to construe this License against a Contributor.
321
322 10. Versions of the License
323 ---------------------------
324
325 10.1. New Versions
326
327 Mozilla Foundation is the license steward. Except as provided in Section
328 10.3, no one other than the license steward has the right to modify or
329 publish new versions of this License. Each version will be given a
330 distinguishing version number.
331
332 10.2. Effect of New Versions
333
334 You may distribute the Covered Software under the terms of the version
335 of the License under which You originally received the Covered Software,
336 or under the terms of any subsequent version published by the license
337 steward.
338
339 10.3. Modified Versions
340
341 If you create software not governed by this License, and you want to
342 create a new license for such software, you may create and use a
343 modified version of this License if you rename the license and remove
344 any references to the name of the license steward (except to note that
345 such modified license differs from this License).
346
347 10.4. Distributing Source Code Form that is Incompatible With Secondary
348 Licenses
349
350 If You choose to distribute Source Code Form that is Incompatible With
351 Secondary Licenses under the terms of this version of the License, the
352 notice described in Exhibit B of this License must be attached.
353
354 Exhibit A - Source Code Form License Notice
355 -------------------------------------------
356
357 This Source Code Form is subject to the terms of the Mozilla Public
358 License, v. 2.0. If a copy of the MPL was not distributed with this
359 file, You can obtain one at http://mozilla.org/MPL/2.0/.
360
361 If it is not possible or desirable to put the notice in a particular
362 file, then You may include the notice in a location (such as a LICENSE
363 file in a relevant directory) where a recipient would be likely to look
364 for such a notice.
365
366 You may add additional accurate notices of copyright ownership.
367
368 Exhibit B - "Incompatible With Secondary Licenses" Notice
369 ---------------------------------------------------------
370
371 This Source Code Form is "Incompatible With Secondary Licenses", as
372 defined by the Mozilla Public License, v. 2.0.
373
+0
-22
throwing_arrows/README.md less more
0 # Bows and Arrows for Throwing
1
2 This mod registers basic bows and arrows for the [throwing API](https://github.com/MT-Eurythmia/throwing). It makes `throwing` a compatible replacement for the throwing mod by PilzAdam.
3
4 ## Settings
5
6 The settings are the following:
7 ```
8 throwing.enable_arrow = true
9 throwing.enable_golden_arrow = true
10 throwing.enable_fire_arrow = true
11 throwing.enable_teleport_arrow = true
12 throwing.enable_dig_arrow = true
13 throwing.enable_dig_arrow_admin = true
14 throwing.enable_build_arrow = true
15
16 throwing.arrow_teleport_in_protected = true
17 ```
18
19 ## Screenshot
20
21 ![Screenshot](screenshot.png)
+0
-5
throwing_arrows/depends.txt less more
0 throwing
1 default
2 farming
3 mesecons?
4 mesecons_button?
+0
-1
throwing_arrows/description.txt less more
0 Classic bows and arrows for the throwing_redo API
+0
-224
throwing_arrows/init.lua less more
0 throwing.register_bow(":throwing:bow_wood", {
1 itemcraft = "default:wood",
2 description = "Wooden Bow",
3 texture = "throwing_bow_wood.png",
4 uses = 50
5 })
6 throwing.register_bow(":throwing:bow_stone", {
7 itemcraft = "default:cobble",
8 description = "Stone Bow",
9 texture = "throwing_bow_stone.png",
10 uses = 100
11 })
12 throwing.register_bow(":throwing:bow_steel", {
13 itemcraft = "default:steel_ingot",
14 description = "Steel Bow",
15 texture = "throwing_bow_steel.png",
16 uses = 150
17 })
18 throwing.register_bow(":throwing:bow_bronze", {
19 itemcraft = "default:bronze_ingot",
20 description = "Bronze Bow",
21 texture = "throwing_bow_bronze.png",
22 uses = 200
23 })
24 throwing.register_bow(":throwing:bow_gold", {
25 itemcraft = "default:gold_ingot",
26 description = "Gold Bow",
27 texture = "throwing_bow_gold.png",
28 uses = 250
29 })
30 throwing.register_bow(":throwing:bow_mese", {
31 itemcraft = "default:mese_crystal",
32 description = "Mese Bow",
33 texture = "throwing_bow_mese.png",
34 uses = 300
35 })
36 throwing.register_bow(":throwing:bow_diamond", {
37 itemcraft = "default:diamond",
38 description = "Diamond Bow",
39 texture = "throwing_bow_diamond.png",
40 uses = 320
41 })
42
43 local function get_setting(name)
44 local value = minetest.settings:get_bool("throwing.enable_"..name)
45 if value == true or value == nil then
46 return true
47 else
48 return false
49 end
50 end
51
52 if get_setting("arrow") then
53 throwing.register_arrow("throwing:arrow", {
54 itemcraft = "default:steel_ingot",
55 craft_quantity = 16,
56 description = "Arrow",
57 tiles = {"throwing_arrow.png", "throwing_arrow.png", "throwing_arrow_back.png", "throwing_arrow_front.png", "throwing_arrow_2.png", "throwing_arrow.png"},
58 target = throwing.target_both,
59 allow_protected = true,
60 on_hit_sound = "throwing_arrow",
61 on_hit = function(self, pos, _, node, object, hitter)
62 if object then
63 object:punch(hitter, 1, {
64 full_punch_interval = 1,
65 damage_groups = {fleshy = 3}
66 })
67 elseif node then
68 if node.name == "mesecons_button:button_off" and minetest.get_modpath("mesecons_button") and minetest.get_modpath("mesecons") then
69 minetest.registered_items["mesecons_button:button_off"].on_rightclick(vector.round(pos), node)
70 end
71 end
72 end
73 })
74 end
75
76 if get_setting("golden_arrow") then
77 throwing.register_arrow("throwing:arrow_gold", {
78 itemcraft = "default:gold_ingot",
79 craft_quantity = 16,
80 description = "Golden Arrow",
81 tiles = {"throwing_arrow_gold.png", "throwing_arrow_gold.png", "throwing_arrow_gold_back.png", "throwing_arrow_gold_front.png", "throwing_arrow_gold_2.png", "throwing_arrow_gold.png"},
82 target = throwing.target_object,
83 allow_protected = true,
84 on_hit_sound = "throwing_arrow",
85 on_hit = function(self, pos, _, _, object, hitter)
86 object:punch(hitter, 1, {
87 full_punch_interval = 1,
88 damage_groups = {fleshy = 5}
89 })
90 end
91 })
92 end
93
94 if get_setting("dig_arrow") then
95 throwing.register_arrow("throwing:arrow_dig", {
96 itemcraft = "default:pick_wood",
97 description = "Dig Arrow",
98 tiles = {"throwing_arrow_dig.png", "throwing_arrow_dig.png", "throwing_arrow_dig_back.png", "throwing_arrow_dig_front.png", "throwing_arrow_dig_2.png", "throwing_arrow_dig.png"},
99 target = throwing.target_node,
100 on_hit_sound = "throwing_dig_arrow",
101 on_hit = function(self, pos, _, node, _, hitter)
102 return minetest.dig_node(pos)
103 end
104 })
105 end
106
107 if get_setting("dig_arrow_admin") then
108 throwing.register_arrow("throwing:arrow_dig_admin", {
109 description = "Admin Dig Arrow",
110 tiles = {"throwing_arrow_dig.png", "throwing_arrow_dig.png", "throwing_arrow_dig_back.png", "throwing_arrow_dig_front.png", "throwing_arrow_dig_2.png", "throwing_arrow_dig.png"},
111 target = throwing.target_node,
112 on_hit = function(self, pos, _, node, _, _)
113 minetest.remove_node(pos)
114 end,
115 groups = {not_in_creative_inventory = 1}
116 })
117 end
118
119 if get_setting("teleport_arrow") then
120 throwing.register_arrow("throwing:arrow_teleport", {
121 itemcraft = "default:diamond",
122 description = "Teleport Arrow",
123 tiles = {"throwing_arrow_teleport.png", "throwing_arrow_teleport.png", "throwing_arrow_teleport_back.png", "throwing_arrow_teleport_front.png", "throwing_arrow_teleport_2.png", "throwing_arrow_teleport.png"},
124 allow_protected = true,
125 on_hit_sound = "throwing_teleport_arrow",
126 on_hit = function(self, _, last_pos, _, _, hitter)
127 if minetest.get_node(last_pos).name ~= "air" then
128 minetest.log("warning", "[throwing] BUG: node at last_pos was not air")
129 return
130 end
131
132 if minetest.setting_getbool("throwing.allow_teleport_in_protected") == false then
133 return false
134 end
135
136 hitter:moveto(last_pos)
137 end
138 })
139 end
140
141 if get_setting("fire_arrow") then
142 throwing.register_arrow("throwing:arrow_fire", {
143 itemcraft = "default:torch",
144 description = "Torch Arrow",
145 tiles = {"throwing_arrow_fire.png", "throwing_arrow_fire.png", "throwing_arrow_fire_back.png", "throwing_arrow_fire_front.png", "throwing_arrow_fire_2.png", "throwing_arrow_fire.png"},
146 on_hit_sound = "default_place_node",
147 on_hit = function(self, pos, last_pos, _, _, hitter)
148 if minetest.get_node(last_pos).name ~= "air" then
149 minetest.log("warning", "[throwing] BUG: node at last_pos was not air")
150 return
151 end
152
153 local r_pos = vector.round(pos)
154 local r_last_pos = vector.round(last_pos)
155 -- Make sure that only one key is different
156 if r_pos.y ~= r_last_pos.y then
157 r_last_pos.x = r_pos.x
158 r_last_pos.z = r_pos.z
159 elseif r_pos.x ~= r_last_pos.x then
160 r_last_pos.y = r_pos.y
161 r_last_pos.z = r_pos.z
162 end
163 minetest.registered_items["default:torch"].on_place(ItemStack("default:torch"), hitter,
164 {type="node", under=r_pos, above=r_last_pos})
165 end
166 })
167 end
168
169 if get_setting("build_arrow") then
170 throwing.register_arrow("throwing:arrow_build", {
171 itemcraft = "default:obsidian_glass",
172 description = "Build Arrow",
173 tiles = {"throwing_arrow_build.png", "throwing_arrow_build.png", "throwing_arrow_build_back.png", "throwing_arrow_build_front.png", "throwing_arrow_build_2.png", "throwing_arrow_build.png"},
174 on_hit_sound = "throwing_build_arrow",
175 on_hit = function(self, pos, last_pos, _, _, hitter)
176 if minetest.get_node(last_pos).name ~= "air" then
177 minetest.log("warning", "[throwing] BUG: node at last_pos was not air")
178 return
179 end
180
181 local r_pos = vector.round(pos)
182 local r_last_pos = vector.round(last_pos)
183 -- Make sure that only one key is different
184 if r_pos.y ~= r_last_pos.y then
185 r_last_pos.x = r_pos.x
186 r_last_pos.z = r_pos.z
187 elseif r_pos.x ~= r_last_pos.x then
188 r_last_pos.y = r_pos.y
189 r_last_pos.z = r_pos.z
190 end
191 minetest.registered_items["default:obsidian_glass"].on_place(ItemStack("default:obsidian_glass"), hitter,
192 {type="node", under=r_pos, above=r_last_pos})
193 end
194 })
195 end
196
197 if get_setting("drop_arrow") then
198 throwing.register_arrow("throwing:arrow_drop", {
199 itemcraft = "default:copper_ingot",
200 craft_quantity = 16,
201 description = "Drop Arrow",
202 tiles = {"throwing_arrow_drop.png", "throwing_arrow_drop.png", "throwing_arrow_drop_back.png", "throwing_arrow_drop_front.png", "throwing_arrow_drop_2.png", "throwing_arrow_drop.png"},
203 on_hit_sound = "throwing_build_arrow",
204 allow_protected = true,
205 on_throw = function(self, _, thrower, _, index, data)
206 local inventory = thrower:get_inventory()
207 if index >= inventory:get_size("main") or inventory:get_stack("main", index+1):get_name() == "" then
208 return false, "nothing to drop"
209 end
210 data.itemstack = inventory:get_stack("main", index+1)
211 data.index = index+1
212 thrower:get_inventory():set_stack("main", index+1, nil)
213 end,
214 on_hit = function(self, _, last_pos, _, _, hitter, data)
215 minetest.item_drop(ItemStack(data.itemstack), hitter, last_pos)
216 end,
217 on_hit_fails = function(self, _, thrower, data)
218 if not minetest.setting_getbool("creative_mode") then
219 thrower:get_inventory():set_stack("main", data.index, data.itemstack)
220 end
221 end
222 })
223 end
+0
-1
throwing_arrows/mod.conf less more
0 name = throwing_arrows
throwing_arrows/screenshot.png less more
Binary diff not shown
throwing_arrows/sounds/throwing_arrow.ogg less more
Binary diff not shown
throwing_arrows/sounds/throwing_build_arrow.ogg less more
Binary diff not shown
throwing_arrows/sounds/throwing_dig_arrow.ogg less more
Binary diff not shown
throwing_arrows/sounds/throwing_sound.ogg less more
Binary diff not shown
throwing_arrows/sounds/throwing_teleport_arrow.ogg less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_build.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_build_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_build_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_build_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig_admin.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig_admin_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig_admin_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig_admin_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_dig_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_drop.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_drop_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_drop_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_drop_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_fire.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_fire_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_fire_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_fire_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_gold.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_gold_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_gold_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_gold_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_teleport.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_teleport_2.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_teleport_back.png less more
Binary diff not shown
throwing_arrows/textures/throwing_arrow_teleport_front.png less more
Binary diff not shown
throwing_arrows/textures/throwing_bow_bronze.png less more
Binary diff not shown
throwing_arrows/textures/throwing_bow_diamond.png less more
Binary diff not shown
throwing_arrows/textures/throwing_bow_gold.png less more
Binary diff not shown
throwing_arrows/textures/throwing_bow_mese.png less more
Binary diff not shown
throwing_arrows/textures/throwing_bow_steel.png less more
Binary diff not shown
throwing_arrows/textures/throwing_bow_stone.png less more
Binary diff not shown
throwing_arrows/textures/throwing_bow_wood.png less more
Binary diff not shown
throwing_arrows/textures/throwing_empty.png less more
Binary diff not shown