-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2.0] Add DaylightDetector block entity (#1337) (#1345)
* Add DaylightDetector block entity * Removed saveAdditionalData() Co-authored-by: CiviledCode <[email protected]>
- Loading branch information
1 parent
4bce2d1
commit b5573b9
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/java/cn/nukkit/blockentity/impl/DaylightDetectorBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cn.nukkit.blockentity.impl; | ||
|
||
import cn.nukkit.block.BlockIds; | ||
import cn.nukkit.blockentity.BlockEntityType; | ||
import cn.nukkit.blockentity.DaylightDetector; | ||
import cn.nukkit.level.chunk.Chunk; | ||
import cn.nukkit.utils.Identifier; | ||
import com.nukkitx.math.vector.Vector3i; | ||
|
||
public class DaylightDetectorBlockEntity extends BaseBlockEntity implements DaylightDetector { | ||
|
||
|
||
public DaylightDetectorBlockEntity(BlockEntityType<?> type, Chunk chunk, Vector3i position) { | ||
super(type, chunk, position); | ||
} | ||
|
||
@Override | ||
public boolean isValid() { | ||
Identifier blockId = getBlock().getId(); | ||
return blockId == BlockIds.DAYLIGHT_DETECTOR || blockId == BlockIds.DAYLIGHT_DETECTOR_INVERTED; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters