Skip to content

Commit

Permalink
Update to Blob Builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Sefiraat committed Jun 13, 2024
1 parent 88051ae commit f72d94a
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 19 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Upload

on:
push:
branches:
- master

jobs:
build:
name: Build and Upload
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[ci skip]') == false

steps:
- uses: actions/checkout@v4.1.7

- name: Set up JDK 16
uses: actions/setup-java@v4.2.1
with:
java-version: 16
distribution: adopt

- name: Build with Maven
run: mvn package

- name: Upload to Builds
uses: WalshyDev/blob-builds/gh-action@main
with:
project: SlimeTinker
apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }}
file: ./target/SlimeTinker.jar
releaseNotes: ${{ github.event.head_commit.message }}
12 changes: 2 additions & 10 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI
name: Build

on:
push:
Expand All @@ -24,12 +24,4 @@ jobs:
distribution: adopt

- name: Build with Maven
run: mvn package --file pom.xml

- name: Upload to Builds
uses: WalshyDev/blob-builds/gh-action@main
with:
project: SlimeTinker
apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }}
file: ./target/SlimeTinker.jar
releaseNotes: ${{ github.event.head_commit.message }}
run: mvn package
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sefiraat</groupId>
<artifactId>SlimeTinker</artifactId>
<version>0.1.1.2</version>
<version>MODIFIED</version>

<name>SlimeTinker</name>
<description>Slimefun4 Addon SlimeTinker</description>
Expand Down Expand Up @@ -244,7 +244,7 @@
<dependency>
<groupId>com.github.Slimefun</groupId>
<artifactId>Slimefun4</artifactId>
<version>2c4f886</version>
<version>03e5b9a</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
39 changes: 34 additions & 5 deletions src/main/java/io/github/sefiraat/slimetinker/SlimeTinker.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package io.github.sefiraat.slimetinker;

import io.github.mooy1.infinitylib.core.AbstractAddon;
import java.text.MessageFormat;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import io.github.sefiraat.slimetinker.itemgroups.ItemGroups;
import io.github.sefiraat.slimetinker.items.Casts;
import io.github.sefiraat.slimetinker.items.Dies;
Expand All @@ -16,14 +20,22 @@
import io.github.sefiraat.slimetinker.managers.MemoryManager;
import io.github.sefiraat.slimetinker.managers.TraitManager;
import io.github.sefiraat.slimetinker.runnables.RunnableManager;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.BlobBuildUpdater;

import org.bstats.bukkit.Metrics;
import org.bukkit.plugin.java.JavaPlugin;

public class SlimeTinker extends AbstractAddon {
public class SlimeTinker extends JavaPlugin implements SlimefunAddon {

public static final int RUNNABLE_TICK_RATE = 40;

private static SlimeTinker instance;

private final String username;
private final String repo;
private final String branch;

private RunnableManager runnableManager;
private ListenerManager listenerManager;
private TinkerMaterialManager tinkerMaterialManager;
Expand All @@ -33,11 +45,13 @@ public class SlimeTinker extends AbstractAddon {
private MemoryManager memoryManager;

public SlimeTinker() {
super("Sefiraat", "SlimeTinker", "master", "auto-update");
this.username = "Sefiraat";
this.repo = "SlimeTinker";
this.branch = "master";
}

@Override
public void enable() {
public void onEnable() {

new Metrics(this, 11748);

Expand All @@ -64,10 +78,13 @@ public void enable() {

this.listenerManager = new ListenerManager(this, this.getServer().getPluginManager());

if (getConfig().getBoolean("auto-update") && getDescription().getVersion().startsWith("DEV")) {
new BlobBuildUpdater(this, getFile(), "SlimeTinker", "Dev").start();
}
}

@Override
protected void disable() {
public void onDisable() {
saveConfig();
instance = null;
}
Expand Down Expand Up @@ -101,6 +118,18 @@ public TraitManager getTraitManager() {
return traitManager;
}

@Nonnull
@Override
public JavaPlugin getJavaPlugin() {
return this;
}

@Nullable
@Override
public String getBugTrackerURL() {
return MessageFormat.format("https://github.com/{0}/{1}/issues/", this.username, this.repo);
}

public static SlimeTinker getInstance() {
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.github.sefiraat.slimetinker.items.workstations.workbench;

import io.github.mooy1.infinitylib.machines.CraftingBlock;
import io.github.sefiraat.slimetinker.SlimeTinker;
import io.github.sefiraat.slimetinker.items.Workstations;
import io.github.sefiraat.slimetinker.utils.GUIItems;
import io.github.sefiraat.slimetinker.utils.ItemUtils;
import io.github.sefiraat.slimetinker.utils.Keys;
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
Expand All @@ -22,7 +22,7 @@

public class Workbench extends CraftingBlock {

public static final RecipeType TYPE = new RecipeType(SlimeTinker.createKey("tinkers-workbench"), Workstations.TINKERS_WORKBENCH);
public static final RecipeType TYPE = new RecipeType(Keys.create("tinkers-workbench"), Workstations.TINKERS_WORKBENCH);
protected static final int OUTPUT_SLOT = 25;
protected static final int CRAFT_BUTTON = 23;
private static final int[] BACKGROUND_SLOTS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 22, 24, 26, 27, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44};
Expand Down

0 comments on commit f72d94a

Please sign in to comment.