-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix addonet og tilføj lidt forskellige features.
- Loading branch information
Showing
53 changed files
with
1,628 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,10 @@ | ||
version = "0.1.0" | ||
|
||
plugins { | ||
id("java-library") | ||
} | ||
import net.labymod.labygradle.common.extension.LabyModAnnotationProcessorExtension.ReferenceType | ||
|
||
dependencies { | ||
labyProcessor() | ||
labyApi("api") | ||
} | ||
|
||
labyModProcessor { | ||
referenceType = net.labymod.gradle.core.processor.ReferenceType.INTERFACE | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
labyModAnnotationProcessor { | ||
referenceType = ReferenceType.INTERFACE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
version = "0.1.0" | ||
|
||
plugins { | ||
id("java-library") | ||
} | ||
import net.labymod.labygradle.common.extension.LabyModAnnotationProcessorExtension.ReferenceType | ||
|
||
dependencies { | ||
labyProcessor() | ||
api(project(":api")) | ||
} | ||
|
||
labyModProcessor { | ||
referenceType = net.labymod.gradle.core.processor.ReferenceType.DEFAULT | ||
implementation("io.netty:netty-buffer:4.1.113.Final") | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
labyModAnnotationProcessor { | ||
referenceType = ReferenceType.DEFAULT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
core/src/main/java/ml/volder/transporter/dev/command/DevCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package ml.volder.transporter.dev.command; | ||
|
||
import ml.volder.transporter.messaging.PluginMessageHandler; | ||
import ml.volder.transporter.messaging.channels.*; | ||
import net.labymod.api.Laby; | ||
import net.labymod.api.client.chat.command.Command; | ||
import net.labymod.api.client.component.Component; | ||
import net.labymod.api.client.component.format.NamedTextColor; | ||
|
||
import java.util.UUID; | ||
import java.util.function.Consumer; | ||
|
||
public class DevCommand extends Command { | ||
|
||
|
||
public DevCommand() { | ||
super("dev", "developer"); | ||
} | ||
|
||
@Override | ||
public boolean execute(String prefix, String[] arguments) { | ||
if(arguments.length >= 1) { | ||
if(arguments[0].equalsIgnoreCase("get")) { | ||
if(arguments.length == 3) { | ||
String item = arguments[1]; | ||
Integer amount = Integer.parseInt(arguments[2]); | ||
PluginMessageHandler.getChannel(GetChannel.class).sendPayload(item, amount); | ||
} | ||
} else if(arguments[0].equalsIgnoreCase("put")) { | ||
if(arguments.length == 3) { | ||
String item = arguments[1]; | ||
Integer amount = Integer.parseInt(arguments[2]); | ||
PluginMessageHandler.getChannel(PutChannel.class).sendPayload(item, amount); | ||
|
||
} | ||
} else if(arguments[0].equalsIgnoreCase("send")) { | ||
if(arguments.length == 4) { | ||
String item = arguments[2]; | ||
Integer amount = Integer.parseInt(arguments[3]); | ||
UUID player = UUID.fromString(arguments[1]); | ||
PluginMessageHandler.getChannel(SendChannel.class).sendPayload(item, amount, player); | ||
} | ||
} else if(arguments[0].equalsIgnoreCase("infoall")) { | ||
PluginMessageHandler.getChannel(InfoAllChannel.class).sendPayload("sand", "stone", "dirt"); | ||
} else if(arguments[0].equalsIgnoreCase("balance")) { | ||
PluginMessageHandler.getChannel(BalanceChannel.class).sendPayload(); | ||
} | ||
} | ||
return true; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
core/src/main/java/ml/volder/transporter/events/TransporterChannelRegisteredEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ml.volder.transporter.events; | ||
|
||
import ml.volder.unikapi.event.Event; | ||
import ml.volder.unikapi.event.EventType; | ||
import ml.volder.unikapi.event.Handler; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class TransporterChannelRegisteredEvent extends Event { | ||
private static List<Handler> handlerList = new ArrayList<>(); | ||
|
||
public TransporterChannelRegisteredEvent(EventType eventType, String eventName) { | ||
super(eventType, eventName); | ||
} | ||
|
||
public TransporterChannelRegisteredEvent(EventType eventType) { | ||
this(eventType, "transporter_channel_registered_event"); | ||
} | ||
|
||
@Override | ||
public List<Handler> getHandlerList() { | ||
return handlerList; | ||
} | ||
|
||
public static List<Handler> getHandlers(){ | ||
return handlerList; | ||
} | ||
} |
Oops, something went wrong.