-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fixing Handling of Performers and Cleaning Some Code #342
base: sponge-1.12
Are you sure you want to change the base?
Conversation
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.
While I appreciate some tender loving care being applied to VS, it's a lot of changes that are cluttered from extra noise compared to actually fixing the handling of performers. I do appreciate the effort put in to the PR, just hoping that the feedback will improve the PR from a maintenance perspective.
// new SniperMaterialChangedEvent(this, toolId, new MaterialData(originalVoxel, snipeData.getData()), | ||
// new MaterialData(snipeData.getVoxelId(), snipeData.getData())); | ||
// Bukkit.getPluginManager().callEvent(event); | ||
snipeData.setVoxelState(targetBlock.getBlockType().getDefaultState()); |
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.
If you're really wanting to fix it, wouldn't it be best to use the target block's block state and not the default state of the block type?
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 followed what was already there in the code so if you are holding the arrow it sets it to be the default state and if you are holding gunpowder it takes the whole block state. See line 154.
src/main/java/com/thevoxelbox/voxelsniper/brush/shape/OverlayBrush.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thevoxelbox/voxelsniper/command/VoxelInkReplaceCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thevoxelbox/voxelsniper/util/StencilUpdater.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thevoxelbox/voxelsniper/util/BlockHelper.java
Outdated
Show resolved
Hide resolved
bdedee9
to
6b1a5cd
Compare
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.
Could you rebase this now that your other two PRs have been merged.
src/main/java/com/thevoxelbox/voxelsniper/brush/PerformBrush.java
Outdated
Show resolved
Hide resolved
COMBO, | ||
NONE; | ||
|
||
public String toString() { | ||
switch (this) { |
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.
This should just be a field on the enum.
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.
What do you mean by that? The toString method is already part of the enum class.
81d4a87
to
8e15cbd
Compare
ee6dfcd
to
289ce50
Compare
I rebased my branch onto the new changes, but there was some problem with line endings in PerformBrush.java that ended up making it look like the entire file was changed. |
@Deamon5550 @gabizou ping on this? |
In this pull request, I updated how Voxel Sniper was handling performance modifiers on brushes to properly support the material, ink, and combo performers for both the placing and replacing of blocks. With this change, I updated the vi and vir change to take multiple block traits as arguments and ironed out some of the code in v and vr to better handle BlockStates and be more idiomatic. In addition, I cleaned up some of the naming conventions in SnipeData to be more consistent. The majority of the files affected by this pull request stem from that.