Skip to content

Commit

Permalink
Bug fixes alpha-1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jachou-yt committed Oct 10, 2023
1 parent 86283ae commit a48074b
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Qodana
on:
workflow_dispatch:
pull_request:
push:
branches:
- master

jobs:
qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2023.2
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
31 changes: 31 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"

#Specify inspection profile for code analysis
profile:
name: qodana.starter

#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>

#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>

projectJDK: 17 #(Applied in CI/CD pipeline)

#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh

#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)

#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
linter: jetbrains/qodana-jvm:latest
4 changes: 3 additions & 1 deletion src/main/java/fr/jachou/reanimatemc/ReanimateMC.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import org.bstats.bukkit.Metrics;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public final class ReanimateMC extends JavaPlugin {

private static ReanimateMC instance;
Expand Down Expand Up @@ -62,7 +64,7 @@ private void registerEvents(Plugin plugin) {
}

private void registerCommands(Plugin plugin) {
getCommand("reanimate").setExecutor(new ReanimateCommand());
Objects.requireNonNull(getCommand("reanimate")).setExecutor(new ReanimateCommand());
}

private void registerRunnable(BukkitRunnable runnable) {
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/fr/jachou/reanimatemc/events/PlayerEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

public class PlayerEvents implements Listener {


private Map<Player, BukkitTask> reanimateTaks = new HashMap<>();
private final Map<Player, BukkitTask> reanimateTaks = new HashMap<>();
private static PlayerEvents instance;


Expand Down Expand Up @@ -94,12 +93,14 @@ public void playerMove(PlayerMoveEvent event) {
}

private boolean canReanimate(Player clicker, Player target) {
// Mettez en œuvre votre propre logique pour déterminer si le joueur peut réanimer ou non
// Par exemple, vérifiez si le joueur a un objet spécial pour réanimer, s'il est dans une certaine équipe, etc.
return true; // À titre d'exemple, nous supposons que le joueur peut réanimer
return true;
}

public static PlayerEvents getInstance() {
return instance;
}

public Map<Player, BukkitTask> getReanimateTaks() {
return reanimateTaks;
}
}

0 comments on commit a48074b

Please sign in to comment.