Skip to content

Commit fd10b5c

Browse files
Merge pull request #458 from VolmitSoftware/Development
Fixed things!
2 parents 7375530 + 97266c5 commit fd10b5c

File tree

5 files changed

+9
-47
lines changed

5 files changed

+9
-47
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
id "de.undercouch.download" version "5.0.1"
2424
}
2525

26-
version '1.12.2-1.20.1'
26+
version '1.12.3-1.20.1'
2727
def nmsVersion = "1.20.1" //[NMS]
2828
def apiVersion = '1.20'
2929
def specialSourceVersion = '1.11.0' //[NMS]

src/main/java/com/volmit/adapt/api/adaptation/Adaptation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ default void openGui(Player player) {
389389
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
390390
Window w = new UIWindow(player);
391391
w.setTag("skill/" + getSkill().getName() + "/" + getName());
392-
w.setDecorator((window, position, row) -> new UIElement("bg").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
392+
w.setDecorator((window, position, row) -> new UIElement("bg").setName(" ").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
393393
w.setResolution(WindowResolution.W9_H6);
394394
int o = 0;
395395

src/main/java/com/volmit/adapt/api/skill/Skill.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ default void openGui(Player player) {
207207
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 1.855f);
208208
Window w = new UIWindow(player);
209209
w.setTag("skill/" + getName());
210-
w.setDecorator((window, position, row) -> new UIElement("bg").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
210+
w.setDecorator((window, position, row) -> new UIElement("bg").setName(" ").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
211211

212212
int ind = 0;
213213

src/main/java/com/volmit/adapt/api/skill/SkillRegistry.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
import com.volmit.adapt.util.C;
3232
import com.volmit.adapt.util.Form;
3333
import com.volmit.adapt.util.M;
34-
import org.bukkit.Bukkit;
35-
import org.bukkit.Material;
36-
import org.bukkit.Particle;
37-
import org.bukkit.Sound;
34+
import org.bukkit.*;
3835
import org.bukkit.block.BlockFace;
3936
import org.bukkit.entity.Player;
4037
import org.bukkit.event.EventHandler;
@@ -88,6 +85,10 @@ public void on(PlayerExpChangeEvent e) {
8885
}
8986
}
9087

88+
private boolean canInteract(Player player, Location targetLocation) {
89+
return Adapt.instance.getProtectorRegistry().getAllProtectors().stream().allMatch(protector -> protector.canInteract(player, targetLocation, null));
90+
}
91+
9192
@EventHandler(priority = EventPriority.MONITOR)
9293
public void on(PlayerInteractEvent e) {
9394
Player p = e.getPlayer();
@@ -97,6 +98,7 @@ public void on(PlayerInteractEvent e) {
9798
boolean isObserver = commonConditions && e.getClickedBlock().getType().equals(Material.OBSERVER);
9899
boolean isAdaptActivator = !e.getBlockFace().equals(BlockFace.UP) && !e.getBlockFace().equals(BlockFace.DOWN) && !p.isSneaking() && e.getAction().equals(Action.RIGHT_CLICK_BLOCK)
99100
&& e.getClickedBlock() != null
101+
&& canInteract(p, e.getClickedBlock().getLocation())
100102
&& e.getClickedBlock().getType().equals(Material.valueOf(AdaptConfig.get().adaptActivatorBlock)) && (p.getInventory().getItemInMainHand().getType().equals(Material.AIR)
101103
|| !p.getInventory().getItemInMainHand().getType().isBlock()) &&
102104
(p.getInventory().getItemInOffHand().getType().equals(Material.AIR) || !p.getInventory().getItemInOffHand().getType().isBlock());

src/main/java/com/volmit/adapt/content/gui/CorruptionGui.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)