mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 22:44:07 +01:00
Add null-safety check on usage of BlockEntity.loadStatic (#6224)
This commit is contained in:
parent
6802a1316b
commit
efb3cf490d
@ -298,10 +298,12 @@ public class BlockHelper {
|
|||||||
if (data != null) {
|
if (data != null) {
|
||||||
if (existingBlockEntity instanceof IMergeableBE mergeable) {
|
if (existingBlockEntity instanceof IMergeableBE mergeable) {
|
||||||
BlockEntity loaded = BlockEntity.loadStatic(target, state, data);
|
BlockEntity loaded = BlockEntity.loadStatic(target, state, data);
|
||||||
if (existingBlockEntity.getType()
|
if (loaded != null) {
|
||||||
.equals(loaded.getType())) {
|
if (existingBlockEntity.getType()
|
||||||
mergeable.accept(loaded);
|
.equals(loaded.getType())) {
|
||||||
return;
|
mergeable.accept(loaded);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlockEntity blockEntity = world.getBlockEntity(target);
|
BlockEntity blockEntity = world.getBlockEntity(target);
|
||||||
|
Loading…
Reference in New Issue
Block a user