Giter Site home page Giter Site logo

icecream's Introduction

Near Vanilla Ice Cream

The best treat for players and moderators!

icecream's People

Contributors

prof-bloodstone avatar

icecream's Issues

Create base gradle multi-project

Configure gradle to compile:

  1. Common lib
  2. Velocity plugin API
  3. Velocity plugin implementing the API and using lib
  4. Paper plugin API
  5. Paper plugin implementing the API and using lib

All of those should simple be "stubs" - empty paper/velocity plugin etc.

Should configure stuff like:

  • indra
  • shadow
  • code formatter
  • adding license headers

Add Redstone-friendly jukebox module

A simple module to get some basics implemented. Requires #2

DoD:

  • When powered, it switches music playing state
  • Can insert discs via hoppers
  • Can remove discs via hoppers

Create modulemanager and base module

Worth looking at how, for example, VanillaTweaks/PaperTweaks has done it: https://github.com/MC-Machinations/VanillaTweaks/tree/dev/0.2.0/vanilla-tweaks-bukkit/src/main/java/me/machinemaker/vanillatweaks/modules

Use Configurate for config (unless you have reasons why something else is better): https://github.com/SpongePowered/Configurate
Use Cloud for commands: https://github.com/Incendo/cloud

DoD:

  • We can extend a module (and override a few fields) to get:
    • configuration management/reload
    • command registration/deregistration
    • module/plugin reload support
Something I experimented with a couple of years back
package dev.bloodstone.vitalutils.common

import co.aikar.commands.BukkitCommandManager
import dev.bloodstone.vitalutils.VitalUtils
import java.lang.RuntimeException
import java.util.function.Predicate
import org.bukkit.event.HandlerList
import org.bukkit.event.Listener
import org.koin.core.KoinComponent
import org.koin.core.inject

abstract class BaseModule(private val shouldEnable: Predicate<PluginConfig>) : KoinComponent {
    var registered = false
        protected set

    protected abstract val register: () -> Unit
    protected abstract val unregister: () -> Unit

    protected val name: String = this::class.simpleName ?: throw RuntimeException("Unable to retrieve module name!")

    protected val plugin by inject<VitalUtils>()

    fun shouldEnable(): Boolean {
        return shouldEnable.test(plugin.moduleManager.config)
    }

    protected fun registerEvents(listener: Listener) {
        plugin.server.pluginManager.registerEvents(listener, plugin)
    }

    protected fun unregisterEvents(listener: Listener) {
        HandlerList.unregisterAll(listener)
    }

    protected fun registerCommands(vararg commands: BaseModuleCommand<*>) {
        commands.forEach { command ->
            plugin.commandManager.registerCommand(command)
        }
    }

    protected fun unregisterCommands(vararg commands: BaseModuleCommand<*>) {
        commands.forEach { command ->
            plugin.commandManager.unregisterCommand(command)
        }
    }

    open fun registerCommandReplacements(commandManager: BukkitCommandManager) {}
    open fun registerCommandCompletions(commandManager: BukkitCommandManager) {}
    open fun registerCommandConditions(commandManager: BukkitCommandManager) {}

    fun register() {
        if (registered) throw RuntimeException("Module $name is already registered!")
        this.register.invoke()
        registered = true
    }
    fun unregister() {
        if (!registered) throw RuntimeException("Module $name is not registered!")
        this.unregister.invoke()
        registered = false
    }
    fun reload() {}
}

Add AFK timer module

Requires: NearVanilla/bat#19

A module which tries to (lightly) detect whether a player is AFK or not (tries to ignore AFK-able movement like minecarts, water and slashing/eating).

DoD:

  • Detect since when player is AFK
  • Kick player after configurable AFK time
  • Integrate with BAT to display the status

Create basic Discord bot

Requires #2, should probably be created after #4
DoD:

  • Discord bot in Velocity plugin connects properly
  • Velocity plugin can synchronize MC<->Discord roles
    • For some roles, MC takes precedence (i.e. Donator)
    • For some roles, Discord takes precedence (i.e. helper/moderator/fab5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.