mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Deobfuscate blocks when gold panning (#3921)
Co-authored-by: Jeroen <j.teriele1@students.uu.nl>
This commit is contained in:
parent
fe99cbd451
commit
ede45dd379
@ -2,6 +2,7 @@ package io.github.thebusybiscuit.slimefun4.integrations;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -14,8 +15,10 @@ import org.bukkit.event.Listener;
|
|||||||
|
|
||||||
import io.github.thebusybiscuit.slimefun4.api.events.BlockPlacerPlaceEvent;
|
import io.github.thebusybiscuit.slimefun4.api.events.BlockPlacerPlaceEvent;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.events.ExplosiveToolBreakBlocksEvent;
|
import io.github.thebusybiscuit.slimefun4.api.events.ExplosiveToolBreakBlocksEvent;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.events.ReactorExplodeEvent;
|
import io.github.thebusybiscuit.slimefun4.api.events.ReactorExplodeEvent;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GoldPan;
|
||||||
|
|
||||||
import net.imprex.orebfuscator.api.OrebfuscatorService;
|
import net.imprex.orebfuscator.api.OrebfuscatorService;
|
||||||
|
|
||||||
@ -61,4 +64,11 @@ class OrebfuscatorIntegration implements Listener {
|
|||||||
public void onReactorExplode(ReactorExplodeEvent event) {
|
public void onReactorExplode(ReactorExplodeEvent event) {
|
||||||
this.service.deobfuscate(Arrays.asList(event.getLocation().getBlock()));
|
this.service.deobfuscate(Arrays.asList(event.getLocation().getBlock()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onGoldPanUse(PlayerRightClickEvent event) {
|
||||||
|
if (event.getSlimefunItem().isPresent() && event.getClickedBlock().isPresent() && event.getSlimefunItem().get() instanceof GoldPan) {
|
||||||
|
this.service.deobfuscate(List.of(event.getClickedBlock().get()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user