mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-06 10:25:00 +01:00
fix: backtank crashing on ctrl+pick block (#7284)
This commit is contained in:
parent
18fb3b4beb
commit
0870d34033
2 changed files with 12 additions and 8 deletions
|
@ -184,8 +184,10 @@ public class BacktankBlock extends HorizontalKineticBlock implements IBE<Backtan
|
||||||
Optional<BacktankBlockEntity> blockEntityOptional = getBlockEntityOptional(blockGetter, pos);
|
Optional<BacktankBlockEntity> blockEntityOptional = getBlockEntityOptional(blockGetter, pos);
|
||||||
|
|
||||||
CompoundTag forgeCapsTag = blockEntityOptional.map(BacktankBlockEntity::getForgeCapsTag)
|
CompoundTag forgeCapsTag = blockEntityOptional.map(BacktankBlockEntity::getForgeCapsTag)
|
||||||
|
.map(CompoundTag::copy)
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
CompoundTag vanillaTag = blockEntityOptional.map(BacktankBlockEntity::getVanillaTag)
|
CompoundTag vanillaTag = blockEntityOptional.map(BacktankBlockEntity::getVanillaTag)
|
||||||
|
.map(CompoundTag::copy)
|
||||||
.orElse(new CompoundTag());
|
.orElse(new CompoundTag());
|
||||||
int air = blockEntityOptional.map(BacktankBlockEntity::getAirLevel)
|
int air = blockEntityOptional.map(BacktankBlockEntity::getAirLevel)
|
||||||
.orElse(0);
|
.orElse(0);
|
||||||
|
|
|
@ -183,8 +183,10 @@ public class BacktankBlockEntity extends KineticBlockEntity implements Nameable
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTags(CompoundTag vanillaTag, @Nullable CompoundTag forgeCapsTag) {
|
public void setTags(CompoundTag vanillaTag, @Nullable CompoundTag forgeCapsTag) {
|
||||||
this.vanillaTag = vanillaTag;
|
this.vanillaTag = vanillaTag.copy();
|
||||||
this.forgeCapsTag = forgeCapsTag;
|
this.forgeCapsTag = forgeCapsTag == null ? null : forgeCapsTag.copy();
|
||||||
|
// Prevent nesting of the ctrl+pick block added tag
|
||||||
|
vanillaTag.remove("BlockEntityTag");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompoundTag getVanillaTag() {
|
public CompoundTag getVanillaTag() {
|
||||||
|
|
Loading…
Reference in a new issue