-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #317 from rockyhawk64/1.8.8_TO_1.20.4
3.21.2.1
- Loading branch information
Showing
8 changed files
with
142 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/me/rockyhawk/commandpanels/playerinventoryhandler/pickupevent/EntityPickupEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package me.rockyhawk.commandpanels.playerinventoryhandler.pickupevent; | ||
|
||
import me.rockyhawk.commandpanels.CommandPanels; | ||
import me.rockyhawk.commandpanels.openpanelsmanager.PanelPosition; | ||
import org.bukkit.entity.HumanEntity; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.entity.EntityPickupItemEvent; | ||
|
||
public class EntityPickupEvent implements Listener { | ||
|
||
CommandPanels plugin; | ||
public EntityPickupEvent(CommandPanels pl) { | ||
this.plugin = pl; | ||
} | ||
@EventHandler | ||
public void onPickup(EntityPickupItemEvent e){ | ||
if(e.getEntity() instanceof HumanEntity) { | ||
Player p = (Player)e.getEntity(); | ||
//move the item into the players inventory instead of the panel | ||
if (plugin.openPanels.hasPanelOpen(p.getName(), PanelPosition.Middle) || plugin.openPanels.hasPanelOpen(p.getName(), PanelPosition.Bottom)) { | ||
plugin.inventorySaver.addItem(p,e.getItem().getItemStack()); | ||
e.getItem().remove(); | ||
e.setCancelled(true); | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/me/rockyhawk/commandpanels/playerinventoryhandler/pickupevent/legacyPlayerEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package me.rockyhawk.commandpanels.playerinventoryhandler.pickupevent; | ||
|
||
import me.rockyhawk.commandpanels.CommandPanels; | ||
import me.rockyhawk.commandpanels.openpanelsmanager.PanelPosition; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerPickupItemEvent; | ||
|
||
public class legacyPlayerEvent implements Listener { | ||
|
||
CommandPanels plugin; | ||
public legacyPlayerEvent(CommandPanels pl) { | ||
this.plugin = pl; | ||
} | ||
|
||
@EventHandler | ||
public void onPickup(PlayerPickupItemEvent e){ | ||
Player p = e.getPlayer(); | ||
//move the item into the players inventory instead of the panel | ||
if (plugin.openPanels.hasPanelOpen(p.getName(), PanelPosition.Middle) || plugin.openPanels.hasPanelOpen(p.getName(), PanelPosition.Bottom)) { | ||
plugin.inventorySaver.addItem(p,e.getItem().getItemStack()); | ||
e.getItem().remove(); | ||
e.setCancelled(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters