-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added endPortalPick setting #722
Conversation
sh0inx
commented
Aug 5, 2023
- added endPortalPick configuration setting to allow the end portal frames to be picked up and placed again, as they are indestructable blocks (right click with wooden pickaxe, consumes pickaxe)
- restructured PlayerInteractListener to accommodate multiple listening targets
- added endPortalPick configuration setting to allow the end portal frames to be picked up and placed again, as they are indestructable blocks (right click with wooden pickaxe, consumes pickaxe) - restructured PlayerInteractListener to accommodate multiple listening targets
src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java
Outdated
Show resolved
Hide resolved
src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java
Outdated
Show resolved
Hide resolved
src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java
Outdated
Show resolved
Hide resolved
src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java
Outdated
Show resolved
Hide resolved
&& event.getClickedBlock().getType().equals(Material.END_PORTAL_FRAME) | ||
&& itemInHand.getType().equals(Material.WOODEN_PICKAXE)) { | ||
|
||
event.getClickedBlock().setType(Material.AIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you verified if this also breaks the portal if activated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not, I'll test today
event.getClickedBlock().getDrops().add(new ItemStack(Material.END_PORTAL_FRAME)); | ||
event.getClickedBlock().breakNaturally(); | ||
|
||
player.getInventory().addItem(new ItemStack(Material.END_PORTAL_FRAME)).values().forEach(itemStack -> | ||
player.getWorld().dropItem(player.getLocation(), itemStack)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding this to the drops and the player's inventory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding to the drops doesn't do anything, i'll remove that line