-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added extra interfaces, renamed JSON objects, instantiated math
- Loading branch information
1 parent
a92daeb
commit 0cba38a
Showing
14 changed files
with
90 additions
and
22 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
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
6 changes: 0 additions & 6 deletions
6
src/main/kotlin/com/edelweiss/playerex/attributes/json/EntityTypes.kt
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/edelweiss/playerex/attributes/json/EntityTypesJSON.kt
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,6 @@ | ||
package com.edelweiss.playerex.attributes.json | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class EntityTypesJSON(val values: MutableMap<String, MutableMap<String, Double>>) : DataMerger<String, String, Double>(values); |
6 changes: 0 additions & 6 deletions
6
src/main/kotlin/com/edelweiss/playerex/attributes/json/Functions.kt
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/edelweiss/playerex/attributes/json/FunctionsJSON.kt
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,6 @@ | ||
package com.edelweiss.playerex.attributes.json | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class FunctionsJSON(val values: MutableMap<String, MutableMap<String, AttributeFunctionJSON>>) : DataMerger<String, String, AttributeFunctionJSON>(values); |
6 changes: 0 additions & 6 deletions
6
src/main/kotlin/com/edelweiss/playerex/attributes/json/Properties.kt
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/edelweiss/playerex/attributes/json/PropertiesJSON.kt
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,6 @@ | ||
package com.edelweiss.playerex.attributes.json | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class PropertiesJSON(val values: MutableMap<String, MutableMap<String, String>>) : DataMerger<String, String, String>(values) |
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/com/edelweiss/playerex/attributes/overrides/AttributeFunction.kt
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,11 @@ | ||
package com.edelweiss.playerex.attributes.overrides | ||
|
||
import com.edelweiss.skillattributes.enums.FunctionBehavior | ||
|
||
interface AttributeFunction { | ||
/** Behavior associated with this function. */ | ||
fun behavior(): FunctionBehavior | ||
|
||
/** The value provided by the function. */ | ||
fun value(): Double | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/edelweiss/playerex/attributes/overrides/ItemEntityAttributeModifiers.kt
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,14 @@ | ||
package com.edelweiss.playerex.attributes.overrides | ||
|
||
import com.google.common.collect.HashMultimap | ||
import com.google.common.collect.Multimap | ||
import net.minecraft.entity.EquipmentSlot | ||
import net.minecraft.entity.attribute.EntityAttribute | ||
import net.minecraft.entity.attribute.EntityAttributeModifier | ||
import net.minecraft.item.ItemStack | ||
|
||
/** Meant to be implemented in the `Item` class. */ | ||
interface ItemEntityAttributeModifiers { | ||
/** Provides a mutable attribute modifier `MultiMap` so items can have dynamically changing modifiers based on the NBT. */ | ||
fun get(stack: ItemStack, slot: EquipmentSlot): Multimap<EntityAttribute, EntityAttributeModifier> = HashMultimap.create() | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/com/edelweiss/playerex/attributes/overrides/PEXEntityAttribute.kt
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,34 @@ | ||
package com.edelweiss.playerex.attributes.overrides | ||
|
||
import com.edelweiss.skillattributes.enums.StackingFormula | ||
|
||
/** | ||
* An interface meant for `EntityAttribute` to implement in a mixin. | ||
* | ||
* This allows for access provided by the attributes system. | ||
* */ | ||
interface PEXEntityAttribute { | ||
/** The minimum value of the attribute. */ | ||
fun min(): Double | ||
|
||
/** The maximum value of the attribute. */ | ||
fun max(): Double | ||
|
||
/** The attributes' stacking formula. */ | ||
fun formula(): StackingFormula | ||
|
||
/** Immutable map of the parents attached to the attribute. */ | ||
fun parents(): Map<PEXEntityAttribute, AttributeFunction> | ||
|
||
/** Immutable map of the children attached to the attribute. */ | ||
fun children(): Map<PEXEntityAttribute, AttributeFunction> | ||
|
||
/** Immutable collection of the property keys attached to the attribute. */ | ||
fun properties(): Collection<String> | ||
|
||
/** Checks whether this attribute has the input property key. */ | ||
fun hasProperty(property: String): Boolean | ||
|
||
/** Tries to get the attributes property value assigned to the input property key. */ | ||
fun getProperty(): String | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/com/edelweiss/playerex/attributes/overrides/PEXEntityAttributeInstance.kt
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,8 @@ | ||
package com.edelweiss.playerex.attributes.overrides | ||
|
||
import java.util.UUID | ||
|
||
interface PEXEntityAttributeInstance { | ||
/** Changes the value of the input modifier if in existence, and updates the instance & children. */ | ||
fun updateModifier(uuid: UUID, value: Double) | ||
} |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
src/main/kotlin/com/edelweiss/playerex/attributes/utils/math.kt
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 @@ | ||
package com.edelweiss.playerex.attributes.utils |