-
Notifications
You must be signed in to change notification settings - Fork 10
Add talismans #366
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
Merged
Merged
Add talismans #366
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
e4d017e
migrate health talisman to inventory ticker
OhmV-IR 034df8e
try fix bug
OhmV-IR 4a8abdf
actually fix
OhmV-IR 27c763f
use weak to not leak mem
OhmV-IR 4aab043
generify talisman code
OhmV-IR 63ddf2c
fix name scheme of methods
OhmV-IR bbb0283
add hunger talisman
OhmV-IR 961ae83
hunger talisman
OhmV-IR 1d9d964
pr comments
OhmV-IR f9e0881
adapt to changes in inv ticker
OhmV-IR f69cbb4
Merge branch 'master' into generify-talisman-code
OhmV-IR 92b5c8f
Merge branch 'generify-talisman-code' into add-talismans
OhmV-IR 0caa2cd
add research
OhmV-IR 707295a
fix compile
OhmV-IR 695e496
surely this time
OhmV-IR 9a95fdd
make talisman tick interval configurable
OhmV-IR 0caaa8f
stop using weak hash map where it's not needed
OhmV-IR deb19b0
stop using weak hash map where it's not needed
OhmV-IR daade82
farmer talisman
OhmV-IR a714c50
bartering talisman (not tested)
OhmV-IR ecc1425
water breathing talisman (also not tested yet)
OhmV-IR 7720c6d
fix bug and balance water breathing talisman
OhmV-IR 4cb746d
fixup bartering talisman
OhmV-IR 75cf366
add luck talisman
OhmV-IR 2f08666
generify attribute talismans
OhmV-IR 71e39be
breeding talisman add
OhmV-IR 792c09a
Merge branch 'master' into generify-talisman-code
OhmV-IR 73e481f
Merge branch 'generify-talisman-code' into add-talismans
OhmV-IR 76bea7e
cleanup
OhmV-IR 1863a08
jdoc
OhmV-IR acd0edd
Merge branch 'generify-talisman-code' into add-talismans
OhmV-IR 5ad6d82
enchanting talisman
OhmV-IR c3088e2
whoopsie
OhmV-IR 595e62f
fix placeholders
OhmV-IR e93ab46
mv decimal place
OhmV-IR 63b8c14
Merge branch 'master' into generify-talisman-code
OhmV-IR 9286712
Merge branch 'generify-talisman-code' into add-talismans
OhmV-IR 53838d8
hunting talisman
OhmV-IR e67b0c5
finish farmer talisman
OhmV-IR b975bd6
adjust langfiles and names
OhmV-IR 3c6f7e7
thy recipes
OhmV-IR fb475b5
mv talisman class to talismans/base
OhmV-IR e799ac9
refactorrrr
OhmV-IR 634d1af
some pr comments
OhmV-IR a352843
Update src/main/resources/lang/en.yml
OhmV-IR 3005045
camelcase pdc talisman
OhmV-IR 9c2e1b7
Update src/main/java/io/github/pylonmc/pylon/base/content/talismans/E…
OhmV-IR 0cfda02
Merge branch 'add-talismans' of https://github.com/pylonmc/pylon-base…
OhmV-IR 35d7f1b
fix seggan's bad code smh
OhmV-IR 96420f2
add category and change material types
OhmV-IR 5c1605b
add <white> tag to water breathing talismans
OhmV-IR 75d91ff
same material for all health talismans
OhmV-IR db57307
balancing and langfile fixes
OhmV-IR 7b5e0fe
avoid percent floating point error in lore
OhmV-IR 1569dfa
Merge branch 'master' into add-talismans
OhmV-IR 751326d
omg im dumb
OhmV-IR 7d89daa
fix build
OhmV-IR da47d9f
Merge branch 'master' into add-talismans
OhmV-IR df78289
fix enchanting talisman
OhmV-IR 84a1716
fix hunger talisman and mega nerf it
OhmV-IR 14fcdf4
new NamespacedKey(PylonBase.getInstance() -> BaseUtils.baseKey()
OhmV-IR a5b3601
hunger talisman clay ball -> gapple
OhmV-IR c826a88
talismans after combat in guide
OhmV-IR 4571769
more comments on etable class
OhmV-IR 1af1830
langfile changes
OhmV-IR 22a9f32
change luck talisman text
OhmV-IR ae68f8b
add langfile key for talisman guide page
OhmV-IR 0d87cf7
yeet pdc talisman class
OhmV-IR b1fe579
write a comment for the talisman tick interval config
OhmV-IR 9270f29
reword breeding talisman
OhmV-IR 7e02fff
use success rate conv
OhmV-IR 1e9c868
white names for enchanting talismans
OhmV-IR 2e1b5b9
white names for hunting talismans(i swear im not racist)
OhmV-IR b469f47
works when inventory line b4 attrs
OhmV-IR a0dd7e6
Merge branch 'master' into add-talismans
LordIdra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/io/github/pylonmc/pylon/base/content/talismans/AttributeTalisman.java
OhmV-IR marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package io.github.pylonmc.pylon.base.content.talismans; | ||
|
|
||
| import com.google.common.base.Preconditions; | ||
| import io.github.pylonmc.pylon.core.config.adapter.ConfigAdapter; | ||
| import org.bukkit.attribute.Attribute; | ||
| import org.bukkit.attribute.AttributeInstance; | ||
| import org.bukkit.attribute.AttributeModifier; | ||
| import org.bukkit.entity.Player; | ||
| import org.bukkit.inventory.ItemStack; | ||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| public abstract class AttributeTalisman extends Talisman { | ||
| public final double attrBonus = getSettings().getOrThrow("attr-bonus", ConfigAdapter.DOUBLE); | ||
| private final AttributeModifier modifier = new AttributeModifier( | ||
| getTalismanKey(), | ||
| attrBonus, | ||
| AttributeModifier.Operation.ADD_NUMBER | ||
| ); | ||
|
|
||
| public AttributeTalisman(@NotNull ItemStack stack) { | ||
| super(stack); | ||
| } | ||
|
|
||
| @Override | ||
| public void applyEffect(@NotNull Player player) { | ||
| super.applyEffect(player); | ||
| AttributeInstance attr = player.getAttribute(getAttribute()); | ||
| Preconditions.checkNotNull(attr); | ||
| attr.addModifier(modifier); | ||
| } | ||
|
|
||
| @Override | ||
| public void removeEffect(@NotNull Player player) { | ||
| super.removeEffect(player); | ||
| AttributeInstance attr = player.getAttribute(getAttribute()); | ||
| Preconditions.checkNotNull(attr); | ||
| attr.removeModifier(getTalismanKey()); | ||
| } | ||
|
|
||
| protected abstract Attribute getAttribute(); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.