1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

[CI skip] Updated changelog and workflows

This commit is contained in:
TheBusyBiscuit 2021-05-10 23:18:36 +02:00
parent a64597e129
commit 5620528c1d
6 changed files with 21 additions and 6 deletions

View File

@ -1,7 +1,6 @@
name: Auto approve
on:
pull_request
on: pull_request
jobs:
auto-approve:
@ -9,6 +8,9 @@ jobs:
name: Auto approve Pull Request
runs-on: ubuntu-latest
## Only run this on the main repo
if: github.repository == 'Slimefun/Slimefun4'
steps:
- name: Approve via actions
uses: hmarr/auto-approve-action@v2.1.0

View File

@ -17,6 +17,9 @@ jobs:
name: Auto squash
runs-on: ubuntu-latest
## Only run this on the main repo
if: github.repository == 'Slimefun/Slimefun4'
steps:
- name: Auto squash
uses: pascalgn/automerge-action@v0.13.1

View File

@ -12,6 +12,8 @@ jobs:
name: Discord Webhook
runs-on: ubuntu-latest
## Only run this on the main repo
if: github.repository == 'Slimefun/Slimefun4'
steps:

View File

@ -62,6 +62,7 @@
* Fixed #3027
* Fixed #2978
* Fixed #3041
* Fixed #3036
* Possibly fixed #2927
## Release Candidate 22 (18 Apr 2021)

View File

@ -10,6 +10,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.apache.commons.lang.Validate;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.World;
@ -248,7 +249,8 @@ public abstract class Network {
*/
public void display() {
if (manager.isVisualizerEnabled()) {
SlimefunPlugin.runSync(new NetworkVisualizer(this));
// TODO: Make Color configurable / network-dependent
SlimefunPlugin.runSync(new NetworkVisualizer(this, Color.BLUE));
}
}

View File

@ -2,6 +2,7 @@ package io.github.thebusybiscuit.slimefun4.api.network;
import javax.annotation.Nonnull;
import org.apache.commons.lang.Validate;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Particle;
@ -18,7 +19,7 @@ class NetworkVisualizer implements Runnable {
/**
* The {@link DustOptions} define the {@link Color} and size of our particles.
*/
private final DustOptions options = new DustOptions(Color.BLUE, 3.5F);
private final DustOptions particleOptions;
/**
* This is our {@link Network} instance.
@ -31,8 +32,12 @@ class NetworkVisualizer implements Runnable {
* @param network
* The {@link Network} to visualize
*/
NetworkVisualizer(@Nonnull Network network) {
NetworkVisualizer(@Nonnull Network network, @Nonnull Color color) {
Validate.notNull(network, "The network should not be null.");
Validate.notNull(color, "The color cannot be null.");
this.network = network;
this.particleOptions = new DustOptions(color, 3F);
}
@Override
@ -53,7 +58,7 @@ class NetworkVisualizer implements Runnable {
* The {@link Location} of our node
*/
private void spawnParticles(@Nonnull Location l) {
l.getWorld().spawnParticle(Particle.REDSTONE, l.getX() + 0.5, l.getY() + 0.5, l.getZ() + 0.5, 1, 0, 0, 0, 1, options);
l.getWorld().spawnParticle(Particle.REDSTONE, l.getX() + 0.5, l.getY() + 0.5, l.getZ() + 0.5, 1, 0, 0, 0, 1, particleOptions);
}
}