Skip to content

Lyces/animations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Animations framework

GitHub stars GitHub issues GitHub last commit MIT License Open Source Love Discord

A framework for creating animations easily

🌈 How to install

To install you can use maven or gradle

🍕 Repository

Add this repository in your list:

🎇Maven repository

<repositories>
  ...
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
  
</repositories>

🎊 Gradle repository

repositories {
  ...
  maven { url 'https://jitpack.io' }
}

🍔 Project dependency

Add the project dependency to your dependencies list:

🎇Maven dependency

<dependency>
 
  <groupId>com.github.Yuhtin</groupId>
  <artifactId>animations</artifactId>
  <version>{version}</version>
  <scope>provided</scope>
  
</dependency>

🎊 Gradle dependency

dependencies {
  implementation 'com.github.Yuhtin:animations:{version}'
}

📄 Documentation

First, you need to put the main plugin on the server (you can find the jar in the versions of this project)

🎈 Create animation

You need to extend the Animation class and use the AnimationHandler annotation in the class

@AnimationHandler(
        name = "test",
        description = "Test",
        state = AnimationHandler.AnimationVersion.RELEASE
)
public class TestA extends Animation {

    @Override
    public void execute(Player player) {

        runnableID = new BukkitRunnable() {

            @Override
            public void run() {
                // make something
            }

        }.getTaskId();

        ArmorStand stand = player.getLocation().getWorld().spawn(player.getLocation(), ArmorStand.class);
        hologramList.add(stand);

    }

    @Override
    public void stop() {
        hologramList.forEach(ArmorStand::remove);
        Bukkit.getScheduler().cancelTask(runnableID);
    }
}

🎫 Register animation

To register the animation, use the function AnimationRegistry#registry

public final class AnimationTest extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic

        AnimationRegistry.registry(this.getName(), TestA.class);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}

🧧 Execute animation

Use the command /animation in game

🎁 Project configuration

You need to put this information in your plugin.yml

softdepend: [ Animations ]