Interface4 icon

Interface4 -----

Provides a general interface for my plugins




Changelog:
  • GUI API no longer cares if items have been "flattened" by 1.20.4+ space saving measures or not
  • 1.20.4+ support added
----------, Oct 26, 2024

Changelog:
  • SaberFactions is now supported
----------, Mar 24, 2024

Changelog:
  • ActionBar API can now take BaseComponent's to allow for different formatting and font types in the same message
----------, Mar 18, 2024

Utilities updated to include 1.20.x support
----------, Jul 12, 2023

Web domain updated, restoring auto-update capabilities
----------, Jun 7, 2023

VehicleMoveEvent added, as per request
----------, Jun 3, 2023

The Vehicle API from my Space plugin has now been implemented.
----------, May 29, 2023

Changelog:
  • URL connections have been made asynchronous to prevent freezing on high latency servers
----------, Mar 27, 2023

Changelog:
  • GUI#addClickAction(); method added
  • GUI#addDragAction(); method added
  • GUI#isDragLocked(); method added
  • GUI#setDragLocked(); method added
----------, Mar 24, 2023

Significant performance improvements
----------, Mar 8, 2023

Changelog:
  • Lands API updated to latest
----------, Feb 8, 2023


Changelog:
  • Jigsaw interface added for Space to procedurally generate structures
  • GUI API added
  • BorderStyle enum added
  • Documentation moved to GitHub
----------, Dec 2, 2022

Changelog:
  • DebugMarker API added (Source)
  • WorldGuard will no longer be enabled if WorldGuard is installed but WorldEdit is not (Since WorldGuard depends on WorldEdit)
----------, Nov 6, 2022

The following methods have been removed, as they are unused and have better integrated alternatives:
Code (Java):
JSON. sendWebsite (Player pl, String display, String hover, String website ) ;
JSON. send (Player pl, String display, String hover, String command ) ;
JSON. sendPrompt (Player pl, String display, String hover, String prompt ) ;
JSON. sendWebsite (CommandSender sender, String display, String hover, String website ) ;
JSON. send (CommandSender sender, String display, String hover, String command ) ;
JSON. sendPrompt (CommandSender sender, String display, String hover, String prompt ) ;
ZipUtils now have methods that do not require a CommandSender, and can also zip singular files:
Code (Java):
ZipUtils. createBackup (JavaPlugin main, ArrayList <String > files )
ZipUtils. createBackup (JavaPlugin main, String file ) ZipUtils. createBackup (JavaPlugin main, CommandSender sender, String prefix, String file )
----------, Nov 4, 2022

Changelog:
  • Interface4 now hosts block protection capabilities, meaning it is now super easy to check whether a block can be broken, placed, or interacted with using a bunch of different world protection plugins
  • "Hooks" command now shows both the plugins Interface4 hooks into, and the plugins hooked into Interface4
  • Added "isReloaded()" method to PluginUtils class, to detect when the server has been reloaded
----------, Nov 1, 2022

Changelog:
  • JSON API now retains color formatting between displayed elements
  • ParticleUtils now contains drawEffect and drawMovingEffect methods
  • PlayerDoubleSneakEvent added
  • DirectablePlayerScrollEvent added
----------, Oct 16, 2022


Summed up in title
----------, Jun 27, 2022

JChatComponent
Accepts three parameters of type String:
  • "display" - the text to display. Cannot be null.
  • "hover" - the text to display on hover. Can be null.
  • "text" - the text to chat on click. Can be null.
----------, Jun 25, 2022

After updating, please generate a fresh config.yml file for the changes to appear, or add the following options to your config.yml:
Code (YAML):
auto-update : true # Should Interface4 auto update. If true it is highly recommended to have "auto-restart: true"
auto-restart
: true # If an update is available, should the server automatically restart after downloading an update to apply changes

Using the command /i4 update will now automatically update the plugin to the latest version. Changes will be applied on restart.
----------, Jun 21, 2022


Update checking
Interface4 now uses:
As opposed to:
To ensure a much faster update speed and reliability.
JSON
New methods added to make sending JSON messages more dynamic.
Any methods containing a CommandSender will send as raw text if the sender is not an instance of Player.
Code (Java):
JSON. send (Player pl, ArrayList <JSONComponent > components ) ;
JSON. send (CommandSender sender, ArrayList <JSONComponent > components ) ;
JSON. send (CommandSender sender, JSONComponent... components ) ;
----------, Jun 21, 2022

JSON.java
Now only has one method which can accept infinite component parameters:
Code (Java):
JSON. send (Player pl, JSONComponent... components ) ;
Components Types
JClipboardComponent
Accepts three parameters of type String:
  • "display" - the text to display. Cannot be null.
  • "hover" - the text to display on hover. Can be null.
  • "clipboard" - the text to copy to clipboard on click. Can be null.

JPromptComponent
Accepts three parameters of type String:
  • "display" - the text to display. Cannot be null.
  • "hover" - the text to display on hover. Can be null.
  • "prompt" - the prompt to add to the textbox on click. Can be null.

JCommandComponent
Accepts three parameters of type String:
  • "display" - the text to display. Cannot be null.
  • "hover" - the text to display on hover. Can be null.
  • "command" - the command to run on click. Can be null.

JWebComponent
Accepts three parameters of type String:
  • "display" - the text to display. Cannot be null.
  • "hover" - the text to display on hover. Can be null.
  • "website" - the website URL to open on click. Can be null.

JTextComponent
Accepts two parameters of type String:
  • "display" - the text to display. Cannot be null.
  • "hover" - the text to display on hover. Can be null.

