gros F5
This commit is contained in:
parent
e1f059c93d
commit
a4bb7b6b3e
15
.editorconfig
Normal file
15
.editorconfig
Normal file
|
@ -0,0 +1,15 @@
|
|||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"yaml.schemas": {
|
||||
"https://json.schemastore.org/bukkit-plugin.json": "file:///home/laurent/Documents/Cours/ENSEEIHT/S8%20-%20Mod%C3%A9lisation%20G%C3%A9om%C3%A9trique/proj/src/main/resources/plugin.yml"
|
||||
}
|
||||
"https://json.schemastore.org/bukkit-plugin.json": "${workspaceFolder}/src/main/resources/plugin.yml"
|
||||
},
|
||||
"java.configuration.updateBuildConfiguration": "automatic"
|
||||
}
|
|
@ -2,6 +2,10 @@ plugins {
|
|||
id 'java'
|
||||
}
|
||||
|
||||
jar{
|
||||
destinationDirectory = file("$rootDir/minecraft-server-volume/plugins/")
|
||||
}
|
||||
|
||||
group 'spigot.gradle.project'
|
||||
version '1.0.0'
|
||||
|
||||
|
@ -14,4 +18,4 @@ dependencies {
|
|||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
|
||||
compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,17 @@ version: "3.9"
|
|||
services:
|
||||
minecraft:
|
||||
image: "marctv/minecraft-papermc-server"
|
||||
hostname: mcserver
|
||||
container_name: "mcserver"
|
||||
environment:
|
||||
MEMORYSIZE: "1G"
|
||||
PUID: 1000
|
||||
PGID: 1000
|
||||
volumes:
|
||||
- "./minecraft-server-volume:/data:rw"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
restart: unless-stopped
|
||||
# The following allow `docker attach minecraft` to work
|
||||
stdin_open: true
|
||||
tty: true
|
||||
|
|
32
src/main/java/com/tocard/cam/Camera.java
Normal file
32
src/main/java/com/tocard/cam/Camera.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package com.tocard.cam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Camera extends JavaPlugin implements Listener {
|
||||
|
||||
List<Location> locations;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getServer().getPluginManager().registerEvents(this, this);
|
||||
this.getCommand("point").setExecutor(new NewPoint());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
getLogger().log(Level.INFO, "player joined !");
|
||||
|
||||
}
|
||||
}
|
24
src/main/java/com/tocard/cam/NewPoint.java
Normal file
24
src/main/java/com/tocard/cam/NewPoint.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package com.tocard.cam;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class NewPoint implements CommandExecutor {
|
||||
|
||||
// This method is called, when somebody uses our command
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
|
||||
Location loc = player.getLocation();
|
||||
// System.out.println(loc);
|
||||
|
||||
player.teleport(loc.add(0, 10, 0));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.tocard.minecam;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Camera extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,11 @@
|
|||
name: TocardCam # the plugins name as it should appear in the plugin list /pl
|
||||
main: com.tocard.minecam.Camera
|
||||
main: com.tocard.cam.Camera
|
||||
version: "1.0" # the plugin's version
|
||||
api-version: "1.18" # the version of the API you want to use, required starting with 1.13
|
||||
author: Turbo Tocard
|
||||
description: This plugin is so fucking lit !
|
||||
commands:
|
||||
point:
|
||||
description: Add a new camera point
|
||||
usage: /point
|
||||
permission: com.tocard.cam.addPoint
|
||||
|
|
Loading…
Reference in a new issue