-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Acidblock improvements #606
Conversation
New messages in chat and cti for when acids are going to fail with new checks for all faces of acid block. Multifaced acidblocks now choose the weakest reinforcement being acided to base its timer on.
plugins/citadel-paper/src/main/java/vg/civcraft/mc/citadel/CitadelUtility.java
Show resolved
Hide resolved
plugins/citadel-paper/src/main/java/vg/civcraft/mc/citadel/command/Acid.java
Outdated
Show resolved
Hide resolved
plugins/citadel-paper/src/main/java/vg/civcraft/mc/citadel/command/ReinforcementsGUI.java
Outdated
Show resolved
Hide resolved
@@ -92,4 +108,21 @@ private List<IClickable> getClicks(List<ReinforcementType> types, boolean allowe | |||
|
|||
return clickables; | |||
} | |||
|
|||
private List<IClickable> getAcidTypeClicks(List<AcidType> acidTypes) { | |||
List<IClickable> clickables = new LinkedList<>(); |
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.
use an ArrayList by default, unless you know you benefit from linked lists specifically (unlikely)
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.
tbh I just tried to make it as similar to the already existing getClicks code as possible, the previous one used linked lists so ¯_(ツ)_/¯
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.
awoos passionate hatred for linkedlists can be seen in praxis civ-dev
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 agree with awoo, you can even pre-size it with new ArrayList<>(acidTypes.length())
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 killed the linkedlist
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.
(dumb github ui)
plugins/citadel-paper/src/main/java/vg/civcraft/mc/citadel/command/Acid.java
Outdated
Show resolved
Hide resolved
plugins/citadel-paper/src/main/java/vg/civcraft/mc/citadel/model/AcidManager.java
Outdated
Show resolved
Hide resolved
all the changes listed above seem to be working fine now, but somebody testing it themselves would be appreciated |
} | ||
if ( | ||
targetBlockRein != null | ||
&& !MaterialUtils.isAir(relativeBlock.getType()) |
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.
ahhh
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.
Looks good overall, but a few small changes would be nice
plugins/citadel-paper/src/main/java/vg/civcraft/mc/citadel/CitadelUtility.java
Show resolved
Hide resolved
@@ -92,4 +108,21 @@ private List<IClickable> getClicks(List<ReinforcementType> types, boolean allowe | |||
|
|||
return clickables; | |||
} | |||
|
|||
private List<IClickable> getAcidTypeClicks(List<AcidType> acidTypes) { | |||
List<IClickable> clickables = new LinkedList<>(); |
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 agree with awoo, you can even pre-size it with new ArrayList<>(acidTypes.length())
Was this ready? |
if ( | ||
relativeReinforcement == null | ||
|| !relativeReinforcement.getType().canBeReinforced(relativeBlock.getType()) | ||
|| acidMan.isPossibleAcidBlock(relativeBlock) |
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.
Shouldn't acid blocks be able to affect other acid blocks now? This condition should be consistent with /cti
closing as abandoned |
Addresses #492