mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-06 02:14:58 +01:00
Add null-safety check on usage of BlockEntity.loadStatic (#6224)
This commit is contained in:
parent
6802a1316b
commit
efb3cf490d
1 changed files with 6 additions and 4 deletions
|
@ -298,12 +298,14 @@ public class BlockHelper {
|
|||
if (data != null) {
|
||||
if (existingBlockEntity instanceof IMergeableBE mergeable) {
|
||||
BlockEntity loaded = BlockEntity.loadStatic(target, state, data);
|
||||
if (loaded != null) {
|
||||
if (existingBlockEntity.getType()
|
||||
.equals(loaded.getType())) {
|
||||
mergeable.accept(loaded);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
BlockEntity blockEntity = world.getBlockEntity(target);
|
||||
if (blockEntity != null) {
|
||||
data.putInt("x", target.getX());
|
||||
|
|
Loading…
Reference in a new issue