-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pull config values into a data class
- Loading branch information
Showing
14 changed files
with
164 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
20 changes: 20 additions & 0 deletions
20
Common/src/main/java/dev/cammiescorner/icarus/api/IcarusPlayerValues.java
This file contains 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,20 @@ | ||
package dev.cammiescorner.icarus.api; | ||
|
||
public interface IcarusPlayerValues { | ||
|
||
float wingsSpeed(); | ||
|
||
float maxSlowedMultiplier(); | ||
|
||
boolean armorSlows(); | ||
|
||
boolean canLoopDeLoop(); | ||
|
||
boolean canSlowFall(); | ||
|
||
float exhaustionAmount(); | ||
|
||
int maxHeightAboveWorld(); | ||
|
||
boolean maxHeightEnabled(); | ||
} |
This file contains 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
39 changes: 39 additions & 0 deletions
39
Common/src/main/java/dev/cammiescorner/icarus/client/ClientPlayerFallbackValues.java
This file contains 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,39 @@ | ||
package dev.cammiescorner.icarus.client; | ||
|
||
import dev.cammiescorner.icarus.api.IcarusPlayerValues; | ||
import dev.cammiescorner.icarus.util.ServerPlayerFallbackValues; | ||
|
||
public class ClientPlayerFallbackValues extends ServerPlayerFallbackValues implements IcarusPlayerValues { | ||
|
||
private final float wingsSpeed; | ||
private final boolean armorSlows; | ||
private final float maxSlowedMultiplier; | ||
private final boolean canLoopDeLoop; | ||
|
||
public ClientPlayerFallbackValues(float wingsSpeed, float maxSlowedMultiplier, boolean armorSlows, boolean canLoopDeLoop) { | ||
this.wingsSpeed = wingsSpeed; | ||
this.armorSlows = armorSlows; | ||
this.maxSlowedMultiplier = maxSlowedMultiplier; | ||
this.canLoopDeLoop = canLoopDeLoop; | ||
} | ||
|
||
@Override | ||
public float wingsSpeed() { | ||
return wingsSpeed; | ||
} | ||
|
||
@Override | ||
public float maxSlowedMultiplier() { | ||
return maxSlowedMultiplier; | ||
} | ||
|
||
@Override | ||
public boolean armorSlows() { | ||
return armorSlows; | ||
} | ||
|
||
@Override | ||
public boolean canLoopDeLoop() { | ||
return canLoopDeLoop; | ||
} | ||
} |
This file contains 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 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 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 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 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 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
47 changes: 47 additions & 0 deletions
47
Common/src/main/java/dev/cammiescorner/icarus/util/ServerPlayerFallbackValues.java
This file contains 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,47 @@ | ||
package dev.cammiescorner.icarus.util; | ||
|
||
import dev.cammiescorner.icarus.IcarusConfig; | ||
import dev.cammiescorner.icarus.api.IcarusPlayerValues; | ||
|
||
public class ServerPlayerFallbackValues implements IcarusPlayerValues { | ||
|
||
@Override | ||
public float wingsSpeed() { | ||
return IcarusConfig.wingsSpeed; | ||
} | ||
|
||
@Override | ||
public float maxSlowedMultiplier() { | ||
return IcarusConfig.maxSlowedMultiplier; | ||
} | ||
|
||
@Override | ||
public boolean armorSlows() { | ||
return IcarusConfig.armorSlows; | ||
} | ||
|
||
@Override | ||
public boolean canLoopDeLoop() { | ||
return IcarusConfig.canLoopDeLoop; | ||
} | ||
|
||
@Override | ||
public boolean canSlowFall() { | ||
return IcarusConfig.canSlowFall; | ||
} | ||
|
||
@Override | ||
public float exhaustionAmount() { | ||
return IcarusConfig.exhaustionAmount; | ||
} | ||
|
||
@Override | ||
public boolean maxHeightEnabled() { | ||
return IcarusConfig.maxHeightEnabled; | ||
} | ||
|
||
@Override | ||
public int maxHeightAboveWorld() { | ||
return IcarusConfig.maxHeightAboveWorld; | ||
} | ||
} |
This file contains 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 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 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