Skip to content

Commit

Permalink
Merge pull request #9 from AzisabaNetwork/Sirnk0413
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style authored Jul 20, 2024
2 parents 1f7685e + bcc7fd0 commit 8738cb4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "net.azisaba"
version = "6.13.0"
version = "6.14.0"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/github/mori01231/lifecore/LifeCore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class LifeCore : JavaPlugin() {
// Items
pm.registerEvents(OreOnlyItemListener(), this)
pm.registerEvents(GlassHammerItemListener(), this)
pm.registerEvents(FlashLightListener(), this)
pm.registerEvents(LavaSpongeItemListener(), this)
if (config.getBoolean("destroy-experience-orb-on-chunk-load", false)) {
pm.registerEvents(DestroyExperienceOrbListener(), this)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.github.mori01231.lifecore.listener.item;

import com.github.mori01231.lifecore.util.ItemUtil;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import java.util.Objects;

public class FlashLightListener implements Listener {
@EventHandler
public void onInteract(PlayerInteractEvent e){
if((e.getAction() == Action.RIGHT_CLICK_BLOCK || e.getAction() == Action.RIGHT_CLICK_AIR)) {
if (Objects.equals(ItemUtil.getMythicType(e.getPlayer().getInventory().getItemInOffHand()), "flashlight")) {
e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 18000, 0));
}
}
}
}

0 comments on commit 8738cb4

Please sign in to comment.