aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-plugin/src/main/java/io/papermc/testplugin/TestPlugin.java
diff options
context:
space:
mode:
Diffstat (limited to 'test-plugin/src/main/java/io/papermc/testplugin/TestPlugin.java')
-rw-r--r--test-plugin/src/main/java/io/papermc/testplugin/TestPlugin.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/test-plugin/src/main/java/io/papermc/testplugin/TestPlugin.java b/test-plugin/src/main/java/io/papermc/testplugin/TestPlugin.java
index 671c37fa40..d6d4e79f7c 100644
--- a/test-plugin/src/main/java/io/papermc/testplugin/TestPlugin.java
+++ b/test-plugin/src/main/java/io/papermc/testplugin/TestPlugin.java
@@ -1,6 +1,13 @@
package io.papermc.testplugin;
+import io.papermc.paper.event.player.ChatEvent;
+import io.papermc.paper.event.world.StructuresLocateEvent;
+import java.util.function.BiFunction;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
+import org.bukkit.generator.structure.Structure;
import org.bukkit.plugin.java.JavaPlugin;
public final class TestPlugin extends JavaPlugin implements Listener {
@@ -10,6 +17,20 @@ public final class TestPlugin extends JavaPlugin implements Listener {
this.getServer().getPluginManager().registerEvents(this, this);
// io.papermc.testplugin.brigtests.Registration.registerViaOnEnable(this);
+ this.test(new Location(null, 0, 0, 0));
+ }
+
+ @EventHandler
+ public void onChat(ChatEvent event) {
+ this.test(event.getPlayer().getLocation());
+ }
+
+ private void test(Location loc) {
+ final BiFunction<Location, Structure, StructuresLocateEvent.Result> biFunction = StructuresLocateEvent.Result::new;
+ final StructuresLocateEvent.Result resultByConstructor = new StructuresLocateEvent.Result(loc, Structure.FORTRESS);
+ System.out.println(resultByConstructor.position());
+ final StructuresLocateEvent.Result result = biFunction.apply(loc, Structure.FORTRESS);
+ System.out.println(result.position());
}
}