Skip to content

Commit

Permalink
turned config to gamerule, removed dependency for owo-libs
Browse files Browse the repository at this point in the history
  • Loading branch information
commandblock2 committed Jul 14, 2023
1 parent b82a759 commit 613c061
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ Note that cocoa bean is different from coffee bean in reality
## TODO
- Finish advancements and rewrite previous section according to advancements
- Texturing
- Also game play improvement like particles and sound effect
- Gamerule!!! instead of config file and strip the dependency of owo maybe
- Also game play improvement like particles and sound effect
3 changes: 1 addition & 2 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
## 待办事项
- 完成进度并根据进度重写上一节内容
- 贴图
- 还有像粒子效果和声音效果之类的游戏玩法改进
- Gamerule而不是owo的config
- 还有像粒子效果和声音效果之类的游戏玩法改进
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
* along with CoffeeMod. If not, see <https://www.gnu.org/licenses/>.
*/

package github.commandblock2.coffee_mod.config
package github.commandblock2.coffee_mod.world

import github.commandblock2.coffee_mod.CoffeeMod
import io.wispforest.owo.config.annotation.Config
import io.wispforest.owo.config.annotation.Modmenu
import net.fabricmc.fabric.api.gamerule.v1.GameRuleFactory

@Modmenu(modId = CoffeeMod.MOD_ID)
@Config(name = "coffee-config", wrapperName = "CoffeeModConfig")
class CoffeeModConfigModel {
@JvmField
var disablePhantomSpawning = false
import net.fabricmc.fabric.api.gamerule.v1.GameRuleRegistry

@JvmField
var respawnPhantomWhenEffectFades = false
import net.minecraft.world.GameRules
import net.minecraft.world.GameRules.BooleanRule


object CoffeeModGamerules {
val spawnPhantoms =
GameRuleRegistry.register("spawnPhantomsForCoffeedPlayer", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true))
val catchupSpawn =
GameRuleRegistry.register("respawnDiscardedPhantoms", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(false))
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
"effect.${mod_id}.coffee_buzz": "Coffee Buzz",
"wildcard.effect.${mod_id}.%s_coffee_buzz": "%s Shit Coffee Buzz",
"death.${mod_id}.overdose": "%s drank too much coffee",
"text.config.coffee-config.title": "CoffeeMod Config",
"text.config.coffee-config.option.disablePhantomSpawning": "Disable phantom spawning (when nearest player has coffee buzz)",
"text.config.coffee-config.option.respawnPhantomWhenEffectFades": "Respawn the phantoms when the effect fades (discarded in the previous option) ",
"gamerule.spawnPhantomsForCoffeedPlayer": "Disable phantom spawning (when nearest player has coffee buzz)",
"gamerule.respawnDiscardedPhantoms": "Respawn the phantoms when the effect fades (discarded in the previous option) ",
"advancements.${mod_id}.root.title" : "CoffeeMod",
"advancements.${mod_id}.root.desc": "The journey of Coffee & Shit begins with cocoa bean",
"advancements.${mod_id}.feed-any.title": "Shit coffee bean in minutes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
"wildcard.item.minecraft.lingering_potion.effect.%s_shit_coffee_boosted_potion": "滞留型%s屎浓缩咖啡",
"wildcard.item.minecraft.lingering_potion.effect.%s_shit_coffee_prolonged_potion": "滞留型%s屎淡味咖啡",
"death.${mod_id}.overdose": "%s咖啡喝太多猝死了",
"text.config.coffee-config.title": "咖啡Mod设置",
"text.config.coffee-config.option.disablePhantomSpawning": "禁用幻翼生成(当最近玩家具有咖啡刺激状态时)",
"text.config.coffee-config.option.respawnPhantomWhenEffectFades": "咖啡药效消失后生成因为咖啡未生成的幻翼",
"gamerule.spawnPhantomsForCoffeedPlayer": "禁用幻翼生成(当最近玩家具有咖啡刺激状态时)",
"gamerule.respawnDiscardedPhantoms": "咖啡药效消失后生成因为咖啡未生成的幻翼",
"advancements.${mod_id}.root.title": "咖啡Mod",
"advancements.${mod_id}.root.desc": "从可可豆开始 咖啡和屎的旅程",
"advancements.${mod_id}.feed-any.title": "啊哈哈哈哈 咖啡豆来喽",
Expand Down
1 change: 0 additions & 1 deletion coffee-mod-hsds/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"fabricloader": "*",
"fabric-api": "*",
"fabric-language-kotlin": "*",
"owo-lib": "*",
"minecraft": "~${minecraft}",
"java": ">=${java}"
},
Expand Down

0 comments on commit 613c061

Please sign in to comment.