Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
9675d9e9
Commit
9675d9e9
authored
12 years ago
by
Lord James
Committed by
BlockMen
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
New feature: drop a item instead a stack while...
sneaking
parent
c6a9eae3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
builtin/game/item.lua
+11
-6
11 additions, 6 deletions
builtin/game/item.lua
with
11 additions
and
6 deletions
builtin/game/item.lua
+
11
−
6
View file @
9675d9e9
...
...
@@ -335,20 +335,26 @@ function core.item_place(itemstack, placer, pointed_thing, param2)
end
function
core
.
item_drop
(
itemstack
,
dropper
,
pos
)
if
dropper
.
get
_player
_name
then
if
dropper
.
is
_player
then
local
v
=
dropper
:
get_look_dir
()
local
p
=
{
x
=
pos
.
x
+
v
.
x
,
y
=
pos
.
y
+
1
.
5
+
v
.
y
,
z
=
pos
.
z
+
v
.
z
}
local
obj
=
core
.
add_item
(
p
,
itemstack
)
local
p
=
{
x
=
pos
.
x
,
y
=
pos
.
y
+
1
.
2
,
z
=
pos
.
z
}
local
cs
=
itemstack
:
get_count
()
if
dropper
:
get_player_control
().
sneak
then
cs
=
1
end
local
item
=
itemstack
:
take_item
(
cs
)
local
obj
=
core
.
add_item
(
p
,
item
)
if
obj
then
v
.
x
=
v
.
x
*
2
v
.
y
=
v
.
y
*
2
+
1
v
.
y
=
v
.
y
*
2
+
2
v
.
z
=
v
.
z
*
2
obj
:
setvelocity
(
v
)
end
else
core
.
add_item
(
pos
,
itemstack
)
end
return
I
tem
S
tack
(
""
)
return
i
tem
s
tack
end
function
core
.
item_eat
(
hp_change
,
replace_with_item
)
...
...
@@ -592,4 +598,3 @@ core.noneitemdef_default = { -- This is used for the hand and unknown items
on_drop
=
nil
,
on_use
=
nil
,
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment