generated from Slimefun/Addon-Template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
917 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
# Slimefun4 Addon | ||
This is an example Repository for a generic Slimefun4 Addon. | ||
In the top left is a button "Use this template", click this to create your own Addon for Slimefun4 using this basic template. | ||
![I Dream of Easy!](https://github.com/user-attachments/assets/044e9fec-5a44-4b16-b091-23738f4ae4bf) | ||
|
||
## How to create your own addon. | ||
This is a template repository that you can use to create your own Slimefun4 Addon.<br> | ||
We have also written an extensive step-by-step tutorial which you can find here:<br> | ||
https://github.com/Slimefun/Slimefun4/wiki/Developer-Guide | ||
### I Dream of Easy is a Slimefun Addon that implements workable community suggestions as well as other random tools and machines. | ||
|
||
## Changing some important things | ||
Navigate to `src/main/java` and rename the package and the .java File to your liking.<br> | ||
Suggestion: "me.yourname.yourproject" (all lower case) and "ProjectName.java"<br> | ||
Example: "me.thebusybiscuit.cooladdon" and "CoolAddon.java" | ||
## How it works | ||
TODO | ||
|
||
Navigate to `src/main/resources/plugin.yml` and change the "author" and "main" attributes. | ||
You may also want to change the description to something meaningful. | ||
## Important info | ||
TODO | ||
|
||
Navigate to `pom.xml` and change the group id to "me.%Your name%" and change the artifact id to the name of your Project. | ||
|
||
After that you are good to go, you can now start developing your own Addon for Slimefun4. | ||
## Items | ||
### Base: | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package me.bunnky.idreamofeasy; | ||
|
||
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; | ||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; | ||
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.BlobBuildUpdater; | ||
import me.bunnky.idreamofeasy.slimefun.Setup; | ||
import org.bstats.bukkit.Metrics; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.text.MessageFormat; | ||
|
||
public class IDreamOfEasy extends JavaPlugin implements SlimefunAddon { | ||
private static IDreamOfEasy instance; | ||
private final String username; | ||
private final String repo; | ||
|
||
public IDreamOfEasy() { | ||
this.username = "Bunnky"; | ||
this.repo = "IDreamOfEasy"; | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
instance = this; | ||
|
||
getLogger().info(" ┳ ┳┓┳┓┏┓┏┓┳┳┓ ┏┓┏┓ ┏┓┏┓┏┓┓┏ "); | ||
getLogger().info(" ┃ ┃┃┣┫┣ ┣┫┃┃┃ ┃┃┣ ┣ ┣┫┗┓┗┫ "); | ||
getLogger().info(" ┻ ┻┛┛┗┗┛┛┗┛ ┗ ┗┛┻ ┗┛┛┗┗┛┗┛ "); | ||
getLogger().info(" by Bunnky "); | ||
|
||
saveDefaultConfig(); | ||
tryUpdate(); | ||
|
||
|
||
Setup.setup(); | ||
setupMetrics(); | ||
|
||
if (!Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_20)) { | ||
getLogger().warning("IDOE only support 1.20+, disabling."); | ||
getServer().getPluginManager().disablePlugin(this); | ||
} | ||
} | ||
|
||
public void setupMetrics (){ | ||
Metrics metrics = new Metrics(this, 23610); | ||
} | ||
|
||
public void tryUpdate() { | ||
if (getConfig().getBoolean("options.auto-update", true) | ||
&& getDescription().getVersion().startsWith("Dev - ") | ||
) { | ||
new BlobBuildUpdater(this, getFile(), "SlimeVision", "Dev").start(); | ||
} | ||
} | ||
|
||
public static void consoleMsg(@Nonnull String string) { | ||
instance.getLogger().info(string); | ||
} | ||
|
||
public static IDreamOfEasy getInstance() { | ||
return instance; | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
} | ||
|
||
@Override | ||
public String getBugTrackerURL() { | ||
return MessageFormat.format("https://github.com/{0}/{1}/issues", this.username, this.repo); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public JavaPlugin getJavaPlugin() { | ||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package me.bunnky.idreamofeasy.slimefun; | ||
|
||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; | ||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; | ||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; | ||
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; | ||
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack; | ||
import lombok.experimental.UtilityClass; | ||
import me.bunnky.idreamofeasy.IDreamOfEasy; | ||
import org.bukkit.Material; | ||
import org.bukkit.NamespacedKey; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
@UtilityClass | ||
public class Setup { | ||
|
||
|
||
public static void setup() { | ||
|
||
IDreamOfEasy plugin = IDreamOfEasy.getInstance(); | ||
|
||
ItemStack groupItem = new CustomItemStack(Material.CALIBRATED_SCULK_SENSOR, "&bI Dream of Easy", "", "I wish this worked!"); | ||
NamespacedKey groupId = new NamespacedKey(IDreamOfEasy.getInstance(), "i_dream_of_easy"); | ||
ItemGroup group = new ItemGroup(groupId, groupItem); | ||
|
||
//######################## | ||
// ITEMS | ||
//######################## | ||
|
||
SlimefunItemStack placeholder = new SlimefunItemStack( | ||
"IDOE_PLACEHOLDER", | ||
Material.CALIBRATED_SCULK_SENSOR, | ||
"&2PLACEHOLDER", | ||
"" | ||
); | ||
|
||
|
||
//######################## | ||
// RECIPES | ||
//######################## | ||
|
||
ItemStack[] placeholderRecipe = { | ||
null, null, null, | ||
null, null, null, | ||
null, null, null | ||
}; | ||
|
||
//######################## | ||
// INSTANTIATE | ||
//######################## | ||
|
||
SlimefunItem placeholderItem = new SlimefunItem(group, placeholder, RecipeType.ENHANCED_CRAFTING_TABLE, placeholderRecipe); | ||
|
||
|
||
//######################## | ||
// REGISTER | ||
//######################## | ||
|
||
placeholderItem.register(plugin); | ||
} | ||
} |
Oops, something went wrong.