-
Notifications
You must be signed in to change notification settings - Fork 104
Changed GaslightingTracker
to be instanced, not static
#701
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
Draft
kineticneticat
wants to merge
4
commits into
FallingColors:main
Choose a base branch
from
kineticneticat:instanced-gaslighting-again
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e2cd006
Changed `GaslightingTracker` to be instanced, not static
kineticneticat a89d45b
Changed `GaslightingTracker` to be instanced, not static
kineticneticat 2416abe
Merge remote-tracking branch 'origin/instanced-gaslighting-again' int…
kineticneticat 40fdc23
Merge branch 'main' into instanced-gaslighting-again
kineticneticat 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
36 changes: 36 additions & 0 deletions
36
Common/src/main/java/at/petrak/hexcasting/api/client/GaslightingTracker.java
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,36 @@ | ||
package at.petrak.hexcasting.api.client; | ||
|
||
import net.minecraft.resources.ResourceLocation; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
// *nothing* that changes can be looked at for changes | ||
public class GaslightingTracker { | ||
public static Map<ResourceLocation, GaslightingTracker> GASLIGHTING_TRACKERS = new LinkedHashMap<>(); | ||
private int GASLIGHTING_AMOUNT = 0; | ||
private final int LOOKING_COOLDOWN_MAX; | ||
private int LOOKING_COOLDOWN; | ||
|
||
public ResourceLocation GASLIGHTING_PRED; | ||
|
||
public GaslightingTracker(ResourceLocation resLoc, int maxCooldown) { | ||
this.GASLIGHTING_PRED = resLoc; | ||
this.LOOKING_COOLDOWN_MAX = maxCooldown; | ||
this.LOOKING_COOLDOWN = LOOKING_COOLDOWN_MAX; | ||
GaslightingTracker.GASLIGHTING_TRACKERS.put(this.GASLIGHTING_PRED, this); | ||
} | ||
|
||
public int getGaslightingAmount() { | ||
LOOKING_COOLDOWN = LOOKING_COOLDOWN_MAX; | ||
return GASLIGHTING_AMOUNT; | ||
} | ||
|
||
public void postFrameCheckRendered() { | ||
if (LOOKING_COOLDOWN > 0) { | ||
LOOKING_COOLDOWN -= 1; | ||
} else { | ||
GASLIGHTING_AMOUNT += 1; | ||
} | ||
} | ||
} |
kineticneticat 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
kineticneticat 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
27 changes: 0 additions & 27 deletions
27
Common/src/main/java/at/petrak/hexcasting/client/render/GaslightingTracker.java
This file was deleted.
Oops, something went wrong.
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
12 changes: 12 additions & 0 deletions
12
Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexGaslighting.java
kineticneticat 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,12 @@ | ||
package at.petrak.hexcasting.common.lib.hex; | ||
|
||
import at.petrak.hexcasting.api.client.GaslightingTracker; | ||
|
||
import static at.petrak.hexcasting.api.HexAPI.modLoc; | ||
|
||
public class HexGaslighting { | ||
public static void init() {} | ||
|
||
public static GaslightingTracker QUENCHED_ALLAY_GASLIGHTING = new GaslightingTracker(modLoc("quenched_allay_variants"), 40); | ||
|
||
} |
kineticneticat 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
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
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.