Skip to content

Commit

Permalink
Requested Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAbsolutionism committed Sep 20, 2024
1 parent 77aca7a commit 365afa8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1940,13 +1940,13 @@ public RegainReason get(EntityRegainHealthEvent event) {
// BlockDropItemEvent
EventValues.registerEventValue(BlockDropItemEvent.class, Block.class, new Getter<Block, BlockDropItemEvent>() {
@Override
public @Nullable Block get(BlockDropItemEvent event) {
public Block get(BlockDropItemEvent event) {
return new BlockStateBlock(event.getBlockState());
}
}, EventValues.TIME_PAST);
EventValues.registerEventValue(BlockDropItemEvent.class, Player.class, new Getter<Player, BlockDropItemEvent>() {
@Override
public @Nullable Player get(BlockDropItemEvent event) {
public Player get(BlockDropItemEvent event) {
return event.getPlayer();
}
}, EventValues.TIME_NOW);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/events/EvtBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ else if (o instanceof BlockData && finalBlockData != null)
}

@Override
public @NotNull String toString(@Nullable Event event, boolean debug) {
public String toString(@Nullable Event event, boolean debug) {
return "break/place/burn/fade/form/drop of " + Classes.toString(types);
}

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/ch/njol/skript/expressions/ExprDrops.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
}

@Override
protected @Nullable ItemType[] get(Event event) {
protected ItemType @Nullable [] get(Event event) {
if (event instanceof EntityDeathEvent entityDeathEvent) {
return entityDeathEvent.getDrops()
.stream()
Expand All @@ -85,6 +85,7 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
.map(ItemType::new)
.toArray(ItemType[]::new);
}
assert false;
return new ItemType[0];
}

Expand All @@ -97,7 +98,6 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
switch (mode) {
case ADD:
case REMOVE:
case REMOVE_ALL:
case SET:
return CollectionUtils.array(ItemType[].class, Inventory[].class, Experience[].class);
case DELETE: // handled by EffClearDrops
Expand All @@ -109,7 +109,6 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye

@Override
public void change(Event event, Object @Nullable [] delta, ChangeMode mode) {

List<ItemStack> drops = null;
int originalExperience = 0;
if (event instanceof EntityDeathEvent entityDeathEvent) {
Expand Down

0 comments on commit 365afa8

Please sign in to comment.