Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

Commit

Permalink
Fix sneaking while right clicking a 'blocked material' not firing Arm…
Browse files Browse the repository at this point in the history
…orEquipEvent

Don't know if every blocked material behaves like this but its definitely how a majority work.
  • Loading branch information
Arnuh committed Dec 9, 2019
1 parent b9d0835 commit 47559c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/com/codingforcookies/armorequip/ArmorListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public final void inventoryClick(final InventoryClickEvent e){
public void playerInteractEvent(PlayerInteractEvent e){
if(e.getAction() == Action.PHYSICAL) return;
if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK){
final Player player = e.getPlayer();
if(e.getClickedBlock() != null && e.getAction() == Action.RIGHT_CLICK_BLOCK){// Having both of these checks is useless, might as well do it though.
Player player = e.getPlayer();
if(e.getClickedBlock() != null && e.getAction() == Action.RIGHT_CLICK_BLOCK && !player.isSneaking()){// Having both of these checks is useless, might as well do it though.
// Some blocks have actions when you right click them which stops the client from equipping the armor in hand.
Material mat = e.getClickedBlock().getType();
for(String s : blockedMaterials){
Expand Down

0 comments on commit 47559c4

Please sign in to comment.