Skip to content

Add PreparedGrindstoneEvent#3578

Closed
JanTuck wants to merge 0 commit into
PaperMC:masterfrom
JanTuck:master
Closed

Add PreparedGrindstoneEvent#3578
JanTuck wants to merge 0 commit into
PaperMC:masterfrom
JanTuck:master

Conversation

@JanTuck
Copy link
Copy Markdown
Contributor

@JanTuck JanTuck commented Jun 19, 2020

First pull request, hopefully it doesn't suck ass.

Copy link
Copy Markdown
Contributor

@Proximyst Proximyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All but these two rather minor things look great

+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+// Paper end
+
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace 😠

+ event.setResult(CraftItemStack.asBukkitCopy(ItemStack.a)); // Paper - Get result
}

+ Bukkit.getPluginManager().callEvent(event); // Paper Event Call
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix.

boolean flag2 = !itemstack.isEmpty() && itemstack.getItem() != Items.ENCHANTED_BOOK && !itemstack.hasEnchantments() || !itemstack1.isEmpty() && itemstack1.getItem() != Items.ENCHANTED_BOOK && !itemstack1.hasEnchantments();

if (itemstack.getCount() > 1 || itemstack1.getCount() > 1 || !flag1 && flag2) {
- this.resultInventory.setItem(0, ItemStack.a);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many places like this where the event result is set but the function returns early. I don't think this is firing the event here due to the early return.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that was an oversight on my part

@JanTuck JanTuck closed this Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants