Skip to content

Instantly share code, notes, and snippets.

@IdanKoblik
IdanKoblik / DynamicInstantiator.java
Last active June 5, 2024 06:51
DynamicInstantiator a utility class that provides a way to dynamically instantiate
import lombok.extern.log4j.Log4j2;
import com.google.common.reflect.ClassPath;
import java.util.function.Consumer;
/**
* The DynamicInstantiator class is a utility class that provides a way to dynamically instantiate
* and register classes that implement a specific base class.
*/
@Log4J2
public class DynamicInstantiator {
@IdanKoblik
IdanKoblik / MetadataUtils.java
Created June 4, 2024 15:56
MetadataUtils a utility class for working with Bukkit metadata.
import org.bukkit.metadata.MetadataValue;
import org.bukkit.metadata.Metadatable;
import org.bukkit.plugin.Plugin;
import java.util.Optional;
/**
* Utility class for working with Bukkit metadata.
*/
public class MetadataUtils {