Alpho320 / FabulousCore

a fabulous core for minecraft.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FabulousCore

FabulousCore

The FabulousCore gives to you create a SignGUI, WorldBorder, cooldowns, minigame, interactable objects, chain based item creating and send sound & colored/timed message(s) to player(s) with easy way.

Discord Patreon
Latest quality Last Updated
Stars Maintained

How to use (Bukkit)

<repositories>
  <repository>
    <id>jitpack</id>
    <url>https://jitpack.io/</url>
  </repository>
</repositories>
<dependencies>
	<dependency>
	    <groupId>com.github.FabulousProject.FabulousCore</groupId>
	    <artifactId>bukkit</artifactId> 
	    <version>${version}</version>
	</dependency>
</dependencies>

<builds>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-shade-plugin</artifactId>
      <version>3.3.1-SNAPSHOT</version>
      <executions>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>shade</goal>
          </goals>
          <configuration>
            <minimizeJar>true</minimizeJar>
            <createDependencyReducedPom>false</createDependencyReducedPom>
            <!-- Relocations(Optional)
            <relocations>
              <relocation>
                <pattern>me.alpho320.fabulous.core</pattern>
                <shadedPattern>[YOUR_PLUGIN_PACKAGE].shade</shadedPattern>
              </relocation>
            </relocations>
            -->
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</builds>

Gradle

plugins {
  id "com.github.johnrengelman.shadow" version "7.0.0"
}
repositories {
  maven {
    url "https://jitpack.io"
  }
}
dependencies {
  implementation("com.github.FabulousProject.FabulousCore:${version}")
}

Getting Started

Registering the library

final class MyPlugin extends JavaPlugin {

  private BukkitCore core;

  @Override
  public void onEnable() {
    this.core = new BukkitCore(this);
    this.core.init(); //then you can access with BukkitCore.instance().foo();
    
    new SomeClassesThatNeedBukkitCore(this.core).foo();
    new SomeOtherClasses(this.core).foo();
  }
}

Creating a SignGUI

SignGUI sign = BukkitCore.instance().sign()
	.create() // creates a new instance.
	.setType(SignGUI.SignType.OAK) // Types: OAK, ACACIA, BIRCH, SPRUCE, CRIMSON, DARK_OAK, JUNGLE.
	.withLines("Hi!", "how are u?", "must be four", "lines!")
	.whenOpen(strings -> {			
		player.sendMessage("opened!");
	    }
	)
	.whenClose(strings -> {
		player.sendMessage("closed!");
	    }
	)
	.open(player);

Creating a ItemStack

ItemStack item = new BukkitItemCreator()
        .type(Material.IRON_SWORD)
        .name(BukkitCore.instance().message().colored("&6&lAMAZING SWORD!"))
        .amount(3)
        .damage(1)
        .lore(
                "awsome lore",
                "really!"
        )
        .enchant(Enchantment.DAMAGE_ALL, 10)
        .modelData(20)
        .flag(ItemFlag.HIDE_ATTRIBUTES)
        .glow()
        .create();   

Sending a Sound

BukkitCore.instance().sound().send(
        player,
        Sound.ENTITY_PLAYER_LEVELUP
);  

Serialize a Location

BukkitCore.instance().location().serialize(
        player.getLocation()
); 

Deserialize a Location

BukkitCore.instance().location().deserialize(
        mySerializedString
); 

Getting a Random Element From List

T randomElement = new RandomSelect<>(myList).choose();

Player target = new RandomSelect<>(playerList).choose();

NOTICE: If you have any questions, suggestions or issues with the core, please contact me on GitHub Issues section or Alpho320#9202 (Discord)

About

a fabulous core for minecraft.

License:Creative Commons Zero v1.0 Universal


Languages

Language:Java 100.0%