Skip to content

Commit

Permalink
Merge pull request #192
Browse files Browse the repository at this point in the history
v5.2.1+1.20.1
  • Loading branch information
skycatminepokie authored Apr 21, 2024
2 parents 9eeee53 + edaa728 commit 811b4e3
Show file tree
Hide file tree
Showing 19 changed files with 201 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
MINECRAFT_VERSION: 1.20.1
JAVA_VERSION: 17
VERSION: 5.2.0+1.20.1
VERSION: 5.2.1+1.20.1
VERSION_TYPE: release

permissions:
Expand Down
11 changes: 4 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
- Internal changes
- Added a spell HUD for players with the mod installed on the client
- Added /mystical spell delete all
- Added some translations
- illusionersReplaceEvokers checks for havens now
- Added /mystical credits
- Added help commands
- Changed some advancement names
- Fixed nighttime events happening at the wrong times
- Fixed levitation spell not respecting havens
- Added mysteryEggs spell
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ As you play, a mysterious force casts spells over the world, changing game mecha

Mystical is **highly configurable**, **open-source**, and **awesome**.

Mystical is currently in beta - things are likely to change, and more polish and documentation is yet to come. Please feel free to ask questions or contribute to the project on [GitHub](https://github.com/skycatminepokie/mystical). Known issues, bugs, and future plans are also on GitHub.
Please feel free to ask questions or contribute to the project on [GitHub](https://github.com/skycatminepokie/mystical). Known issues, bugs, and future plans are also on GitHub.

### Warnings/known bugs
- Major updates (the x in version x.y.z) indicate BREAKING changes - your game MAY CRASH if proper steps aren't taken when updating.
- Updating from 4.x.x -> 5.x.x: Make sure to run and load your worlds with 4.1.12 before running 5.x.x or higher.
- Illusioner/evoker swapping is not affected by havens
- Major updates (the x in version x.y.z) indicate BREAKING changes - your game WILL CRASH if proper steps aren't taken when updating.

| Command | Effect | Permission | Default requirement |
|------------------------------------|----------------------------------------------|------------------------------------------|---------------------|
Expand All @@ -32,8 +30,4 @@ Mystical is currently in beta - things are likely to change, and more polish and
Requires OwO-lib and Fabric API

#### Can I use this in a modpack?
Yes! Just don't rehost it without permission. And if you feel like it, let me know - I'm excited to see where this project goes!

#### Contributing
You want to contribute? Awesome! Check out some of the later feature commits to see how the framework works (I'll maybe remember to add info here later). Please branch from `development` - I use PRs to master for publishing.
When running datagen, use the Gradle task `runDatagenClient`, NOT the run configuration. The Gradle task will make sure the translations make it to `server-translations-api`.
Yes! Just don't rehost it without permission. And if you feel like it, let me know - I'm excited to see where this project goes!
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=1.20.1+build.10
loader_version=0.15.7

# Mod Properties
mod_version=5.2.0+1.20.1
mod_version=5.2.1+1.20.1
maven_group=com.skycat
archives_base_name=mystical
modid=mystical
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 13 additions & 3 deletions src/main/generated/assets/mystical/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"text.config.mysticalConfig.category.illusionersReplaceEvokers": "Illusioners Replace Evokers",
"text.config.mysticalConfig.category.levitate": "Levitation",
"text.config.mysticalConfig.category.mobSpawnSwap": "Swap Overworld Mobs With Nether Mobs",
"text.config.mysticalConfig.category.mysteryEggs": "Mystery Eggs",
"text.config.mysticalConfig.category.noFuse": "No Fuses",
"text.config.mysticalConfig.category.oneStrikeWardens": "One Strike Wardens",
"text.config.mysticalConfig.category.randomCreeperEffectClouds": "Creepers leave random effect clouds",
Expand Down Expand Up @@ -91,6 +92,10 @@
"text.config.mysticalConfig.option.mobSpawnSwap.enabled": "Enable?",
"text.config.mysticalConfig.option.mobSpawnSwap.logLevel": "Logging",
"text.config.mysticalConfig.option.mobSpawnSwap.weight": "Weight",
"text.config.mysticalConfig.option.mysteryEggs.chance": "% chance",
"text.config.mysticalConfig.option.mysteryEggs.enabled": "Enable?",
"text.config.mysticalConfig.option.mysteryEggs.logLevel": "Logging",
"text.config.mysticalConfig.option.mysteryEggs.weight": "Weight",
"text.config.mysticalConfig.option.newSpellCommandBroadcast": "New spell command (in-game)",
"text.config.mysticalConfig.option.newSpellCommandLogLevel": "New spell command (console)",
"text.config.mysticalConfig.option.noFuse.chance": "% chance",
Expand Down Expand Up @@ -163,7 +168,7 @@
"text.config.mysticalConfig.section.Spells": "Spells",
"text.config.mysticalConfig.title": "Mystical Config",
"text.mystical.advancement.mystical.description": "Not everything is as it seems...",
"text.mystical.advancement.mystical.double_cure.description": "Now do it blindfolded",
"text.mystical.advancement.mystical.double_cure.description": "Cure a spell a little too much",
"text.mystical.advancement.mystical.double_cure.title": "Shoot the Moon",
"text.mystical.advancement.mystical.make_haven.description": "Ward a chunk from unknown forces",
"text.mystical.advancement.mystical.make_haven.title": "An Invisible Fortress",
Expand All @@ -175,7 +180,7 @@
"text.mystical.advancement.mystical.prevented_breaking.title": "No Trespassing",
"text.mystical.advancement.mystical.solo_spell.description": "Cure a spell all on your own",
"text.mystical.advancement.mystical.solo_spell.title": "Flying Solo",
"text.mystical.advancement.mystical.title": "Watch Your Step!",
"text.mystical.advancement.mystical.title": "Mystical",
"text.mystical.client.networkHandler.spellPacket.failedDeserialize": "Spells from active spell packet could not be deserialized. Skipping.",
"text.mystical.client.networkHandler.spellPacket.null": "Nbt from active spell packet was null. Skipping.",
"text.mystical.command.generic.alreadyHavened": "This chunk is already havened.",
Expand All @@ -184,7 +189,7 @@
"text.mystical.command.generic.notAPlayer.solution": "This command must be run by a player. Try %s.",
"text.mystical.command.generic.notAnEntity": "This must be called by an entity.",
"text.mystical.command.generic.success": "Success!",
"text.mystical.command.mystical.credits": "---\nCREDITS:\nskycatminepokie - Author\nSuperiorTabby - Code & texture contributor\nPhaserock - Texture contributor\nMembers of the Fabric Discord - Lots of programming help, and too many people to name. Thank you guys!\nmodmuss, player50, and the rest of the Fabric team - Fabric\nPatbox @ Nucleoid - Server Translations API\nLucko - Permissions API",
"text.mystical.command.mystical.credits": "---\nCREDITS:\nskycatminepokie - Author\nSuperiorTabby - Code & texture contributor\nPhaserock - Texture contributor\nImplement - Texture contributor\nMembers of the Fabric Discord - Lots of programming help, and too many people to name. Thank you guys!\nmodmuss, player50, and the rest of the Fabric team - Fabric\nPatbox @ Nucleoid - Server Translations API\nLucko - Permissions API",
"text.mystical.command.mystical.haven.help": "---\nA haven is a place of safety from spells.\nYou can create a chunk-wide haven with power by using %s.\nTo learn more about power, see %s\nTo learn more about spells, see %s",
"text.mystical.command.mystical.haven.info.inHaven": "This is in a haven.",
"text.mystical.command.mystical.haven.info.notInHaven": "This chunk is not havened.",
Expand Down Expand Up @@ -256,6 +261,11 @@
"text.mystical.consequence.mobSpawnSwap.fired": "Spell mobSpawnSwap: Nether mob <-> overworld mob.",
"text.mystical.consequence.mobSpawnSwap.longName": "Swap Overworld Mobs With Nether Mobs",
"text.mystical.consequence.mobSpawnSwap.shortName": "mobSpawnSwap",
"text.mystical.consequence.mysteryEggs.description": "Which came first, the fox or the egg?",
"text.mystical.consequence.mysteryEggs.failedSpawn": "Unable to spawn a random egg mob.",
"text.mystical.consequence.mysteryEggs.fired": "Spell mysteryEggs: Egg spawned a random mob..",
"text.mystical.consequence.mysteryEggs.longName": "Mystery Eggs",
"text.mystical.consequence.mysteryEggs.shortName": "mysteryEggs",
"text.mystical.consequence.noFuse.description": "Creepers don't hesitate anymore.",
"text.mystical.consequence.noFuse.fired": "Spell noFuse: Destroyed a fuse.",
"text.mystical.consequence.noFuse.longName": "No Fuses",
Expand Down
16 changes: 13 additions & 3 deletions src/main/generated/data/mystical/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"text.config.mysticalConfig.category.illusionersReplaceEvokers": "Illusioners Replace Evokers",
"text.config.mysticalConfig.category.levitate": "Levitation",
"text.config.mysticalConfig.category.mobSpawnSwap": "Swap Overworld Mobs With Nether Mobs",
"text.config.mysticalConfig.category.mysteryEggs": "Mystery Eggs",
"text.config.mysticalConfig.category.noFuse": "No Fuses",
"text.config.mysticalConfig.category.oneStrikeWardens": "One Strike Wardens",
"text.config.mysticalConfig.category.randomCreeperEffectClouds": "Creepers leave random effect clouds",
Expand Down Expand Up @@ -91,6 +92,10 @@
"text.config.mysticalConfig.option.mobSpawnSwap.enabled": "Enable?",
"text.config.mysticalConfig.option.mobSpawnSwap.logLevel": "Logging",
"text.config.mysticalConfig.option.mobSpawnSwap.weight": "Weight",
"text.config.mysticalConfig.option.mysteryEggs.chance": "% chance",
"text.config.mysticalConfig.option.mysteryEggs.enabled": "Enable?",
"text.config.mysticalConfig.option.mysteryEggs.logLevel": "Logging",
"text.config.mysticalConfig.option.mysteryEggs.weight": "Weight",
"text.config.mysticalConfig.option.newSpellCommandBroadcast": "New spell command (in-game)",
"text.config.mysticalConfig.option.newSpellCommandLogLevel": "New spell command (console)",
"text.config.mysticalConfig.option.noFuse.chance": "% chance",
Expand Down Expand Up @@ -163,7 +168,7 @@
"text.config.mysticalConfig.section.Spells": "Spells",
"text.config.mysticalConfig.title": "Mystical Config",
"text.mystical.advancement.mystical.description": "Not everything is as it seems...",
"text.mystical.advancement.mystical.double_cure.description": "Now do it blindfolded",
"text.mystical.advancement.mystical.double_cure.description": "Cure a spell a little too much",
"text.mystical.advancement.mystical.double_cure.title": "Shoot the Moon",
"text.mystical.advancement.mystical.make_haven.description": "Ward a chunk from unknown forces",
"text.mystical.advancement.mystical.make_haven.title": "An Invisible Fortress",
Expand All @@ -175,7 +180,7 @@
"text.mystical.advancement.mystical.prevented_breaking.title": "No Trespassing",
"text.mystical.advancement.mystical.solo_spell.description": "Cure a spell all on your own",
"text.mystical.advancement.mystical.solo_spell.title": "Flying Solo",
"text.mystical.advancement.mystical.title": "Watch Your Step!",
"text.mystical.advancement.mystical.title": "Mystical",
"text.mystical.client.networkHandler.spellPacket.failedDeserialize": "Spells from active spell packet could not be deserialized. Skipping.",
"text.mystical.client.networkHandler.spellPacket.null": "Nbt from active spell packet was null. Skipping.",
"text.mystical.command.generic.alreadyHavened": "This chunk is already havened.",
Expand All @@ -184,7 +189,7 @@
"text.mystical.command.generic.notAPlayer.solution": "This command must be run by a player. Try %s.",
"text.mystical.command.generic.notAnEntity": "This must be called by an entity.",
"text.mystical.command.generic.success": "Success!",
"text.mystical.command.mystical.credits": "---\nCREDITS:\nskycatminepokie - Author\nSuperiorTabby - Code & texture contributor\nPhaserock - Texture contributor\nMembers of the Fabric Discord - Lots of programming help, and too many people to name. Thank you guys!\nmodmuss, player50, and the rest of the Fabric team - Fabric\nPatbox @ Nucleoid - Server Translations API\nLucko - Permissions API",
"text.mystical.command.mystical.credits": "---\nCREDITS:\nskycatminepokie - Author\nSuperiorTabby - Code & texture contributor\nPhaserock - Texture contributor\nImplement - Texture contributor\nMembers of the Fabric Discord - Lots of programming help, and too many people to name. Thank you guys!\nmodmuss, player50, and the rest of the Fabric team - Fabric\nPatbox @ Nucleoid - Server Translations API\nLucko - Permissions API",
"text.mystical.command.mystical.haven.help": "---\nA haven is a place of safety from spells.\nYou can create a chunk-wide haven with power by using %s.\nTo learn more about power, see %s\nTo learn more about spells, see %s",
"text.mystical.command.mystical.haven.info.inHaven": "This is in a haven.",
"text.mystical.command.mystical.haven.info.notInHaven": "This chunk is not havened.",
Expand Down Expand Up @@ -256,6 +261,11 @@
"text.mystical.consequence.mobSpawnSwap.fired": "Spell mobSpawnSwap: Nether mob <-> overworld mob.",
"text.mystical.consequence.mobSpawnSwap.longName": "Swap Overworld Mobs With Nether Mobs",
"text.mystical.consequence.mobSpawnSwap.shortName": "mobSpawnSwap",
"text.mystical.consequence.mysteryEggs.description": "Which came first, the fox or the egg?",
"text.mystical.consequence.mysteryEggs.failedSpawn": "Unable to spawn a random egg mob.",
"text.mystical.consequence.mysteryEggs.fired": "Spell mysteryEggs: Egg spawned a random mob..",
"text.mystical.consequence.mysteryEggs.longName": "Mystery Eggs",
"text.mystical.consequence.mysteryEggs.shortName": "mysteryEggs",
"text.mystical.consequence.noFuse.description": "Creepers don't hesitate anymore.",
"text.mystical.consequence.noFuse.fired": "Spell noFuse: Destroyed a fuse.",
"text.mystical.consequence.noFuse.longName": "No Fuses",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"replace": false,
"values": [
"minecraft:fox",
"minecraft:parrot",
"minecraft:frog",
"minecraft:bee",
"minecraft:cod",
"minecraft:bat",
"minecraft:rabbit",
"minecraft:silverfish",
"minecraft:endermite"
]
}
16 changes: 16 additions & 0 deletions src/main/java/com/skycat/mystical/ConfigModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class ConfigModel {
@Nest public ChangingArmorHurtsConfig changingArmorHurts = new ChangingArmorHurtsConfig();
@Nest public SoundSwapConfig soundSwap = new SoundSwapConfig();
@Nest public FishingRodSwapConfig fishingRodSwap = new FishingRodSwapConfig();
@Nest public MysteryEggsConfig mysteryEggs = new MysteryEggsConfig();

@SectionHeader("Logging") // Note: Logging as ERROR level does not always mean a critical error.
public LogLevel failedToSetNightTimerLogLevel = LogLevel.WARN;
Expand Down Expand Up @@ -412,6 +413,21 @@ public static boolean weightPredicate(double value) {
}
}

public static class MysteryEggsConfig {
public boolean enabled = true;
public LogLevel logLevel = LogLevel.OFF;
@PredicateConstraint("weightPredicate")
public double weight = 1;
@PredicateConstraint("chancePredicate")
public double chance = 100.0;
public static boolean chancePredicate(double value) {
return ConfigModel.chancePredicate(value);
}
public static boolean weightPredicate(double value) {
return ConfigModel.weightPredicate(value);
}
}

/**
* Verify that the chance is valid.
* Used instead of {@link RangeConstraint} because it doesn't make a slider.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/skycat/mystical/MysticalEventHandler.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.skycat.mystical;

import com.skycat.mystical.accessor.MinecraftServerTimerAccess;
import com.skycat.mystical.network.MysticalNetworking;
import com.skycat.mystical.spell.SpellHandler;
import com.skycat.mystical.util.Utils;
import lombok.Getter;
Expand Down Expand Up @@ -84,13 +83,14 @@ public long setNightTimer() {
long currentTime = server.getOverworld().getTimeOfDay() % 24000;
if (currentTime > NIGHT_TIME) { // If we've passed NIGHT_TIME
timerLength = (24000 - currentTime) + NIGHT_TIME; // (time left in this day) + (time from morning til NIGHT_TIME) = time until tomorrow's NIGHT_TIME
} else { // It's before midnight
timerLength = NIGHT_TIME - currentTime; // NIGHT_TIME - (current time) = time until midnight
} else {
if (currentTime == 0) { // It's midnight
timerLength = 24000;
} else { // It's before midnight
timerLength = NIGHT_TIME - currentTime; // NIGHT_TIME - (current time) = time until midnight
}
}

if (timerLength == 0) { // So that we don't get repeating events if this is fired twice in a tick.
timerLength = NIGHT_TIME;
}
timerAccess.mystical_setTimer(timerLength);
return timerLength;
}
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/com/skycat/mystical/MysticalTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import net.minecraft.util.Identifier;

public class MysticalTags {
public static final TagKey<EntityType<?>> BOSSES = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier("mystical:bosses"));
public static final TagKey<EntityType<?>> ZOMBIE_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier("mystical:zombie_variants"));
public static final TagKey<EntityType<?>> SKELETON_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier("mystical:skeleton_variants"));
public static final TagKey<EntityType<?>> ENDERMAN_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier("mystical:enderman_variants"));
public static final TagKey<EntityType<?>> EVOKER_SUMMONABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier("mystical:evoker_summonable"));
public static final TagKey<Block> GLAZED_TERRACOTTA = TagKey.of(RegistryKeys.BLOCK, new Identifier("mystical:glazed_terracotta"));
public static final TagKey<EntityType<?>> BOSSES = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "bosses"));
public static final TagKey<EntityType<?>> ZOMBIE_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "zombie_variants"));
public static final TagKey<EntityType<?>> SKELETON_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "skeleton_variants"));
public static final TagKey<EntityType<?>> ENDERMAN_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "enderman_variants"));
public static final TagKey<EntityType<?>> EVOKER_SUMMONABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "evoker_summonable"));
public static final TagKey<EntityType<?>> RANDOM_EGG_SPAWNABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "random_egg_spawnable"));
public static final TagKey<Block> GLAZED_TERRACOTTA = TagKey.of(RegistryKeys.BLOCK, new Identifier(Mystical.MOD_ID, "glazed_terracotta"));
public static void init() {}
}
Loading

0 comments on commit 811b4e3

Please sign in to comment.