mirror of
https://github.com/Aviortheking/Marriage.git
synced 2025-04-22 19:02:15 +00:00
First Commit
This commit is contained in:
parent
91dec66aff
commit
99baa00706
9
.idea/Minecraft-Marriage.iml
generated
Normal file
9
.idea/Minecraft-Marriage.iml
generated
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
42
.idea/misc.xml
generated
Normal file
42
.idea/misc.xml
generated
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ClientPropertiesManager">
|
||||||
|
<properties class="javax.swing.AbstractButton">
|
||||||
|
<property name="hideActionText" class="java.lang.Boolean" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JComponent">
|
||||||
|
<property name="html.disable" class="java.lang.Boolean" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JEditorPane">
|
||||||
|
<property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
|
||||||
|
<property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
|
||||||
|
<property name="charset" class="java.lang.String" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JList">
|
||||||
|
<property name="List.isFileList" class="java.lang.Boolean" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JPasswordField">
|
||||||
|
<property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JSlider">
|
||||||
|
<property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
|
||||||
|
<property name="JSlider.isFilled" class="java.lang.Boolean" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JTable">
|
||||||
|
<property name="Table.isFileList" class="java.lang.Boolean" />
|
||||||
|
<property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
|
||||||
|
<property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JToolBar">
|
||||||
|
<property name="JToolBar.isRollover" class="java.lang.Boolean" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.JTree">
|
||||||
|
<property name="JTree.lineStyle" class="java.lang.String" />
|
||||||
|
</properties>
|
||||||
|
<properties class="javax.swing.text.JTextComponent">
|
||||||
|
<property name="caretAspectRatio" class="java.lang.Double" />
|
||||||
|
<property name="caretWidth" class="java.lang.Integer" />
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||||
|
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/Mariage/Mariage.iml" filepath="$PROJECT_DIR$/Mariage/Mariage.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
13
Mariage/Mariage.iml
Normal file
13
Mariage/Mariage.iml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/ressources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
BIN
Mariage/ressources/Spigot-v1_10_2.jar
Normal file
BIN
Mariage/ressources/Spigot-v1_10_2.jar
Normal file
Binary file not shown.
22
Mariage/src/config.yml
Normal file
22
Mariage/src/config.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
config:
|
||||||
|
#time to let the player answer
|
||||||
|
timeout: 60
|
||||||
|
|
||||||
|
messages:
|
||||||
|
proposition: "Dear %receiver%, \nWould you like to marry me ? \nFrom %sender%. \n(You have %time% seconds to send your answer !) \n(use '/marry accept %player%' to accept the proposition)"
|
||||||
|
# don't touch under this !!!
|
||||||
|
partners: #each players have the sames infos !
|
||||||
|
player:
|
||||||
|
married: false #is the player married ?
|
||||||
|
who: Aviortheking #name of the partner
|
||||||
|
home: # coords of the home
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
world: world
|
||||||
|
propositions:
|
||||||
|
otherplayer: #other player name
|
||||||
|
isblocked: true #if blocked the player won't receive a proposition !
|
||||||
|
timeout: 60 # time before the proposition stop while at 0 the other player can reinvite if not blocked
|
||||||
|
|
||||||
|
|
23
Mariage/src/net/DeltaWings/Minecraft/Marriage/Main.java
Normal file
23
Mariage/src/net/DeltaWings/Minecraft/Marriage/Main.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package net.DeltaWings.Minecraft.Marriage;
|
||||||
|
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Delta Wings on 19/12/2016 at.18:15
|
||||||
|
*/
|
||||||
|
public class Main extends JavaPlugin implements Listener{
|
||||||
|
|
||||||
|
public void onEnable(){
|
||||||
|
getCommand("Marry").setExecutor(new Marry(this));
|
||||||
|
|
||||||
|
//load the config
|
||||||
|
getConfig().options().copyDefaults(true);
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDisable() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
21
Mariage/src/net/DeltaWings/Minecraft/Marriage/Marriage.java
Normal file
21
Mariage/src/net/DeltaWings/Minecraft/Marriage/Marriage.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package net.DeltaWings.Minecraft.Marriage;
|
||||||
|
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Floflo on 19/12/2016.
|
||||||
|
*/
|
||||||
|
public class Marriage implements CommandExecutor {
|
||||||
|
public Marriage(Main main) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
55
Mariage/src/net/DeltaWings/Minecraft/Marriage/Marry.java
Normal file
55
Mariage/src/net/DeltaWings/Minecraft/Marriage/Marry.java
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
package net.DeltaWings.Minecraft.Marriage;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import net.DeltaWings.Minecraft.Marriage.Main;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Floflo on 21/12/2016.
|
||||||
|
*/
|
||||||
|
public class Marry implements CommandExecutor {
|
||||||
|
|
||||||
|
private FileConfiguration config;
|
||||||
|
|
||||||
|
Marry(Main main) {
|
||||||
|
this.config = main.getConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||||
|
if(sender instanceof Player) {
|
||||||
|
Player p = (Player)sender;
|
||||||
|
if(cmd.getName().equalsIgnoreCase("marry")) {
|
||||||
|
if(args.length == 1 && !args[0].equalsIgnoreCase("accept")) {
|
||||||
|
Boolean found = false;
|
||||||
|
for(Player player : Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
if(player.getName().equalsIgnoreCase(args[0])) {
|
||||||
|
found = true;
|
||||||
|
if(!config.getBoolean("partners."+player.getName()+".married")) {
|
||||||
|
//config messages.proposition
|
||||||
|
player.sendMessage(config.getString("messages.proposition".replace("%sender%",p.getName()).replace("%receiver%", player.getName()).replace("%time%",Integer.toString(config.getInt("config.timeout"))).replace("&", "§")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!found) {
|
||||||
|
//send message "Player isn't online or is not correctly typed"
|
||||||
|
p.sendMessage(args[0]+" isn't online or you haven't correctly typed his/her name !");
|
||||||
|
}
|
||||||
|
} else if (args.length == 2 && args[0].equalsIgnoreCase("accept")) {
|
||||||
|
if(config.getInt("partners."+p.getName()+".propositions."+args[1]+".timeout", 0) > 0) {
|
||||||
|
//message you have accepted the proposition
|
||||||
|
//bd %couple has been married !
|
||||||
|
} else {
|
||||||
|
//message the other player haven't send a proposition or the proposition is timed out !
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
9
Mariage/src/plugin.yml
Normal file
9
Mariage/src/plugin.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
name: Marriage
|
||||||
|
version: 0.1.0
|
||||||
|
author: Delta Wings
|
||||||
|
main: net.DeltaWings.Minecraft.Marriage.Main
|
||||||
|
website: http://delta-wings.net/
|
||||||
|
commands:
|
||||||
|
marry:
|
||||||
|
description: Marriage Command
|
||||||
|
usage: /marry
|
BIN
Mariage/tests/Spigot-v1_10_2.jar
Normal file
BIN
Mariage/tests/Spigot-v1_10_2.jar
Normal file
Binary file not shown.
3
Mariage/tests/eula.txt
Normal file
3
Mariage/tests/eula.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
|
||||||
|
#Wed Dec 21 15:20:39 CET 2016
|
||||||
|
eula=true
|
Loading…
x
Reference in New Issue
Block a user