Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
NestedShulkers
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MCDEVS
NestedShulkers
Commits
34011e54
Verified
Commit
34011e54
authored
Jun 30, 2020
by
Hunter Wignall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the NPE bug from breaking an opened shulker
parent
86d4f871
Pipeline
#133
passed with stages
in 1 minute and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/main/java/us/mcdevs/spigot/nestedshulkers/NestedShulkers.kt
...in/java/us/mcdevs/spigot/nestedshulkers/NestedShulkers.kt
+9
-5
No files found.
src/main/java/us/mcdevs/spigot/nestedshulkers/NestedShulkers.kt
View file @
34011e54
...
...
@@ -99,9 +99,14 @@ class NestedShulkers : JavaPlugin(), Listener {
}
Bukkit
.
getScheduler
().
runTask
(
this
,
Runnable
{
if
(
temp
.
viewers
.
isEmpty
())
{
shulker
.
storageContents
=
temp
.
storageContents
shulkers
.
remove
((
shulker
.
holder
!!
as
ShulkerBox
).
location
)
closeShulker
(
shulker
)
//Catch a weird NPE from breaking the block
shulker
.
let
{
it
.
storageContents
=
temp
.
storageContents
(
it
.
holder
as
?
ShulkerBox
)
?.
location
?.
apply
{
shulkers
.
remove
(
this
)
closeShulker
(
it
)
}
}
}
})
}
...
...
@@ -109,8 +114,7 @@ class NestedShulkers : JavaPlugin(), Listener {
@EventHandler
private
fun
onShulkerBreak
(
event
:
BlockBreakEvent
)
{
val
shulker
=
shulkers
[
event
.
block
.
location
]
?:
return
shulker
.
viewers
.
forEach
{
it
.
closeInventory
()
}
closeShulker
(
shulker
)
ArrayList
(
shulker
.
viewers
).
forEach
{
it
.
closeInventory
()
}
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment