Skip to content

Commit

Permalink
Merge pull request #458 from VolmitSoftware/Development
Browse files Browse the repository at this point in the history
Fixed things!
  • Loading branch information
NextdoorPsycho authored Jul 29, 2023
2 parents 7375530 + 97266c5 commit fd10b5c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 47 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {
id "de.undercouch.download" version "5.0.1"
}

version '1.12.2-1.20.1'
version '1.12.3-1.20.1'
def nmsVersion = "1.20.1" //[NMS]
def apiVersion = '1.20'
def specialSourceVersion = '1.11.0' //[NMS]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ default void openGui(Player player) {
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
Window w = new UIWindow(player);
w.setTag("skill/" + getSkill().getName() + "/" + getName());
w.setDecorator((window, position, row) -> new UIElement("bg").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
w.setDecorator((window, position, row) -> new UIElement("bg").setName(" ").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
w.setResolution(WindowResolution.W9_H6);
int o = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/volmit/adapt/api/skill/Skill.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ default void openGui(Player player) {
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 1.855f);
Window w = new UIWindow(player);
w.setTag("skill/" + getName());
w.setDecorator((window, position, row) -> new UIElement("bg").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
w.setDecorator((window, position, row) -> new UIElement("bg").setName(" ").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));

int ind = 0;

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/volmit/adapt/api/skill/SkillRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
import com.volmit.adapt.util.C;
import com.volmit.adapt.util.Form;
import com.volmit.adapt.util.M;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.*;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -88,6 +85,10 @@ public void on(PlayerExpChangeEvent e) {
}
}

private boolean canInteract(Player player, Location targetLocation) {
return Adapt.instance.getProtectorRegistry().getAllProtectors().stream().allMatch(protector -> protector.canInteract(player, targetLocation, null));
}

@EventHandler(priority = EventPriority.MONITOR)
public void on(PlayerInteractEvent e) {
Player p = e.getPlayer();
Expand All @@ -97,6 +98,7 @@ public void on(PlayerInteractEvent e) {
boolean isObserver = commonConditions && e.getClickedBlock().getType().equals(Material.OBSERVER);
boolean isAdaptActivator = !e.getBlockFace().equals(BlockFace.UP) && !e.getBlockFace().equals(BlockFace.DOWN) && !p.isSneaking() && e.getAction().equals(Action.RIGHT_CLICK_BLOCK)
&& e.getClickedBlock() != null
&& canInteract(p, e.getClickedBlock().getLocation())
&& e.getClickedBlock().getType().equals(Material.valueOf(AdaptConfig.get().adaptActivatorBlock)) && (p.getInventory().getItemInMainHand().getType().equals(Material.AIR)
|| !p.getInventory().getItemInMainHand().getType().isBlock()) &&
(p.getInventory().getItemInOffHand().getType().equals(Material.AIR) || !p.getInventory().getItemInOffHand().getType().isBlock());
Expand Down
40 changes: 0 additions & 40 deletions src/main/java/com/volmit/adapt/content/gui/CorruptionGui.java

This file was deleted.

0 comments on commit fd10b5c

Please sign in to comment.