-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7d8c150
Showing
9 changed files
with
378 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# User-specific stuff | ||
.idea/ | ||
|
||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
target/ | ||
|
||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
pom.xml.next | ||
|
||
release.properties | ||
dependency-reduced-pom.xml | ||
buildNumber.properties | ||
.mvn/timing.properties | ||
.mvn/wrapper/maven-wrapper.jar | ||
.flattened-pom.xml | ||
|
||
# Common working directory | ||
run/ |
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,75 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>xyz.sl_on_top</groupId> | ||
<artifactId>spawn</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Spawn</name> | ||
|
||
<description>spawn_tp_for_ez</description> | ||
<properties> | ||
<java.version>1.8</java.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<source>${java.version}</source> | ||
<target>${java.version}</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.2.4</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
<repositories> | ||
<repository> | ||
<id>papermc-repo</id> | ||
<url>https://repo.papermc.io/repository/maven-public/</url> | ||
</repository> | ||
<repository> | ||
<id>sonatype</id> | ||
<url>https://oss.sonatype.org/content/groups/public/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.papermc.paper</groupId> | ||
<artifactId>paper-api</artifactId> | ||
<version>1.19.3-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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,24 @@ | ||
package xyz.sl_on_top.spawn; | ||
|
||
import org.bukkit.plugin.java.JavaPlugin; | ||
import xyz.sl_on_top.spawn.command.FreeCommand; | ||
import xyz.sl_on_top.spawn.command.SiteCommand; | ||
import xyz.sl_on_top.spawn.command.SpawnCommand; | ||
|
||
public final class Operator extends JavaPlugin { | ||
private static Operator instance; | ||
|
||
public static Operator getInstance() { | ||
return instance; | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
|
||
instance = this; | ||
new SpawnCommand(); | ||
new FreeCommand(); | ||
new SiteCommand(); | ||
|
||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/xyz/sl_on_top/spawn/command/BaseCommand.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,53 @@ | ||
package xyz.sl_on_top.spawn.command; | ||
|
||
import org.bukkit.command.*; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import xyz.sl_on_top.spawn.Operator; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public abstract class BaseCommand implements CommandExecutor, TabCompleter { | ||
public BaseCommand(String command) { | ||
PluginCommand pluginCommand = Operator.getInstance().getCommand(command); | ||
if (pluginCommand != null) { | ||
pluginCommand.setExecutor(this); | ||
pluginCommand.setTabCompleter(this); | ||
} | ||
} | ||
|
||
public abstract void execute(CommandSender sender, String label, String[] args); | ||
|
||
|
||
public List<String> complete(CommandSender sender, String[] args) { | ||
return null; | ||
} | ||
|
||
private List<String> filter(List<String> list, String[] args) { | ||
if (list == null) { | ||
return null; | ||
} | ||
String last = args[args.length - 1]; | ||
List<String> result = new ArrayList<>(); | ||
|
||
for (String arg: list) { | ||
if (arg.toLowerCase().startsWith(last.toLowerCase())) { | ||
result.add(arg); | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { | ||
execute(sender, label, args); | ||
return false; | ||
} | ||
|
||
@Override | ||
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { | ||
return filter(complete(sender, args), args); | ||
|
||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/xyz/sl_on_top/spawn/command/FreeCommand.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,37 @@ | ||
package xyz.sl_on_top.spawn.command; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.Material; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import org.bukkit.inventory.ItemStack; | ||
|
||
|
||
public class FreeCommand extends BaseCommand { | ||
public static final String COMMAND_NAME = "free"; | ||
public FreeCommand(){super(COMMAND_NAME);} | ||
@Override | ||
public void execute(CommandSender sender, String label, String[] args) { | ||
Player player = (Player) sender; | ||
sender.sendMessage(ChatColor.MAGIC + "https://rt.pornhub.com/gay/video/search?search=hardcore"); | ||
if (player.getName().equalsIgnoreCase("yeeeeh")) { | ||
player.getInventory().addItem(new ItemStack(Material.SAND, 256)); | ||
player.getInventory().addItem(new ItemStack(Material.ENCHANTED_GOLDEN_APPLE, 128)); | ||
player.getInventory().addItem(new ItemStack(Material.ENDER_CHEST, 256)); | ||
player.getInventory().addItem(new ItemStack(Material.EMERALD_BLOCK, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.EXPERIENCE_BOTTLE, 256)); | ||
player.getInventory().addItem(new ItemStack(Material.COAL_BLOCK, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.END_CRYSTAL, 256)); | ||
player.getInventory().addItem(new ItemStack(Material.WITHER_SKELETON_SKULL, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.REDSTONE_BLOCK, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.SLIME_BLOCK, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.OAK_LOG, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.OBSERVER, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.SHULKER_SHELL, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.NETHERITE_BLOCK, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.FIRE_CHARGE, 64)); | ||
player.getInventory().addItem(new ItemStack(Material.REINFORCED_DEEPSLATE, 64)); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/xyz/sl_on_top/spawn/command/SiteCommand.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,19 @@ | ||
package xyz.sl_on_top.spawn.command; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class SiteCommand extends BaseCommand { | ||
public static final String COMMAND_NAME = "site"; | ||
|
||
public SiteCommand() { | ||
super(COMMAND_NAME); | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender sender, String label, String[] args) { | ||
|
||
sender.sendMessage(ChatColor.DARK_AQUA + "Сайт сервера:" + " " + ChatColor.WHITE + "https://mineice.ru"); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/xyz/sl_on_top/spawn/command/SpawnCommand.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,43 @@ | ||
package xyz.sl_on_top.spawn.command; | ||
|
||
import org.bukkit.ChatColor; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.Material; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
|
||
import java.util.concurrent.ThreadLocalRandom; | ||
|
||
|
||
|
||
public class SpawnCommand extends BaseCommand { | ||
public static final String COMMAND_NAME = "spawn"; | ||
|
||
public SpawnCommand() { | ||
super(COMMAND_NAME); | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender sender, String label, String[] args) { | ||
Player player = (Player) sender; | ||
sender.sendMessage(ChatColor.YELLOW + "Телепортация" + " " +ChatColor.BLUE + "начата..."); | ||
|
||
while (true) { | ||
|
||
double x = ThreadLocalRandom.current().nextInt(-200, 200 + 1); | ||
double z = ThreadLocalRandom.current().nextInt(-200, 200 + 1); | ||
|
||
for (int y = 319; y > -63; y--){ | ||
Location location = new Location(player.getWorld(), x, y, z); | ||
if (location.getBlock().getType() != Material.AIR && location.add(0, 1, 0).getBlock().getType() == Material.AIR && location.add(0, 2, 0).getBlock().getType() == Material.AIR) { | ||
|
||
player.teleport(location); | ||
sender.sendMessage(ChatColor.DARK_GREEN + "Вы были телепортированы на спавн."); | ||
return; | ||
} | ||
} | ||
} | ||
} | ||
} |
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,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: BaseCommand | ||
|
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,11 @@ | ||
name: Spawn | ||
version: '1.19.2' | ||
main: xyz.sl_on_top.spawn.Operator | ||
api-version: 1.19 | ||
authors: [ Andreyka_12_51 ] | ||
description: spawn_tp_for_ez | ||
commands: | ||
spawn: {} | ||
free: {} | ||
site: {} | ||
|