Example of usage
Code (Java):
JTextComponent text = new JTextComponent ( "This is raw text with a hover", "this is the hover text" ) ;
JWebComponent webText = new JWebComponent ( "This will open a website when clicked", "this is the hover text", "https://www.google.com" ) ;
JCommandComponent commandText = new JCommandComponent ( "This will run a command when clicked", "this is the hover text", "this is the command" ) ;
JSON. send (player, text, webText, commandText ) ; // Unlimited components can be supplied and will be automagically appended
----------, Jun 21, 2022

PastebinUtils:
PastebinUtils makes creating pastes on pastebin easy. The documentation on the required arguments is here.
The method will return a String which is a link to the generated paste.
  • pasteName, pasteFormat, and expiry can be null.
  • If expiry is null, the post will never expire.
  • devKey and content must not be null.
Code (Java):
PastebinUtils. createPaste ( String devKey, String pasteName, String pasteFormat, String expiry, String content ) ;
JSON changes:
Prompt methods now no longer add "/" prior to their prompt
----------, Jun 19, 2022

JSON suggest prompt added
Code (Java):

JSON. sendPrompt (Player pl, String shownMessage, String hoverMessage, String command ) ;
JSON. sendPrompt (CommandSender sender, String shownMessage, String hoverMessage, String command )
 
----------, Jun 19, 2022

  • The same logic applies to both of these methods as they would previously if they had been a Player provided.
  • If the CommandSender is not an instance of Player, shownMessage will be sent without JSON attributes

Code (Java):

JSON. send (CommandSender sender, String shownMessage, String hoverMessage, String command ) ;
JSON. sendWebsite (CommandSender sender, String shownMessage, String hoverMessage, String url ) ;
 
----------, Jun 18, 2022

Adds GuardianBeam support to Interface4. This is not my work and is here to aid in better particle effects within my plugins.
Special shoutout to @SkytAsul for the great work and brilliant resource.
----------, Jun 11, 2022

Two pretty simple new method to allow for resizing and recolouring of particles drawn by ParticleUtils
Code (Java):
ParticleUtils. drawLine (Location loc1, Location loc2, double frequency, Particle particle, DustOptions dustOptions ) ;
ParticleUtils. drawMovingLine (Location loc1, Location loc2, double time, double frequency, Particle particle, JavaPlugin plugin, DustOptions dustOptions ) ;
----------, Jun 11, 2022

Interface4 will now not only auto update, but has an auto update API so that you can update your own plugins automatically (Provided the resource ID and an instance of the Plugin)
  • projectID is the integer at the end of a plugin's Spigot link (For example, Interface4 has a projectID of 102119)
Return values:
  • 'true' - the plugin was successfully updated and the server must be restarted for changes to apply
  • 'false' - an error occurred while updating the plugin
  • 'null' - the plugin is already running the latest version
Code (Java):

VersionUtils. updatePlugin (Plugin plugin, int projectID ) ;
VersionUtils. updatePlugin (Plugin plugin, int projectID, String versionURL ) ;
 
Duplicate as version posted 30 minutes ago had outdated version string
----------, May 29, 2022

Interface4 will now not only auto update, but has an auto update API so that you can update your own plugins automatically (Provided the resource ID and an instance of the Plugin)
  • projectID is the integer at the end of a plugin's Spigot link (For example, Interface4 has a projectID of 102119)
Return values:
  • 'true' - the plugin was successfully updated and the server must be restarted for changes to apply
  • 'false' - an error occurred while updating the plugin
  • 'null' - the plugin is already running the latest version
Code (Java):

VersionUtils. updatePlugin (Plugin plugin, int projectID ) ;
VersionUtils. updatePlugin (Plugin plugin, int projectID, String versionURL ) ;
 
----------, May 29, 2022


VersionUtils is now capable of checking whether a plugin is up to date by a separate URL than Spigot ID's alone, and also getting the version from a specific URL. Please note the only web content must be the version so it is advised that this is purely a text file
Code (Java):
VersionUtils. isLatestByURL (JavaPlugin plugin, String URL ) ;
VersionUtils. getLatestByURL (JavaPlugin plugin, String URL ) ;
----------, May 28, 2022

ParticleUtils
ParticleUtils is capable of drawing static or moving lines between two locations, with a provided frequency (How many per block) and time to move between the two locations (If relevant)
Code (Java):
ParticleUtils. drawLine (Location loc1, Location loc2, double frequency, Particle particle ) ;
ParticleUtils. drawMovingLine (Location loc1, Location loc2, double time, double frequency, Particle particle, JavaPlugin plugin ) ;
PluginUtils
PluginUtils has one purpose - get a Plugin instance of the main class of another plugin by plugin name
Code (Java):
PluginUtils. getMain ( String plugin ) ;
VersionUtils
VersionUtils is an easy way to see whether or not a plugin is using it's latest version on Spigot, or get the latest version posted on Spigot.
projectID is the integer at the end of a plugin's Spigot link (For example, Interface4 has a projectID of 102119)
Code (Java):
VersionUtils. isLatest (JavaPlugin plugin, int projectID ) ;
VersionUtils. getLatest (JavaPlugin plugin, int projectID ) ;
----------, May 27, 2022

Small syntax error resolved
----------, May 25, 2022


Now calls correct class for SpaceAPI, fixing the two-way hook
----------, May 24, 2022

Pretty simple to use, just adds a basic interface for managing ghost blocks

Code (Java):

// Create a fake block
FakeBlock block = new FakeBlock (location, material ) ;

// Send the block to a player
block. addPlayer (player ) ;  

// Reset the block to its server-side counterpart
block. removePlayer (player ) ;
 
----------, May 21, 2022

Metrics added. You can view them here.
----------, May 21, 2022


Resource Information
Author:
----------
Total Downloads: 2,508
First Release: May 21, 2022
Last Update: Oct 26, 2024
Category: ---------------
All-Time Rating:
4 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings