Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci skip] Add missing Nullable annotations for NMS DamageSource #11875

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/damagesource/DamageSource.java
+++ b/net/minecraft/world/damagesource/DamageSource.java
@@ -20,6 +_,105 @@
@@ -20,6 +_,107 @@
private final Entity directEntity;
@Nullable
private final Vec3 damageSourcePosition;
Expand Down Expand Up @@ -58,18 +58,19 @@
+ return damageSource;
+ }
+
+ @Nullable
+ public org.bukkit.block.Block getDirectBlock() {
+ return this.directBlock;
+ }
+
+ public DamageSource directBlock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos blockPosition) {
+ public DamageSource directBlock(@Nullable net.minecraft.world.level.Level world, @Nullable net.minecraft.core.BlockPos blockPosition) {
+ if (blockPosition == null || world == null) {
+ return this;
+ }
+ return this.directBlock(org.bukkit.craftbukkit.block.CraftBlock.at(world, blockPosition));
+ }
+
+ public DamageSource directBlock(org.bukkit.block.Block block) {
+ public DamageSource directBlock(@Nullable org.bukkit.block.Block block) {
+ if (block == null) {
+ return this;
+ }
Expand All @@ -79,11 +80,12 @@
+ return damageSource;
+ }
+
+ @Nullable
+ public org.bukkit.block.BlockState getDirectBlockState() {
+ return this.directBlockState;
+ }
+
+ public DamageSource directBlockState(org.bukkit.block.BlockState blockState) {
+ public DamageSource directBlockState(@Nullable org.bukkit.block.BlockState blockState) {
+ if (blockState == null) {
+ return this;
+ }
Expand Down