Skip to content

Commit

Permalink
Release 2.5.0 (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowdashlabs authored Apr 7, 2023
2 parents 588b7dc + 06abae0 commit c618aa4
Show file tree
Hide file tree
Showing 63 changed files with 672 additions and 276 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_nexus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3.3.0
- uses: actions/checkout@v3.5.0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3.3.0
- uses: actions/checkout@v3.5.0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand Down
18 changes: 9 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import de.chojo.PublishData

plugins {
java
id("com.diffplug.spotless") version "6.16.0"
id("de.chojo.publishdata") version "1.2.0"
id("com.diffplug.spotless") version "6.18.0"
id("de.chojo.publishdata") version "1.2.4"
}

group = "de.eldoria"
version = "2.4.3"
version = "2.5.0"

subprojects {
apply {
Expand Down Expand Up @@ -43,29 +43,29 @@ allprojects {
compileOnly("org.jetbrains", "annotations", "24.0.1")
// Due to incompatibility by the yaml versions defined by world edit, fawe and bukkit we need to exclude it everywhere and add our own version...
compileOnly("org.yaml", "snakeyaml", "1.33")
compileOnly("com.sk89q.worldedit", "worldedit-bukkit", "7.2.13") {
compileOnly("com.sk89q.worldedit", "worldedit-bukkit", "7.2.14") {
exclude("org.yaml")
}
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.5.2") {
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.6.0") {
exclude("com.intellectualsites.paster")
exclude("org.yaml")
}
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.5.2") {
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.6.0") {
isTransitive = false
exclude("org.yaml")
}

testImplementation(platform("org.junit:junit-bom:5.9.2"))
testImplementation("org.junit.jupiter", "junit-jupiter")
testImplementation("com.github.seeseemelk", "MockBukkit-v1.19", "2.145.0")
testImplementation("com.sk89q.worldedit", "worldedit-bukkit", "7.2.13") {
testImplementation("com.sk89q.worldedit", "worldedit-bukkit", "7.2.14") {
exclude("org.yaml")
}
testImplementation("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.5.2") {
testImplementation("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.6.0") {
exclude("com.intellectualsites.paster")
exclude("org.yaml")
}
testImplementation("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.5.2") {
testImplementation("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.6.0") {
isTransitive = false
exclude("org.yaml")
}
Expand Down
7 changes: 4 additions & 3 deletions schematicbrushreborn-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ plugins {
}

dependencies {
api("de.eldoria", "eldo-util", "1.14.2")
api("de.eldoria", "eldo-util", "1.14.4")
api("de.eldoria.util", "jackson-configuration", "2.0.0-SNAPSHOT")
api("de.eldoria", "messageblocker", "1.1.1")
api("net.kyori", "adventure-platform-bukkit", "4.2.0")
api("net.kyori", "adventure-text-minimessage", "4.12.0")
api("net.kyori", "adventure-platform-bukkit", "4.3.0")
api("net.kyori", "adventure-text-minimessage", "4.13.0")
}

publishData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

package de.eldoria.schematicbrush;

import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.cfg.MapperBuilder;
import com.fasterxml.jackson.databind.module.SimpleModule;
import de.eldoria.eldoutilities.core.EldoUtilities;
import de.eldoria.eldoutilities.plugin.EldoPlugin;
import de.eldoria.schematicbrush.brush.config.BrushSettingsRegistry;
Expand Down Expand Up @@ -42,6 +46,12 @@ public static SchematicBrushReborn instance() {
return (SchematicBrushReborn) getInstance();
}

public abstract Module platformModule();

public abstract SimpleModule schematicBrushModule();

public abstract ObjectMapper configureMapper(MapperBuilder<?, ?> builder);

/**
* Get schematic registry
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package de.eldoria.schematicbrush.brush.config.builder;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import de.eldoria.schematicbrush.brush.config.BrushSettingsRegistry;
import de.eldoria.schematicbrush.brush.config.provider.Mutator;
import de.eldoria.schematicbrush.brush.config.util.Nameable;
Expand All @@ -20,6 +21,7 @@
/**
* Represents a snapshot of a {@link BrushBuilder}.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@clazz")
public interface BrushBuilderSnapshot extends ConfigurationSerializable {
@Override
@NotNull Map<String, Object> serialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package de.eldoria.schematicbrush.brush.config.builder;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import de.eldoria.schematicbrush.brush.config.BrushSettingsRegistry;
import de.eldoria.schematicbrush.brush.config.SchematicSet;
import de.eldoria.schematicbrush.brush.config.provider.Mutator;
Expand All @@ -24,6 +25,7 @@
/**
* Builder to build schematic sets.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@clazz")
public interface SchematicSetBuilder extends ConfigurationSerializable, Copyable {
@Override
@NotNull Map<String, Object> serialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package de.eldoria.schematicbrush.brush.config.flip;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.util.Direction;
import de.eldoria.eldoutilities.commands.exceptions.CommandException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package de.eldoria.schematicbrush.brush.config.provider;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import de.eldoria.schematicbrush.brush.PasteMutation;
import de.eldoria.schematicbrush.brush.config.util.ComponentProvider;
import de.eldoria.schematicbrush.brush.config.util.Copyable;
Expand All @@ -17,6 +18,7 @@
*
* @param <T> value type of mutator
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@clazz")
public interface Mutator<T> extends Shiftable<T>, ConfigurationSerializable, ComponentProvider, Copyable {
/**
* Invoke the mutator on a paste mutation. The mutation will be applied on the brush.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package de.eldoria.schematicbrush.brush.config.schematics;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import de.eldoria.eldoutilities.container.Pair;
import de.eldoria.schematicbrush.brush.SchematicBrush;
import de.eldoria.schematicbrush.brush.config.BrushSettings;
Expand All @@ -16,6 +17,7 @@

import java.util.Optional;

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@clazz")
public interface SchematicSelection extends Randomable, ConfigurationSerializable {
Optional<Pair<SchematicSet, Schematic>> nextSchematic(SchematicBrush brush, boolean force);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package de.eldoria.schematicbrush.brush.config.selector;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import de.eldoria.schematicbrush.brush.config.util.ComponentProvider;
import de.eldoria.schematicbrush.schematics.Schematic;
import de.eldoria.schematicbrush.schematics.SchematicRegistry;
Expand All @@ -17,6 +18,8 @@
/**
* Represents a selector.
*/

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@clazz")
public interface Selector extends ConfigurationSerializable, ComponentProvider {
/**
* Select matching schematics from a cache in the registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

package de.eldoria.schematicbrush.brush.config.util;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Represents a named key.
*/
Expand All @@ -17,7 +20,8 @@ public class Nameable {
*
* @param name name
*/
protected Nameable(String name) {
@JsonCreator
public Nameable(@JsonProperty("name") String name) {
this.name = name;
}

Expand All @@ -28,8 +32,7 @@ protected Nameable(String name) {
* @return new nameable instance
*/
public static Nameable of(String name) {
return new Nameable(name) {
};
return new Nameable(name);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public interface GeneralConfig extends ConfigurationSerializable {
*
* @return the message channel implementation
*/
MessageChannel<?> defaultNameChannel();
de.eldoria.schematicbrush.config.sections.MessageChannel defaultNameChannel();

/**
* The refresh interval for each player of the rendering preview.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
*
* Copyright (C) EldoriaRPG Team and Contributor
*/

package de.eldoria.schematicbrush.config.sections;

public enum MessageChannel {
ACTION_BAR, CHAT, TITLE, SUB_TITLE
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface SchematicConfig extends ConfigurationSerializable {
*
* @return list of sources
*/
List<SchematicSource> sources();
List<? extends SchematicSource> sources();

/**
* The path separator which should be used when showing pathes.
Expand All @@ -50,5 +50,5 @@ public interface SchematicConfig extends ConfigurationSerializable {
* @param path path
* @return optional holding a source
*/
Optional<SchematicSource> getSourceForPath(Path path);
Optional<? extends SchematicSource> getSourceForPath(Path path);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package de.eldoria.schematicbrush.schematics;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
Expand Down Expand Up @@ -41,7 +42,7 @@ public class Schematic implements Comparable<Schematic> {
* Regex which matches the end of a filename.
*/
private static final String EXTENSION = "\\..+$";
private final Map<Material, Integer> materialMap = new EnumMap<>(Material.class);
private final Map<Material, Integer> materialMap = new EnumMap<>(Material.class);
/**
* Format of the schematic.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ public interface Storage {
* This will not remove already existing entries.
*
* @param storage storage with entries to add.
* @return A future which completes when all underlying processes are completed.
*/

default CompletableFuture<Void> migrate(Storage storage) {
var presets = presets().migrate(storage.presets());
var brushes = brushes().migrate(storage.brushes());

return CompletableFuture.allOf(presets, brushes);
default void migrate(Storage storage) {
presets().migrate(storage.presets());
brushes().migrate(storage.brushes());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@

package de.eldoria.schematicbrush.storage.base;

import de.eldoria.eldoutilities.utils.Futures;
import de.eldoria.schematicbrush.SchematicBrushReborn;
import com.fasterxml.jackson.annotation.JsonIgnore;
import de.eldoria.schematicbrush.storage.ContainerPagedAccess;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;

/**
* An interface which represents a container which holds named entries of any type.
Expand Down Expand Up @@ -95,31 +91,22 @@ public interface Container<T> {
*
* @return true if this container has the global UUID
*/
default boolean isGlobalcontainer() {
@JsonIgnore
default boolean isGlobalContainer() {
return GLOBAL.equals(owner());
}

/**
* Migrate the container into this container.
* This will override entries if they already exist whith the same name.
* This will override entries if they already exist with the same name.
* This will not remove already existing entries.
*
* @param container container with entries to add.
* @return A future which completes when all underlying processes are completed.
*/
default CompletableFuture<Void> migrate(Container<T> container) {
List<CompletableFuture<?>> migrations = new ArrayList<>();
var migrate = container.all()
.whenComplete(Futures.whenComplete(entries -> {
for (var entry : entries) {
var migration = add(entry);
migrations.add(migration);
add(entry).whenComplete(Futures.whenComplete(
res -> {
}, err -> SchematicBrushReborn.logger().log(Level.SEVERE, "Could not save player container", err)));
}
}, err -> SchematicBrushReborn.logger().log(Level.SEVERE, "Could not load player container", err)));
migrations.add(migrate);
return CompletableFuture.allOf(migrations.toArray(CompletableFuture[]::new));
default void migrate(Container<T> container) {
var entries = container.all().join();
for (var entry : entries) {
add(entry).join();
}
}
}
Loading

0 comments on commit c618aa4

Please sign in to comment.