-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
|
||
@EventHandler | ||
@SuppressWarnings("ConstantConditions") | ||
public void onGlassCut(PlayerInteractEvent e) { |
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 don't you just use the ItemUseHandler
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.
Is there an advantage to using an item handler than an event except neatness
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.
it saves code and not having to run the same shit twice for no reason
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.
It seems there no left click interact event, only right click
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.
right click has slower interaction speed, so no fun
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.
Still maintain this should be in w handler. Right click makes more sense to begin with and it saves doing isItem
Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
We follow Google Code Style by the way so please do follow that. Especially regarding formatting and line-length. |
Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
Make it an electric tool im not sure if i want normal tools in lx |
Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
do you have a vid? |
https://streamable.com/xut2ih actually found a bug while doing this ill update in a bit |
…ass. Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
Also do u think i should make it glowy |
You can break like 85 glass with one charge there. That's quite a lot. |
Yes you can break 600 glass with 1 charge... breaking 1 stack kinda small |
Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
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.
does it cancel shearing of leaves and cobwebs etc etc?
No need to cancel? Its a ghast tear not a shear |
My bad |
Signed-off-by: FluffyBear <unconfigured@null.spigotmc.org>
Signed-off-by: NCBPFluffyBear <31554056+ncbpfluffybear@users.noreply.github.com>
Signed-off-by: NCBPFluffyBear <31554056+ncbpfluffybear@users.noreply.github.com>
|
||
@EventHandler | ||
@SuppressWarnings("ConstantConditions") | ||
public void onGlassCut(PlayerInteractEvent e) { |
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.
Still maintain this should be in w handler. Right click makes more sense to begin with and it saves doing isItem
The problem is that right click interaction is slower than left click.. maybe 5x or more |
You could hold right click and run along a line of glass, it'd get them all. I don't see why you'd have an issue with that |
Its very slow. Right clicking has a set delay no matter if you hold it or not, left click triggers as soon as you are looking at a new block face. If you want, I can make a video showing the speed difference. I saved the right click version I made a while ago |
Actually, the wrench accepts both left and right click. Ill demonstrate using that. https://streamable.com/gtzgi2 |
I could also have i accept both left and right clicks so that players can break glass slowly or quickly, thats part of the reason why that exists for the wrench |
Make sure to check for sf machines that are glass that those doesnt get broken |
Already does |
Signed-off-by: NCBPFluffyBear <31554056+ncbpfluffybear@users.noreply.github.com>
Tested and recorded it working too |
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.
Gonna merge today, just small changes.
@EventHandler | ||
@SuppressWarnings("ConstantConditions") | ||
public void onGlassCut(PlayerInteractEvent e) { | ||
Block block = e.getClickedBlock(); |
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.
Final
Block block = e.getClickedBlock(); | ||
if (e.getAction() == Action.LEFT_CLICK_BLOCK && isItem(e.getItem()) | ||
&& SlimefunPlugin.getProtectionManager().hasPermission(e.getPlayer(), | ||
block.getLocation(), ProtectableAction.BREAK_BLOCK)) { |
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.
Closing bracket and brace on new line
block.getLocation(), ProtectableAction.BREAK_BLOCK)) { | ||
e.setCancelled(true); | ||
|
||
SlimefunItem slimefunItem = BlockStorage.check(e.getClickedBlock()); |
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.
Final
|
||
if ((block.getType() == Material.GLASS | ||
|| block.getType().name().endsWith("_GLASS") | ||
|| block.getType().name().endsWith("_PANE")) |
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.
Should really be _GLASS_PANE
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.
Wont work with clear glass pane @J3fftw1
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.
Already fixed it
Short Description
Added glass cutter, an item that instantly breaks glass.
Additions/Changes/Removals
Registered and added GLASS_CUTTER
Related Issues
N?A
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values