Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
522 additions
and
137 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
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
31 changes: 0 additions & 31 deletions
31
src/main/java/de/bixilon/minosoft/data/registries/effects/DefaultStatusEffects.kt
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/main/java/de/bixilon/minosoft/data/registries/effects/InstantEffect.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,16 @@ | ||
/* | ||
* Minosoft | ||
* Copyright (C) 2020-2022 Moritz Zwerger | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* This software is not affiliated with Mojang AB, the original developer of Minecraft. | ||
*/ | ||
|
||
package de.bixilon.minosoft.data.registries.effects | ||
|
||
interface InstantEffect |
51 changes: 51 additions & 0 deletions
51
src/main/java/de/bixilon/minosoft/data/registries/effects/IntegratedStatusEffects.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,51 @@ | ||
/* | ||
* Minosoft | ||
* Copyright (C) 2020-2022 Moritz Zwerger | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* This software is not affiliated with Mojang AB, the original developer of Minecraft. | ||
*/ | ||
|
||
package de.bixilon.minosoft.data.registries.effects | ||
|
||
import de.bixilon.minosoft.data.registries.effects.damage.DamageEffect | ||
import de.bixilon.minosoft.data.registries.effects.mining.MiningEffect | ||
import de.bixilon.minosoft.data.registries.effects.other.OtherEffects | ||
import de.bixilon.minosoft.data.registries.effects.vision.VisionEffect | ||
import de.bixilon.minosoft.data.registries.integrated.IntegratedRegistry | ||
|
||
object IntegratedStatusEffects : IntegratedRegistry<StatusEffectType>( | ||
DamageEffect.Absorption, | ||
DamageEffect.FireResistance, | ||
DamageEffect.HealthBoost, | ||
DamageEffect.InstantDamage, | ||
DamageEffect.InstantHealth, | ||
DamageEffect.Poison, | ||
DamageEffect.Regeneration, | ||
DamageEffect.Resistance, | ||
DamageEffect.Strength, | ||
DamageEffect.Weakness, | ||
DamageEffect.Wither, | ||
|
||
MiningEffect.Haste, | ||
MiningEffect.MiningFatigue, | ||
|
||
VisionEffect.Blindness, | ||
VisionEffect.Nausea, | ||
VisionEffect.NightVision, | ||
|
||
OtherEffects.BadOmen, | ||
OtherEffects.ConduitPower, | ||
OtherEffects.Glowing, | ||
OtherEffects.Hunger, | ||
OtherEffects.Invisibility, | ||
OtherEffects.Luck, | ||
OtherEffects.Saturation, | ||
OtherEffects.Unluck, | ||
OtherEffects.WaterBreathing, | ||
) |
46 changes: 46 additions & 0 deletions
46
src/main/java/de/bixilon/minosoft/data/registries/effects/PixlyzerStatusEffectType.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,46 @@ | ||
/* | ||
* Minosoft | ||
* Copyright (C) 2020-2022 Moritz Zwerger | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* This software is not affiliated with Mojang AB, the original developer of Minecraft. | ||
*/ | ||
package de.bixilon.minosoft.data.registries.effects | ||
|
||
import de.bixilon.kutil.cast.CastUtil.unsafeCast | ||
import de.bixilon.minosoft.data.registries.ResourceLocation | ||
import de.bixilon.minosoft.data.registries.effects.properties.categories.CategorizedEffect | ||
import de.bixilon.minosoft.data.registries.effects.properties.categories.StatusEffectCategories | ||
import de.bixilon.minosoft.data.registries.registries.Registries | ||
import de.bixilon.minosoft.data.registries.registries.registry.codec.ResourceLocationCodec | ||
import de.bixilon.minosoft.data.text.formatting.color.Colored | ||
import de.bixilon.minosoft.data.text.formatting.color.RGBColor | ||
import de.bixilon.minosoft.data.text.formatting.color.RGBColor.Companion.asRGBColor | ||
|
||
class PixlyzerStatusEffectType( | ||
override val resourceLocation: ResourceLocation, | ||
override val color: RGBColor, | ||
override val category: StatusEffectCategories, | ||
) : StatusEffectType(), Colored, CategorizedEffect { | ||
|
||
override fun toString(): String { | ||
return resourceLocation.full | ||
} | ||
|
||
companion object : ResourceLocationCodec<StatusEffectType> { | ||
|
||
override fun deserialize(registries: Registries?, resourceLocation: ResourceLocation, data: Map<String, Any>): PixlyzerStatusEffectType { | ||
|
||
return PixlyzerStatusEffectType( | ||
resourceLocation = resourceLocation, | ||
category = data["category"]?.unsafeCast<String>()?.let { return@let StatusEffectCategories[it] } ?: StatusEffectCategories.NEUTRAL, | ||
color = data["color"].unsafeCast<Int>().asRGBColor(), | ||
) | ||
} | ||
} | ||
} |
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
82 changes: 82 additions & 0 deletions
82
src/main/java/de/bixilon/minosoft/data/registries/effects/damage/DamageEffect.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,82 @@ | ||
/* | ||
* Minosoft | ||
* Copyright (C) 2020-2022 Moritz Zwerger | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* This software is not affiliated with Mojang AB, the original developer of Minecraft. | ||
*/ | ||
|
||
package de.bixilon.minosoft.data.registries.effects.damage | ||
|
||
import de.bixilon.minosoft.data.registries.CompanionResourceLocation | ||
import de.bixilon.minosoft.data.registries.effects.InstantEffect | ||
import de.bixilon.minosoft.data.registries.effects.StatusEffectType | ||
import de.bixilon.minosoft.data.registries.effects.properties.categories.BeneficalEffect | ||
import de.bixilon.minosoft.data.registries.effects.properties.categories.HarmfulEffect | ||
import de.bixilon.minosoft.data.text.formatting.color.Colored | ||
import de.bixilon.minosoft.data.text.formatting.color.RGBColor.Companion.asRGBColor | ||
import de.bixilon.minosoft.util.KUtil.minecraft | ||
|
||
interface DamageEffect { | ||
|
||
|
||
object Strength : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, BeneficalEffect { | ||
override val RESOURCE_LOCATION = minecraft("strength") | ||
override val color = 0x932423.asRGBColor() | ||
} | ||
|
||
object InstantHealth : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, BeneficalEffect, InstantEffect { | ||
override val RESOURCE_LOCATION = minecraft("instand_health") | ||
override val color = 0xF82423.asRGBColor() | ||
} | ||
|
||
object InstantDamage : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, HarmfulEffect, InstantEffect { | ||
override val RESOURCE_LOCATION = minecraft("instant_damage") | ||
override val color = 0x430A09.asRGBColor() | ||
} | ||
|
||
object Regeneration : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, BeneficalEffect { | ||
override val RESOURCE_LOCATION = minecraft("regeneration") | ||
override val color = 0xCD5CAB.asRGBColor() | ||
} | ||
|
||
object Resistance : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, BeneficalEffect { | ||
override val RESOURCE_LOCATION = minecraft("resistance") | ||
override val color = 0x99453A.asRGBColor() | ||
} | ||
|
||
object FireResistance : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, BeneficalEffect { | ||
override val RESOURCE_LOCATION = minecraft("fire_resistance") | ||
override val color = 0xE49A3A.asRGBColor() | ||
} | ||
|
||
object Weakness : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, HarmfulEffect { | ||
override val RESOURCE_LOCATION = minecraft("weakness") | ||
override val color = 0x484D48.asRGBColor() | ||
} | ||
|
||
object Poison : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, HarmfulEffect { | ||
override val RESOURCE_LOCATION = minecraft("poison") | ||
override val color = 0x4E9331.asRGBColor() | ||
} | ||
|
||
object Wither : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, HarmfulEffect { | ||
override val RESOURCE_LOCATION = minecraft("wither") | ||
override val color = 0x352A27.asRGBColor() | ||
} | ||
|
||
object HealthBoost : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, BeneficalEffect { | ||
override val RESOURCE_LOCATION = minecraft("heath_boost") | ||
override val color = 0xF87D23.asRGBColor() | ||
} | ||
|
||
object Absorption : StatusEffectType(), DamageEffect, CompanionResourceLocation, Colored, BeneficalEffect { | ||
override val RESOURCE_LOCATION = minecraft("absorption") | ||
override val color = 0x2552A5.asRGBColor() | ||
} | ||
} |
Oops, something went wrong.