Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Dec 7, 2019
2 parents 1a0c220 + 1d2d95e commit 2d1d048
Show file tree
Hide file tree
Showing 86 changed files with 2,552 additions and 1,110 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Java CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew clean build
- name: Upload artifact
uses: actions/[email protected]
with:
# Artifact name
name: Jar Files
# Directory containing files to upload
path: ./build/libs
2 changes: 1 addition & 1 deletion .idea/modules/com.github.fernthedev.FernAPI.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 46 additions & 41 deletions .idea/modules/com.github.fernthedev.FernAPI.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions .idea/modules/com.github.fernthedev.FernAPI.test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ fPlayer.sendChatMessage(textMessage);

### PlaceHolderAPI (Bungee)
```java
AskPlaceHolder askPlaceHolder = new AskPlaceHolder(Player,PlaceHolder);
AskPlaceHolder velocityAskPlaceHolder = new AskPlaceHolder(Player,PlaceHolder);

askPlaceHolder.setRunnable(new MessageRunnable() {
velocityAskPlaceHolder.setRunnable(new MessageRunnable() {
@Override
public void run() {
super.run();
//Whatever you want.
sender.sendMessage("The player's placeholder value of " + args[1] + " is " + askPlaceHolder.getPlaceHolderResult());
sender.sendMessage("The player's placeholder value of " + args[1] + " is " + velocityAskPlaceHolder.getPlaceHolderResult());
}
});
```
Expand Down Expand Up @@ -199,9 +199,11 @@ public class Test extends PluginMessageHandler {
@Override
public void onMessageReceived(PluginMessageData data, Channel channel) {
//Whatever you want
//Handling extra data is so:
String data1 = in.readUTF(); //DATA1
String data2 = in.readUTF(); //DATA2
// data Contains all the data you would need.
// Extra data is so:
for(String extraData : data.getExtraData()) {

}
//You read the data in the order you add it, so if you add DATA1 first, you read it first, then second DATA2 etc.
//This works for both adding to output stream or using data.addData();
}
Expand All @@ -216,7 +218,7 @@ To receive messages, the sender also has to use the API. This is an example how:
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(stream);

data = new PluginMessageData(stream,"Forward",player.getServer().getInfo().getName(),Sub channel such as "Channel1",Channel you defined in your getChannels() method "pluginName:channel");
data = new PluginMessageData(stream,player.getServer().getInfo().getName() or "All" or ServerInfo.getName(),SubChannel within pluginChannel,new Channel(namespace, pluginChannel, ChannelAction));

data.addData("Data1");

Expand All @@ -228,6 +230,10 @@ Universal.getMessageHandler().sendPluginData(fplayer,data);
### MySQL
Example usage can be found [here](https://github.com/Fernthedev/FernAPI/blob/master/src/main/java/com/github/fernthedev/fernapi/universal/examples)

Use the DatabaseManager class for managing tables, and TableInfo for grabbing the data.
RowData class contains a list of ColumnData which contains the data.
[My FernCommands plugin](https://github.com/Fernthedev/FernAPI) can also be used as an example of MySQL.

### Universal Commands
Universal Commands are commands that can be registered with the same class and code in spigot, sponge and bungee without necessarily adding server specific code, but that can be done anyways.
```java
Expand Down
Loading

0 comments on commit 2d1d048

Please sign in to comment.