├── MarriageMaster
├── test
│ └── resources
│ │ └── mockito-extensions
│ │ └── org.mockito.plugins.MockMaker
├── resources
│ ├── bungee.yml
│ └── update.yml
└── src
│ └── at
│ └── pcgamingfreaks
│ └── MarriageMaster
│ ├── Bukkit
│ ├── Placeholder
│ │ ├── Replacer
│ │ │ ├── Formatted
│ │ │ │ ├── MarriedTimeFormatted.java
│ │ │ │ ├── SurnameFormatted.java
│ │ │ │ ├── PartnerNameFormatted.java
│ │ │ │ ├── PartnerDisplayNameFormatted.java
│ │ │ │ ├── PartnerCountFormatted.java
│ │ │ │ ├── HomeXFormatted.java
│ │ │ │ ├── HomeYFormatted.java
│ │ │ │ ├── HomeZFormatted.java
│ │ │ │ └── HomeWorldFormatted.java
│ │ │ ├── IsPriest.java
│ │ │ ├── IsMarried.java
│ │ │ ├── PlaceholderReplacerBaseValueHome.java
│ │ │ ├── Heart.java
│ │ │ ├── StatusHeart.java
│ │ │ ├── HasHome.java
│ │ │ ├── PlaceholderReplacerBaseValue.java
│ │ │ ├── Surname.java
│ │ │ ├── Prefix.java
│ │ │ ├── Suffix.java
│ │ │ ├── MultiPartner
│ │ │ │ ├── Formatted
│ │ │ │ │ ├── NearestSurnameFormatted.java
│ │ │ │ │ ├── NearestPartnerNameFormatted.java
│ │ │ │ │ ├── NearestPartnerDisplayNameFormatted.java
│ │ │ │ │ ├── NearestHomeXFormatted.java
│ │ │ │ │ ├── NearestHomeYFormatted.java
│ │ │ │ │ ├── NearestHomeZFormatted.java
│ │ │ │ │ └── NearestHomeWorldFormatted.java
│ │ │ │ ├── NearestHasHome.java
│ │ │ │ ├── NearestSurname.java
│ │ │ │ ├── NearestPrefix.java
│ │ │ │ ├── NearestSuffix.java
│ │ │ │ ├── NearestPartnerName.java
│ │ │ │ ├── NearestHome.java
│ │ │ │ ├── NearestHomeCoordinates.java
│ │ │ │ ├── NearestPartnerDisplayName.java
│ │ │ │ ├── PartnerList.java
│ │ │ │ ├── NearestHomeWorld.java
│ │ │ │ ├── PartnerDisplayNameList.java
│ │ │ │ ├── NearestHomeX.java
│ │ │ │ ├── NearestHomeY.java
│ │ │ │ └── NearestHomeZ.java
│ │ │ ├── MagicHeart.java
│ │ │ ├── Home.java
│ │ │ ├── PartnerCount.java
│ │ │ ├── PartnerName.java
│ │ │ ├── PartnerDisplayName.java
│ │ │ ├── IsInRange.java
│ │ │ ├── HomeCoordinates.java
│ │ │ ├── HomeWorld.java
│ │ │ ├── PlaceholderReplacerBaseBoolean.java
│ │ │ ├── HomeX.java
│ │ │ ├── HomeY.java
│ │ │ └── HomeZ.java
│ │ ├── MarriagePlaceholderReplacer.java
│ │ └── PlaceholderFormatted.java
│ ├── Range.java
│ ├── Listener
│ │ ├── BonusXP
│ │ │ ├── IBonusXpCalculator.java
│ │ │ └── IBonusXpListener.java
│ │ ├── OpenRequestCloser.java
│ │ └── JoinLeaveInfo.java
│ ├── Formatter
│ │ ├── IMarriageAndPartnerFormatter.java
│ │ ├── StaticStringFormatter.java
│ │ └── PlaceholderFormatter.java
│ ├── SurnameConfirmationMode.java
│ ├── Database
│ │ └── MarriageHome.java
│ └── SpecialInfoWorker
│ │ ├── SpecialInfoBase.java
│ │ ├── DbErrorLoadingDataInfo.java
│ │ └── UpgradedInfo.java
│ ├── Database
│ ├── DatabaseElement.java
│ ├── Backend
│ │ └── SQLBasedDatabase.java
│ ├── FilesMigrator
│ │ ├── Home.java
│ │ ├── MigrationPlayer.java
│ │ ├── MigrationMarriage.java
│ │ └── Converter.java
│ ├── Helper
│ │ ├── StructMarriageSQL.java
│ │ ├── DbElementStatementWithKeyRunnable.java
│ │ └── DbElementStatementWithKeyFirstRunnable.java
│ ├── FilteredHashSet.java
│ ├── DatabaseConfiguration.java
│ └── ILanguage.java
│ ├── Placeholder
│ └── Processors
│ │ ├── NamePlaceholderProcessor.java
│ │ └── DisplayNamePlaceholderProcessor.java
│ └── Bungee
│ ├── CommonMessages.java
│ ├── Database
│ └── Language.java
│ └── Listener
│ └── JoinLeaveInfo.java
├── Components
├── MarriageMaster-MagicValues
│ ├── resources
│ │ └── MarriageMaster.properties
│ └── pom.xml
├── MarriageMaster-Bootstrap-Paper
│ └── resources
│ │ └── paper-plugin.yml
├── MarriageMaster-BadRabbit-Bukkit
│ └── pom.xml
└── MarriageMaster-BadRabbit-Bungee
│ └── pom.xml
├── API
├── MarriageMaster-API-Common
│ ├── pom.xml
│ └── src
│ │ └── at
│ │ └── pcgamingfreaks
│ │ └── MarriageMaster
│ │ └── API
│ │ ├── Home.java
│ │ └── DelayableTeleportAction.java
├── MarriageMaster-API-Bungee
│ ├── src
│ │ └── at
│ │ │ └── pcgamingfreaks
│ │ │ └── MarriageMaster
│ │ │ └── Bungee
│ │ │ └── API
│ │ │ ├── Events
│ │ │ ├── MarriageMasterReloadedEvent.java
│ │ │ └── MarriageMasterEvent.java
│ │ │ ├── Marriage.java
│ │ │ ├── DelayableTeleportAction.java
│ │ │ ├── MarriageMasterPlugin.java
│ │ │ ├── CommandManager.java
│ │ │ └── MarriagePlayer.java
│ └── pom.xml
├── MarriageMaster-API-Bukkit
│ ├── src
│ │ └── at
│ │ │ └── pcgamingfreaks
│ │ │ └── MarriageMaster
│ │ │ └── Bukkit
│ │ │ └── API
│ │ │ ├── PrefixSuffixFormatter.java
│ │ │ ├── MarriageManager.java
│ │ │ ├── DelayableTeleportAction.java
│ │ │ ├── Events
│ │ │ ├── MarriageMasterEvent.java
│ │ │ ├── MarriageMasterReloadEvent.java
│ │ │ ├── MarriedPlayerJoinEvent.java
│ │ │ ├── MarriagePlayerJoinEvent.java
│ │ │ ├── MarriagePlayerQuitEvent.java
│ │ │ ├── SurnameChangedEvent.java
│ │ │ ├── MarriedPlayerQuitEvent.java
│ │ │ ├── MarriageMasterCancellableEvent.java
│ │ │ └── SurnameChangeEvent.java
│ │ │ ├── AcceptPendingRequest.java
│ │ │ ├── CommandManager.java
│ │ │ └── Home.java
│ └── pom.xml
├── MarriageMaster-API
│ └── pom.xml
└── pom.xml
└── Extensions
├── MarriageMaster-BackpackIntegration
├── src
│ └── at
│ │ └── pcgamingfreaks
│ │ └── MarriageMaster
│ │ └── Bukkit
│ │ └── BackpackIntegration
│ │ ├── BackpackPluginIncompatibleException.java
│ │ └── IBackpackIntegration.java
└── pom.xml
├── MarriageMaster-MinepacksV2
└── pom.xml
└── MarriageMaster-MinepacksV1
└── pom.xml
/MarriageMaster/test/resources/mockito-extensions/org.mockito.plugins.MockMaker:
--------------------------------------------------------------------------------
1 | mock-maker-inline
--------------------------------------------------------------------------------
/MarriageMaster/resources/bungee.yml:
--------------------------------------------------------------------------------
1 | name: "${project.name}"
2 | author: "${author}"
3 | website: "${project.url}"
4 | main: "${bungeeMainClass}"
5 | version: "${version}"
6 | depends: [${dependencies}]
7 | softdepend: [${soft-dependencies-bungee}]
--------------------------------------------------------------------------------
/Components/MarriageMaster-MagicValues/resources/MarriageMaster.properties:
--------------------------------------------------------------------------------
1 | LanguageFileVersion=${languageFileVersion}
2 | ConfigFileVersion=${configFileVersion}
3 | ConfigFileVersionBungee=${configFileVersionBungee}
4 | PCGFPluginLibVersion=${pcgfPluginLibVersion}
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-API-Common
4 |
5 | MarriageMaster-API-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 |
9 | ${revision}
10 | jar
11 |
12 | MarriageMaster API Common
13 | The common part of the API for the Marriage Master plugin.
14 |
15 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/MarriedTimeFormatted.java:
--------------------------------------------------------------------------------
1 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
2 |
3 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
4 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
5 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
6 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MarriedTime;
7 |
8 | import org.jetbrains.annotations.Nullable;
9 |
10 | @PlaceholderName(name = "MarriedTime", aliases = "Married_Time")
11 | public class MarriedTimeFormatted extends MarriedTime
12 | {
13 | public MarriedTimeFormatted(MarriageMaster plugin)
14 | {
15 | super(plugin);
16 | }
17 |
18 | @Override
19 | protected @Nullable String replaceMarried(MarriagePlayer player)
20 | {
21 | return String.format(formatMain, super.replaceMarried(player));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/src/at/pcgamingfreaks/MarriageMaster/Bungee/API/Events/MarriageMasterReloadedEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.API.Events;
19 |
20 | public class MarriageMasterReloadedEvent extends MarriageMasterEvent
21 | {}
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/src/at/pcgamingfreaks/MarriageMaster/Bungee/API/Events/MarriageMasterEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.API.Events;
19 |
20 | import net.md_5.bungee.api.plugin.Event;
21 |
22 | public class MarriageMasterEvent extends Event
23 | {}
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/DatabaseElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database;
19 |
20 | import org.jetbrains.annotations.Nullable;
21 |
22 | public interface DatabaseElement
23 | {
24 | @Nullable Object getDatabaseKey();
25 | }
--------------------------------------------------------------------------------
/Components/MarriageMaster-MagicValues/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-MagicValues
4 |
5 | MarriageMaster-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 | ../../pom.xml
9 |
10 | ${revision}
11 | jar
12 |
13 | MarriageMaster - Magic Values
14 | Contains the magic values used by Marriage Master.
15 | https://www.spigotmc.org/resources/19273/
16 |
17 |
18 | clean install
19 |
20 |
21 | resources
22 | true
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Components/MarriageMaster-Bootstrap-Paper/resources/paper-plugin.yml:
--------------------------------------------------------------------------------
1 | name: "MarriageMaster"
2 | author: "GeorgH93"
3 | version: "${version}"
4 | api-version: "1.19"
5 |
6 | main: "at.pcgamingfreaks.MarriageMasterStandalone.Bukkit.MarriageMaster"
7 | bootstrapper: "at.pcgamingfreaks.MarriageMaster.Paper.MarriageMasterBootstrap"
8 |
9 | has-open-classloader: true
10 |
11 | dependencies:
12 | - name: PCGF_PluginLib
13 | required: false
14 | bootstrap: true
15 | - name: Vault
16 | required: false
17 | - name: Minepacks
18 | required: false
19 | - name: MVdWPlaceholderAPI
20 | required: false
21 | - name: PlaceholderAPI
22 | required: false
23 | - name: SkillAPI
24 | required: false
25 | - name: mcMMO
26 | required: false
27 | - name: Multiverse-Core
28 | required: false
29 |
30 | load-after:
31 | - name: PCGF_PluginLib
32 | bootstrap: true
33 | - name: Minepacks
34 | - name: Vault
35 | - name: MVdWPlaceholderAPI
36 | - name: PlaceholderAPI
37 | - name: SkillAPI
38 | - name: mcMMO
39 | - name: Multiverse-Core
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Range.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit;
19 |
20 | public enum Range
21 | {
22 | Marry,
23 | Divorce,
24 | Backpack,
25 | Gift,
26 | Kiss,
27 | KissInteract,
28 | Hug,
29 | HearthVisible,
30 | HugParticleVisible,
31 | BonusXP,
32 | Heal
33 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/PrefixSuffixFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
19 |
20 | public interface PrefixSuffixFormatter
21 | {
22 | String formatPrefix(Marriage marriage, MarriagePlayer partner);
23 |
24 | String formatSuffix(Marriage marriage, MarriagePlayer partner);
25 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Listener/BonusXP/IBonusXpCalculator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Listener.BonusXP;
19 |
20 | import org.bukkit.entity.Player;
21 |
22 | public interface IBonusXpCalculator
23 | {
24 | void process(EVENT event, Player eventPlayer, double xp, XP_TYPE xpType);
25 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/src/at/pcgamingfreaks/MarriageMaster/Bungee/API/Marriage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.API;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.API.Home;
21 |
22 | import net.md_5.bungee.api.CommandSender;
23 |
24 | public interface Marriage extends at.pcgamingfreaks.MarriageMaster.API.Marriage {}
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-API-Bungee
4 |
5 | MarriageMaster-API-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 |
9 | ${revision}
10 | jar
11 |
12 | MarriageMaster API Bungee
13 | The API for the Marriage Master BungeeCord plugin.
14 |
15 |
16 |
17 | at.pcgamingfreaks
18 | MarriageMaster-API-Common
19 | ${revision}
20 |
21 |
22 |
23 | net.md-5
24 | bungeecord-api
25 | ${bungeeVersion}
26 | provided
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-API-Bukkit
4 |
5 | MarriageMaster-API-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 |
9 | ${revision}
10 | jar
11 |
12 | MarriageMaster API Bukkit
13 | The API for the Marriage Master Bukkit/Spigot/Paper plugin.
14 |
15 |
16 |
17 | at.pcgamingfreaks
18 | MarriageMaster-API-Common
19 | ${revision}
20 |
21 |
22 |
23 | org.bukkit
24 | bukkit
25 | ${bukkitVersion}
26 | provided
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/Backend/SQLBasedDatabase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.Backend;
19 |
20 | import java.sql.Connection;
21 | import java.sql.SQLException;
22 | import java.util.logging.Logger;
23 |
24 | public interface SQLBasedDatabase
25 | {
26 | Logger getLogger();
27 |
28 | Connection getConnection() throws SQLException;
29 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/FilesMigrator/Home.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.FilesMigrator;
19 |
20 | public class Home
21 | {
22 | public double x, y, z;
23 | public String world;
24 |
25 | public Home(double x, double y, double z, String world)
26 | {
27 | this.x = x;
28 | this.y = y;
29 | this.z = z;
30 | this.world = world;
31 | }
32 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/MarriagePlaceholderReplacer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderReplacer;
21 |
22 | import org.jetbrains.annotations.Nullable;
23 |
24 | public interface MarriagePlaceholderReplacer extends PlaceholderReplacer
25 | {
26 | @Nullable String getFormat();
27 | }
28 |
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/MarriageManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
19 |
20 | import org.bukkit.command.CommandSender;
21 | import org.bukkit.entity.Player;
22 |
23 | @SuppressWarnings("unused")
24 | public interface MarriageManager extends at.pcgamingfreaks.MarriageMaster.API.MarriageManager
25 | {}
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/DelayableTeleportAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
19 |
20 | /**
21 | * The interface defines all the functions used for a delayed teleport with health/move check.
22 | */
23 | @SuppressWarnings("unused")
24 | public interface DelayableTeleportAction extends at.pcgamingfreaks.MarriageMaster.API.DelayableTeleportAction
25 | {}
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/src/at/pcgamingfreaks/MarriageMaster/Bungee/API/DelayableTeleportAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.API;
19 |
20 | /**
21 | * The interface defines all the functions used for a delayed teleport with health/move check.
22 | */
23 | @SuppressWarnings("unused")
24 | public interface DelayableTeleportAction extends at.pcgamingfreaks.MarriageMaster.API.DelayableTeleportAction
25 | {}
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/src/at/pcgamingfreaks/MarriageMaster/Bungee/API/MarriageMasterPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.API;
19 |
20 | import net.md_5.bungee.api.connection.ProxiedPlayer;
21 |
22 | @SuppressWarnings("unused")
23 | public interface MarriageMasterPlugin extends at.pcgamingfreaks.MarriageMaster.API.MarriageMasterPlugin
24 | {}
--------------------------------------------------------------------------------
/Extensions/MarriageMaster-BackpackIntegration/src/at/pcgamingfreaks/MarriageMaster/Bukkit/BackpackIntegration/BackpackPluginIncompatibleException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.BackpackIntegration;
19 |
20 | import org.jetbrains.annotations.NotNull;
21 |
22 | public class BackpackPluginIncompatibleException extends RuntimeException
23 | {
24 | public BackpackPluginIncompatibleException(final @NotNull String message)
25 | {
26 | super(message);
27 | }
28 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Formatter/IMarriageAndPartnerFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Formatter;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 |
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | public interface IMarriageAndPartnerFormatter
26 | {
27 | @NotNull String format(final @NotNull Marriage marriage, final @NotNull MarriagePlayer partner);
28 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/MarriageMasterEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import org.bukkit.event.Event;
21 |
22 | /**
23 | * Base class of all events fired by the Marriage Master plugin
24 | */
25 | public abstract class MarriageMasterEvent extends Event
26 | {
27 | protected MarriageMasterEvent()
28 | {
29 | super();
30 | }
31 |
32 | protected MarriageMasterEvent(boolean async)
33 | {
34 | super(async);
35 | }
36 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/FilesMigrator/MigrationPlayer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.FilesMigrator;
19 |
20 | public class MigrationPlayer
21 | {
22 | public String name, uuid;
23 | public boolean priest, shareBackpack;
24 | public int id = -1;
25 |
26 | public MigrationPlayer(String name, String uuid, boolean priest, boolean shareBackpack)
27 | {
28 | this.name = name;
29 | this.uuid = uuid;
30 | this.priest = priest;
31 | this.shareBackpack = shareBackpack;
32 | }
33 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/IsPriest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
21 |
22 | import org.bukkit.OfflinePlayer;
23 |
24 | public class IsPriest extends PlaceholderReplacerBaseBoolean
25 | {
26 | public IsPriest(MarriageMaster plugin)
27 | {
28 | super(plugin);
29 | }
30 |
31 | @Override
32 | public String replace(OfflinePlayer player)
33 | {
34 | return toString(plugin.getPlayerData(player).isPriest());
35 | }
36 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/IsMarried.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
21 |
22 | import org.bukkit.OfflinePlayer;
23 |
24 | public class IsMarried extends PlaceholderReplacerBaseBoolean
25 | {
26 | public IsMarried(MarriageMaster plugin)
27 | {
28 | super(plugin);
29 | }
30 |
31 | @Override
32 | public String replace(OfflinePlayer player)
33 | {
34 | return toString(plugin.getPlayerData(player).isMarried());
35 | }
36 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/src/at/pcgamingfreaks/MarriageMaster/Bungee/API/CommandManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.API;
19 |
20 | import net.md_5.bungee.api.CommandSender;
21 |
22 | /**
23 | * The command manager is responsible for managing all the command stuff of the plugin.
24 | * It provides functions to register/unregister sub-commands, requests that need to be accepted and switches translated in the language file.
25 | */
26 | @SuppressWarnings("unused")
27 | public interface CommandManager extends at.pcgamingfreaks.MarriageMaster.API.CommandManager
28 | {}
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Listener/BonusXP/IBonusXpListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Listener.BonusXP;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 |
23 | import org.bukkit.entity.Player;
24 |
25 | public interface IBonusXpListener
26 | {
27 | void setEventExp(EVENT event, double xp, XP_TYPE xpType, MarriagePlayer player, Marriage marriage);
28 |
29 | void splitWithPartner(EVENT event, Player partner, double xp, XP_TYPE xpType, MarriagePlayer player, Marriage marriage);
30 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/FilesMigrator/MigrationMarriage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.FilesMigrator;
19 |
20 | public class MigrationMarriage
21 | {
22 | public MigrationPlayer player1, player2, priest;
23 | public String surname;
24 | public boolean pvpState;
25 | public Home home;
26 | public int id;
27 |
28 | public MigrationMarriage(MigrationPlayer p1, MigrationPlayer p2, MigrationPlayer p, String surname, boolean pvp, Home h)
29 | {
30 | player1 = p1;
31 | player2 = p2;
32 | priest = p;
33 | this.surname = surname;
34 | pvpState = pvp;
35 | home = h;
36 | id = -1;
37 | }
38 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/SurnameConfirmationMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2025 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit;
19 |
20 | import java.util.Locale;
21 |
22 | public enum SurnameConfirmationMode
23 | {
24 | None,
25 | Player,
26 | BothPlayers,
27 | //TODO
28 | //Admin,
29 | //Priest,
30 | //PlayerOrPriest,
31 | //BothPlayersOrPriest
32 | ;
33 |
34 | public static SurnameConfirmationMode formString(String mode)
35 | {
36 | if(mode == null) return None;
37 | mode = mode.toLowerCase(Locale.ENGLISH);
38 | if(mode.equals("player")) return Player;
39 | else if(mode.equals("both") || mode.equals("bothplayers")) return BothPlayers;
40 | return None;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/PlaceholderReplacerBaseValueHome.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
21 |
22 | import org.jetbrains.annotations.NotNull;
23 |
24 | public abstract class PlaceholderReplacerBaseValueHome extends PlaceholderReplacerBaseValue
25 | {
26 | private static final String PLACEHOLDER_NO_HOME_KEY = "NoHome";
27 | protected final String valueNoHome;
28 |
29 | protected PlaceholderReplacerBaseValueHome(@NotNull MarriageMaster plugin)
30 | {
31 | super(plugin);
32 | valueNoHome = getPlaceholderValue(PLACEHOLDER_NO_HOME_KEY);
33 | }
34 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Formatter/StaticStringFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Formatter;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 |
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | public class StaticStringFormatter implements IMarriageAndPartnerFormatter
26 | {
27 | private final String string;
28 |
29 | public StaticStringFormatter(final @NotNull String str)
30 | {
31 | string = str;
32 | }
33 |
34 | @Override
35 | public @NotNull String format(final @NotNull Marriage marriage, final @NotNull MarriagePlayer partner)
36 | {
37 | return string;
38 | }
39 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Heart.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 |
24 | import org.jetbrains.annotations.Nullable;
25 |
26 | @PlaceholderName(aliases = "Married")
27 | public class Heart extends PlaceholderReplacerBaseValue
28 | {
29 | public Heart(MarriageMaster plugin)
30 | {
31 | super(plugin);
32 | }
33 |
34 | @Override
35 | protected @Nullable String replaceMarried(MarriagePlayer player)
36 | {
37 | return valueMarried;
38 | }
39 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/MarriageMasterReloadEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import org.bukkit.event.HandlerList;
21 | import org.jetbrains.annotations.NotNull;
22 |
23 | /**
24 | * Event is fired when the plugin was reloaded.
25 | */
26 | @SuppressWarnings("unused")
27 | public class MarriageMasterReloadEvent extends MarriageMasterEvent
28 | {
29 | // Bukkit handler stuff
30 | private static final HandlerList handlers = new HandlerList();
31 |
32 | @Override
33 | public @NotNull HandlerList getHandlers()
34 | {
35 | return getHandlerList();
36 | }
37 |
38 | public static HandlerList getHandlerList()
39 | {
40 | return handlers;
41 | }
42 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/StatusHeart.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 |
24 | import org.jetbrains.annotations.Nullable;
25 |
26 | @PlaceholderName(aliases = "Status_Heart")
27 | public class StatusHeart extends PlaceholderReplacerBaseValue
28 | {
29 | public StatusHeart(MarriageMaster plugin)
30 | {
31 | super(plugin);
32 | }
33 |
34 | @Override
35 | protected @Nullable String replaceMarried(MarriagePlayer player)
36 | {
37 | return valueMarried;
38 | }
39 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/AcceptPendingRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
19 |
20 | import org.jetbrains.annotations.NotNull;
21 |
22 | @SuppressWarnings("unused")
23 | public abstract class AcceptPendingRequest extends at.pcgamingfreaks.MarriageMaster.API.AcceptPendingRequest
24 | {
25 | /**
26 | * Creates a new instance of an {@link AcceptPendingRequest}.
27 | *
28 | * @param hasToAccept The player that has to accept the request.
29 | * @param canCancel The players that can cancel the request.
30 | */
31 | protected AcceptPendingRequest(@NotNull MarriagePlayer hasToAccept, @NotNull MarriagePlayer... canCancel)
32 | {
33 | super(hasToAccept, canCancel);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/MarriageMaster/resources/update.yml:
--------------------------------------------------------------------------------
1 | UpdateProviders:
2 | Bukkit:
3 | Type: Bukkit
4 | ProjectId: 74734
5 | Spigot:
6 | Type: Spigot
7 | ProjectId: 19273
8 | Filename: "marriagemaster.jar"
9 | GitHub:
10 | Type: GitHub
11 | Owner: GeorgH93
12 | Repo: MarriageMaster
13 | GitHubStandalone:
14 | Type: GitHub
15 | Owner: GeorgH93
16 | Repo: MarriageMaster
17 | JarSearch: ".*-Standalone\\.jar"
18 | GitHubRelease:
19 | Type: GitHub
20 | Owner: GeorgH93
21 | Repo: MarriageMaster
22 | JarSearch: ".*-Release\\.jar"
23 | JenkinsMaster:
24 | Type: Jenkins
25 | Server: "https://ci.pcgamingfreaks.at"
26 | Job: "MarriageMaster"
27 | JenkinsMasterStandalone:
28 | Type: Jenkins
29 | Server: "https://ci.pcgamingfreaks.at"
30 | Job: "MarriageMaster"
31 | Filter: ".*-Standalone.jar"
32 | JenkinsMasterRelease:
33 | Type: Jenkins
34 | Server: "https://ci.pcgamingfreaks.at"
35 | Job: "MarriageMaster"
36 | Filter: ".*-Release.jar"
37 | JenkinsDev:
38 | Type: Jenkins
39 | Server: "https://ci.pcgamingfreaks.at"
40 | Job: "MarriageMaster Dev"
41 |
42 | UpdateChannels:
43 | Release:
44 | Release: [ Bukkit, GitHubRelease, Spigot ]
45 | Standalone: [ GitHubStandalone ]
46 | Normal: [ GitHub ]
47 | Master:
48 | Release: [ JenkinsMasterRelease ]
49 | Standalone: [ JenkinsMasterStandalone ]
50 | Normal: [ JenkinsMaster ]
51 | Dev:
52 | Normal: [ JenkinsDev ]
53 |
54 | DefaultChannel: "${updateChannel}"
55 | ReleaseType: "${releaseType}"
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Placeholder/Processors/NamePlaceholderProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Placeholder.Processors;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Database.MarriagePlayerDataBase;
21 | import at.pcgamingfreaks.Message.Placeholder.Processors.IPlaceholderProcessor;
22 |
23 | import org.jetbrains.annotations.NotNull;
24 | import org.jetbrains.annotations.Nullable;
25 |
26 | public class NamePlaceholderProcessor implements IPlaceholderProcessor
27 | {
28 | public static final NamePlaceholderProcessor INSTANCE = new NamePlaceholderProcessor();
29 |
30 | @Override
31 | public @NotNull String process(@Nullable Object parameter)
32 | {
33 | if (parameter == null) return "null";
34 | return ((MarriagePlayerDataBase) parameter).getName();
35 | }
36 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/HasHome.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 |
24 | import org.jetbrains.annotations.Nullable;
25 |
26 | @PlaceholderName(aliases = "Has_Home")
27 | public class HasHome extends PlaceholderReplacerBaseBoolean
28 | {
29 | public HasHome(MarriageMaster plugin)
30 | {
31 | super(plugin);
32 | }
33 |
34 | @Override
35 | protected @Nullable String replaceMarried(MarriagePlayer player)
36 | {
37 | //noinspection ConstantConditions
38 | return toString(player.getMarriageData().isHomeSet());
39 | }
40 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Common/src/at/pcgamingfreaks/MarriageMaster/API/Home.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.API;
19 |
20 | import org.jetbrains.annotations.NotNull;
21 | import org.jetbrains.annotations.Nullable;
22 |
23 | import lombok.AllArgsConstructor;
24 | import lombok.Getter;
25 |
26 | @AllArgsConstructor
27 | public class Home
28 | {
29 | @Getter private final @NotNull String worldName;
30 | private final @Nullable String homeServer;
31 | @Getter private final double x, y, z;
32 | @Getter private final float yaw, pitch;
33 |
34 | /**
35 | * Gets the server of the represented home.
36 | *
37 | * @return The name of the server where the home is located. Null if BungeeCord is not used.
38 | */
39 | @SuppressWarnings("unused")
40 | public @Nullable String getHomeServer()
41 | {
42 | return homeServer;
43 | }
44 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/Helper/StructMarriageSQL.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.Helper;
19 |
20 | import at.pcgamingfreaks.Message.MessageColor;
21 |
22 | import java.util.Date;
23 |
24 | public class StructMarriageSQL
25 | {
26 | public int marryID, p1ID, p2ID, priest;
27 | public boolean pvp;
28 | public MessageColor color;
29 | public String surname;
30 | public Date date;
31 |
32 | public StructMarriageSQL(int id, int p1, int p2, int priest, boolean pvp, String color, String surname, java.sql.Timestamp date)
33 | {
34 | marryID = id;
35 | p1ID = p1;
36 | p2ID = p2;
37 | this.priest = priest;
38 | this.pvp = pvp;
39 | this.color = color == null ? null : MessageColor.valueOf(color);
40 | this.surname = surname;
41 | this.date = new Date(date.getTime());
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/PlaceholderReplacerBaseValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
21 |
22 | import org.jetbrains.annotations.NotNull;
23 | import org.jetbrains.annotations.Nullable;
24 |
25 | public abstract class PlaceholderReplacerBaseValue extends PlaceholderReplacerBase
26 | {
27 | private static final String PLACEHOLDER_MARRIED_KEY = "Married";
28 | protected final String valueMarried;
29 |
30 | protected PlaceholderReplacerBaseValue(@NotNull MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | valueMarried = getPlaceholderValue(PLACEHOLDER_MARRIED_KEY);
34 | }
35 |
36 | @Override
37 | public @Nullable String getFormat()
38 | {
39 | return valueMarried;
40 | }
41 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/PlaceholderFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
21 |
22 | import org.intellij.lang.annotations.RegExp;
23 |
24 | import java.lang.annotation.ElementType;
25 | import java.lang.annotation.Retention;
26 | import java.lang.annotation.RetentionPolicy;
27 | import java.lang.annotation.Target;
28 |
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target(ElementType.TYPE)
31 | public @interface PlaceholderFormatted
32 | {
33 | Class extends PlaceholderReplacerBaseValue> formattedClass();
34 | @SuppressWarnings("SpellCheckingInspection") @RegExp String formatRuleDetectionRegex() default ".*%(?:\\d+\\$)?[+-]?(?:[ 0]|'.{1})?-?\\d*(?:\\.\\d+)?[bcdeEufFgGosxX].*";
35 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/SurnameFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Surname;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(name = "Surname")
28 | public class SurnameFormatted extends Surname
29 | {
30 | public SurnameFormatted(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | return String.format(valueMarried, super.replaceMarried(player));
39 | }
40 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/PartnerNameFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PartnerName;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(name = "PartnerName", aliases = { "Partner", "Partner_Name" })
28 | public class PartnerNameFormatted extends PartnerName
29 | {
30 | public PartnerNameFormatted(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | return String.format(valueMarried, super.replaceMarried(player));
39 | }
40 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Surname.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.SurnameFormatted;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderFormatted(formattedClass = SurnameFormatted.class)
28 | public class Surname extends PlaceholderReplacerBaseValue
29 | {
30 | public Surname(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | //noinspection ConstantConditions
39 | return player.getMarriageData().getSurnameString();
40 | }
41 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bungee/src/at/pcgamingfreaks/MarriageMaster/Bungee/API/MarriagePlayer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.API;
19 |
20 | import net.md_5.bungee.api.connection.ProxiedPlayer;
21 |
22 | import org.jetbrains.annotations.NotNull;
23 | import org.jetbrains.annotations.Nullable;
24 |
25 | public interface MarriagePlayer extends at.pcgamingfreaks.MarriageMaster.API.MarriagePlayer
26 | {
27 | /**
28 | * Gets the ProxiedPlayer that is represented by this marriage player data.
29 | *
30 | * @return The ProxiedPlayer represented by this marriage player. null if offline.
31 | */
32 | @Nullable ProxiedPlayer getPlayer();
33 |
34 | boolean canSee(ProxiedPlayer player);
35 |
36 | /**
37 | * Checks if the player is married to a given player.
38 | *
39 | * @param player The player to be checked.
40 | * @return True if they are married. False if not.
41 | */
42 | boolean isPartner(@NotNull ProxiedPlayer player);
43 | }
--------------------------------------------------------------------------------
/Components/MarriageMaster-BadRabbit-Bukkit/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-BadRabbit-Bukkit
4 |
5 | MarriageMaster-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 | ../../pom.xml
9 |
10 | ${revision}
11 | jar
12 |
13 | MarriageMaster - BadRabbit-Bukkit
14 | BadRabbit loader for MarriageMaster.
15 | https://www.spigotmc.org/resources/19273/
16 |
17 |
18 |
19 | at.pcgamingfreaks
20 | MarriageMaster-MagicValues
21 | ${revision}
22 | provided
23 |
24 |
25 | at.pcgamingfreaks.pcgf_pluginlib
26 | pcgf_pluginlib-version
27 | ${pcgfPluginLibVersion}
28 | provided
29 |
30 |
31 |
32 | at.pcgamingfreaks
33 | BadRabbit-Bukkit
34 | 1.11
35 | provided
36 |
37 |
38 |
39 | org.bukkit
40 | bukkit
41 | ${bukkitVersion}
42 | provided
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Components/MarriageMaster-BadRabbit-Bungee/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-BadRabbit-Bungee
4 |
5 | MarriageMaster-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 | ../../pom.xml
9 |
10 | ${revision}
11 | jar
12 |
13 | MarriageMaster - BadRabbit-Bungee
14 | BadRabbit loader for MarriageMaster.
15 | https://www.spigotmc.org/resources/19273/
16 |
17 |
18 |
19 | at.pcgamingfreaks
20 | MarriageMaster-MagicValues
21 | ${revision}
22 | provided
23 |
24 |
25 | at.pcgamingfreaks.pcgf_pluginlib
26 | pcgf_pluginlib-version
27 | ${pcgfPluginLibVersion}
28 | provided
29 |
30 |
31 |
32 | at.pcgamingfreaks
33 | BadRabbit-Bungee
34 | 1.11
35 | provided
36 |
37 |
38 |
39 | net.md-5
40 | bungeecord-api
41 | ${bungeeVersion}
42 | provided
43 |
44 |
45 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Listener/OpenRequestCloser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Listener;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.AcceptPendingRequest;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events.MarriagePlayerQuitEvent;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 |
24 | import org.bukkit.event.EventHandler;
25 | import org.bukkit.event.EventPriority;
26 | import org.bukkit.event.Listener;
27 |
28 | public class OpenRequestCloser implements Listener
29 | {
30 | @EventHandler(priority = EventPriority.NORMAL)
31 | public void onLeave(MarriagePlayerQuitEvent event)
32 | {
33 | MarriagePlayer player = event.getPlayer();
34 | if(player.getOpenRequest() != null)
35 | {
36 | player.getOpenRequest().disconnect(player);
37 | }
38 | for(AcceptPendingRequest request : player.getRequestsToCancel())
39 | {
40 | request.disconnect(player);
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/PartnerDisplayNameFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PartnerDisplayName;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(name = "PartnerDisplayName", aliases = "Partner_DisplayName")
28 | public class PartnerDisplayNameFormatted extends PartnerDisplayName
29 | {
30 | public PartnerDisplayNameFormatted(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | return String.format(valueMarried, super.replaceMarried(player));
39 | }
40 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Prefix.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.PrefixSuffixFormatter;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | public class Prefix extends PlaceholderReplacerBaseValue
28 | {
29 | private final PrefixSuffixFormatter formatter;
30 |
31 | public Prefix(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | formatter = plugin.getPrefixSuffixFormatter();
35 | }
36 |
37 | @Override
38 | protected @Nullable String replaceMarried(MarriagePlayer player)
39 | {
40 | Marriage marriage = player.getMarriageData();
41 | return formatter.formatPrefix(marriage, marriage.getPartner(player));
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Suffix.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.PrefixSuffixFormatter;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | public class Suffix extends PlaceholderReplacerBaseValue
28 | {
29 | private final PrefixSuffixFormatter formatter;
30 |
31 | public Suffix(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | formatter = plugin.getPrefixSuffixFormatter();
35 | }
36 |
37 | @Override
38 | protected @Nullable String replaceMarried(MarriagePlayer player)
39 | {
40 | Marriage marriage = player.getMarriageData();
41 | return formatter.formatSuffix(marriage, marriage.getPartner(player));
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/Formatted/NearestSurnameFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.NearestSurname;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(name = "NearestSurname", aliases = "Nearest_Surname")
28 | public class NearestSurnameFormatted extends NearestSurname
29 | {
30 | public NearestSurnameFormatted(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | return String.format(valueMarried, super.replaceMarried(player));
39 | }
40 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/CommandManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
19 |
20 | import org.bukkit.command.CommandSender;
21 | import org.jetbrains.annotations.NotNull;
22 |
23 | /**
24 | * The command manager is responsible for managing all the command stuff of the plugin.
25 | * It provides functions to register/unregister sub-commands, requests that need to be accepted and switches translated in the language file.
26 | */
27 | @SuppressWarnings("unused")
28 | public interface CommandManager extends at.pcgamingfreaks.MarriageMaster.API.CommandManager
29 | {
30 | /**
31 | * Registers an accept pending request.
32 | *
33 | * @param request The request to be registered.
34 | * @return True if it was possible to register the request (the person to accept has no open requests or is online). False if not.
35 | */
36 | boolean registerAcceptPendingRequest(@NotNull AcceptPendingRequest request);
37 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MagicHeart.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Database.MarriageData;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(aliases = { "Magic_Heart", "ColorHeart", "Color_Heart", "ColoredHeart", "Colored_Heart" })
28 | public class MagicHeart extends PlaceholderReplacerBaseValue
29 | {
30 | public MagicHeart(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | //noinspection ConstantConditions,RedundantCast
39 | return ((MarriageData) player.getMarriageData()).getColor() + valueMarried;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/PartnerCountFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
24 |
25 | import org.bukkit.OfflinePlayer;
26 |
27 | @PlaceholderName(name = "PartnerCount", aliases = "Partner_Count")
28 | public class PartnerCountFormatted extends PlaceholderReplacerBaseValue
29 | {
30 | public PartnerCountFormatted(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | public String replace(OfflinePlayer player)
37 | {
38 | MarriagePlayer playerData = plugin.getPlayerData(player);
39 | return String.format(valueMarried, playerData.getPartners().size());
40 | }
41 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Formatter/PlaceholderFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Formatter;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Database.MarriageData;
23 | import at.pcgamingfreaks.MarriageMaster.MagicValues;
24 |
25 | import org.jetbrains.annotations.NotNull;
26 |
27 | public class PlaceholderFormatter implements IMarriageAndPartnerFormatter
28 | {
29 | private final String format;
30 |
31 | public PlaceholderFormatter(final @NotNull String format)
32 | {
33 | this.format = format;
34 | }
35 |
36 | @Override
37 | public @NotNull String format(final @NotNull Marriage marriage, final @NotNull MarriagePlayer partner)
38 | {
39 | return String.format(format, marriage.getSurnameString(), partner.getName(), partner.getDisplayName(), ((MarriageData)marriage).getColor() + MagicValues.HEART_AND_RESET);
40 | }
41 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestHasHome.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseBoolean;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(aliases = { "HasNearestHome", "Has_Nearest_Home", "Nearest_Has_Home" })
28 | public class NearestHasHome extends PlaceholderReplacerBaseBoolean
29 | {
30 | public NearestHasHome(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | //noinspection ConstantConditions
39 | return toString(player.getNearestPartnerMarriageData().isHomeSet());
40 | }
41 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Home.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 |
24 | import org.bukkit.Location;
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | public class Home extends PlaceholderReplacerBaseValueHome
28 | {
29 | public Home(MarriageMaster plugin)
30 | {
31 | super(plugin);
32 | }
33 |
34 | @Override
35 | protected @Nullable String replaceMarried(MarriagePlayer player)
36 | {
37 | Marriage marriageData = player.getMarriageData();
38 | if(marriageData != null && marriageData.isHomeSet())
39 | {
40 | Location location = marriageData.getHome().getLocation();
41 | return String.format(valueMarried, location.getWorld().getName(), location.getX(), location.getY(), location.getZ());
42 | }
43 | return valueNoHome;
44 | }
45 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/Formatted/NearestPartnerNameFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.NearestPartnerName;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(name = "NearestPartnerName", aliases = { "Nearest_PartnerName", "Nearest_Partner_Name" })
28 | public class NearestPartnerNameFormatted extends NearestPartnerName
29 | {
30 | public NearestPartnerNameFormatted(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | return String.format(valueMarried, super.replaceMarried(player));
39 | }
40 | }
--------------------------------------------------------------------------------
/Extensions/MarriageMaster-MinepacksV2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-MinepacksV2
4 |
5 | MarriageMaster-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 | ../../pom.xml
9 |
10 | ${revision}
11 | jar
12 |
13 | MarriageMaster Minepacks V2.x integration
14 | The Minepacks integration of Marriage Master.
15 |
16 |
17 |
18 |
19 | org.bukkit
20 | bukkit
21 | ${bukkitVersion}
22 | provided
23 |
24 |
25 |
26 | at.pcgamingfreaks
27 | MarriageMaster-BackpackIntegration
28 | ${revision}
29 |
30 |
31 |
32 | at.pcgamingfreaks
33 | PluginLib
34 | 1.0.15
35 | provided
36 |
37 |
38 |
39 | at.pcgamingfreaks
40 | Minepacks-API
41 | 2.3.21
42 | provided
43 |
44 |
45 |
46 |
47 | clean install
48 | src
49 |
50 |
51 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/PartnerCount.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.PartnerCountFormatted;
25 |
26 | import org.bukkit.OfflinePlayer;
27 |
28 | @PlaceholderName(aliases = "Partner_Count")
29 | @PlaceholderFormatted(formattedClass = PartnerCountFormatted.class)
30 | public class PartnerCount extends PlaceholderReplacerBaseValue
31 | {
32 | public PartnerCount(MarriageMaster plugin)
33 | {
34 | super(plugin);
35 | }
36 |
37 | @Override
38 | public String replace(OfflinePlayer player)
39 | {
40 | MarriagePlayer playerData = plugin.getPlayerData(player);
41 | return playerData.getPartners().size() + "";
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/PartnerName.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.PartnerNameFormatted;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(aliases = { "Partner", "Partner_Name" })
29 | @PlaceholderFormatted(formattedClass = PartnerNameFormatted.class)
30 | public class PartnerName extends PlaceholderReplacerBaseValue
31 | {
32 | public PartnerName(MarriageMaster plugin)
33 | {
34 | super(plugin);
35 | }
36 |
37 | @Override
38 | protected @Nullable String replaceMarried(MarriagePlayer player)
39 | {
40 | //noinspection ConstantConditions
41 | return player.getPartner().getName();
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Database/MarriageHome.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Database;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Home;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Listener.PluginChannelCommunicator;
22 |
23 | import org.bukkit.Location;
24 |
25 | import java.util.Objects;
26 |
27 | /**
28 | * Just a helper class that sets the server name for us
29 | */
30 | public class MarriageHome extends Home
31 | {
32 | public MarriageHome(Location location)
33 | {
34 | super(location, PluginChannelCommunicator.getServerName());
35 | }
36 |
37 | public MarriageHome(Location location, String homeServer)
38 | {
39 | super(location, homeServer);
40 | }
41 |
42 | public MarriageHome(String worldName, double x, double y, double z, float yaw, float pitch, String homeServer)
43 | {
44 | super(worldName, homeServer, x, y, z, yaw, pitch);
45 | }
46 |
47 | @Override
48 | public boolean isOnThisServer()
49 | {
50 | return Objects.equals(getHomeServer(), PluginChannelCommunicator.getServerName());
51 | }
52 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/MarriedPlayerJoinEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
21 |
22 | import org.bukkit.event.HandlerList;
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | import lombok.AllArgsConstructor;
26 |
27 | /**
28 | * Event is fired when a married player joins the server.
29 | */
30 | @AllArgsConstructor
31 | public class MarriedPlayerJoinEvent extends MarriageMasterEvent
32 | {
33 | private final @NotNull MarriagePlayer player;
34 |
35 | /**
36 | * @return The married player that has joined the server
37 | */
38 | public @NotNull MarriagePlayer getPlayer()
39 | {
40 | return this.player;
41 | }
42 |
43 | // Bukkit handler stuff
44 | private static final HandlerList handlers = new HandlerList();
45 |
46 | @Override
47 | public @NotNull HandlerList getHandlers()
48 | {
49 | return getHandlerList();
50 | }
51 |
52 | public static HandlerList getHandlerList()
53 | {
54 | return handlers;
55 | }
56 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/Formatted/NearestPartnerDisplayNameFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.NearestPartnerDisplayName;
24 |
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | @PlaceholderName(name = "NearestPartnerDisplayName", aliases = { "Nearest_PartnerDisplayName", "Nearest_Partner_DisplayName" })
28 | public class NearestPartnerDisplayNameFormatted extends NearestPartnerDisplayName
29 | {
30 | public NearestPartnerDisplayNameFormatted(MarriageMaster plugin)
31 | {
32 | super(plugin);
33 | }
34 |
35 | @Override
36 | protected @Nullable String replaceMarried(MarriagePlayer player)
37 | {
38 | return String.format(valueMarried, super.replaceMarried(player));
39 | }
40 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Common/src/at/pcgamingfreaks/MarriageMaster/API/DelayableTeleportAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.API;
19 |
20 | import org.jetbrains.annotations.NotNull;
21 |
22 | /**
23 | * The interface defines all the functions used for a delayed teleport with health/move check.
24 | */
25 | @SuppressWarnings("unused")
26 | public interface DelayableTeleportAction
27 | {
28 | /**
29 | * The action that should be executed when the delay is over and all the checks were successful.
30 | * Implement the teleport of the player here.
31 | */
32 | void run();
33 |
34 | /**
35 | * Defines the delay at which the action will be executed.
36 | *
37 | * @return The delay for the execution in ticks (1 second = 20 ticks). 0 or less for instant execution without check for movement or damage.
38 | */
39 | long getDelay();
40 |
41 | /**
42 | * Defines the player which should be used for the checks.
43 | * The given player will also receive the messages of the check.
44 | *
45 | * @return The player that should be used for the checks.
46 | */
47 | @NotNull PLAYER getPlayer();
48 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/PartnerDisplayName.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.PartnerDisplayNameFormatted;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(aliases = "Partner_DisplayName")
29 | @PlaceholderFormatted(formattedClass = PartnerDisplayNameFormatted.class)
30 | public class PartnerDisplayName extends PlaceholderReplacerBaseValue
31 | {
32 | public PartnerDisplayName(MarriageMaster plugin)
33 | {
34 | super(plugin);
35 | }
36 |
37 | @Override
38 | protected @Nullable String replaceMarried(MarriagePlayer player)
39 | {
40 | //noinspection ConstantConditions
41 | return player.getPartner().getDisplayName();
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/IsInRange.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Range;
23 |
24 | import org.jetbrains.annotations.NotNull;
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | import lombok.Getter;
28 |
29 | public class IsInRange extends PlaceholderReplacerBaseBoolean
30 | {
31 | @Getter private final String name;
32 | private final double range;
33 |
34 | public IsInRange(final @NotNull MarriageMaster plugin, final @NotNull Range range)
35 | {
36 | super(plugin);
37 | this.name = this.getClass().getSimpleName() + range.name();
38 | this.range = plugin.getConfiguration().getRangeSquared(range);
39 | }
40 |
41 | @Override
42 | protected @Nullable String replaceMarried(MarriagePlayer player)
43 | {
44 | //noinspection ConstantConditions
45 | return toString(player.getNearestPartnerMarriage().inRangeSquared(range));
46 | }
47 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/MarriagePlayerJoinEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
21 |
22 | import org.bukkit.event.HandlerList;
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | /**
26 | * Event is fired when a married player joins the server.
27 | */
28 | public class MarriagePlayerJoinEvent extends MarriageMasterEvent
29 | {
30 | private final MarriagePlayer player;
31 |
32 | public MarriagePlayerJoinEvent(final @NotNull MarriagePlayer player)
33 | {
34 | this.player = player;
35 | }
36 |
37 | /**
38 | * @return The married player that has joined the server
39 | */
40 | public @NotNull MarriagePlayer getPlayer()
41 | {
42 | return this.player;
43 | }
44 |
45 | // Bukkit handler stuff
46 | private static final HandlerList handlers = new HandlerList();
47 |
48 | @Override
49 | public @NotNull HandlerList getHandlers()
50 | {
51 | return getHandlerList();
52 | }
53 |
54 | public static HandlerList getHandlerList()
55 | {
56 | return handlers;
57 | }
58 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/FilteredHashSet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database;
19 |
20 | import java.util.HashSet;
21 | import java.util.Objects;
22 |
23 | public class FilteredHashSet extends HashSet
24 | {
25 | public interface Filter
26 | {
27 | boolean isAllowed(T element);
28 | }
29 |
30 | private final Filter filter;
31 |
32 | public FilteredHashSet(Filter filter)
33 | {
34 | this.filter = filter;
35 | }
36 |
37 | @Override
38 | public boolean add(T element)
39 | {
40 | return filter.isAllowed(element) && super.add(element);
41 | }
42 |
43 | @Override
44 | public boolean equals(Object o)
45 | {
46 | if(this == o) return true;
47 | if(o == null || !Objects.equals(getClass(), o.getClass()) || !super.equals(o)) return false;
48 | FilteredHashSet> filteredSet = (FilteredHashSet>) o;
49 | return Objects.equals(filter, filteredSet.filter);
50 | }
51 |
52 | @Override
53 | public int hashCode()
54 | {
55 | return Objects.hash(super.hashCode(), filter);
56 | }
57 |
58 | @Override
59 | public Object clone()
60 | {
61 | return super.clone();
62 | }
63 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-API
4 |
5 | MarriageMaster-API-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 |
9 | ${revision}
10 | jar
11 |
12 | MarriageMaster API
13 | The API for the Marriage Master Bukkit/Spigot/Paper/BungeeCord plugin.
14 |
15 |
16 |
17 | at.pcgamingfreaks
18 | MarriageMaster-API-Bukkit
19 | ${revision}
20 |
21 |
22 | at.pcgamingfreaks
23 | MarriageMaster-API-Bungee
24 | ${revision}
25 |
26 |
27 |
28 |
29 |
30 |
31 | org.apache.maven.plugins
32 | maven-shade-plugin
33 | 3.3.0
34 |
35 |
36 | package
37 |
38 | shade
39 |
40 |
41 | false
42 | true
43 | false
44 |
45 |
46 | at.pcgamingfreaks:MarriageMaster-API-*
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/HomeCoordinates.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 |
25 | import org.bukkit.Location;
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(aliases = "Home_Coordinates")
29 | public class HomeCoordinates extends PlaceholderReplacerBaseValueHome
30 | {
31 | public HomeCoordinates(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getMarriageData();
40 | if(marriageData != null && marriageData.isHomeSet())
41 | {
42 | Location location = marriageData.getHome().getLocation();
43 | return String.format(valueMarried, location.getX(), location.getY(), location.getZ());
44 | }
45 | return valueNoHome;
46 | }
47 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/HomeXFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "HomeX", aliases = "Home_X")
29 | public class HomeXFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public HomeXFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getX()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/HomeYFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "HomeY", aliases = "Home_Y")
29 | public class HomeYFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public HomeYFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getY()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/HomeZFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "HomeZ", aliases = "Home_Z")
29 | public class HomeZFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public HomeZFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getY()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/SpecialInfoWorker/SpecialInfoBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.SpecialInfoWorker;
19 |
20 | import org.bukkit.Bukkit;
21 | import org.bukkit.entity.Player;
22 | import org.bukkit.event.EventHandler;
23 | import org.bukkit.event.Listener;
24 | import org.bukkit.event.player.PlayerJoinEvent;
25 | import org.bukkit.plugin.java.JavaPlugin;
26 |
27 | public abstract class SpecialInfoBase implements Listener
28 | {
29 | private final JavaPlugin plugin;
30 | private final String permission;
31 |
32 | protected SpecialInfoBase(final JavaPlugin plugin, final String permission)
33 | {
34 | this.plugin = plugin;
35 | this.permission = permission;
36 | }
37 |
38 | @EventHandler
39 | public void onJoin(final PlayerJoinEvent event)
40 | {
41 | if(event.getPlayer().hasPermission(permission))
42 | {
43 | Bukkit.getScheduler().runTaskLater(plugin, () -> {
44 | if(event.getPlayer().isOnline())
45 | {
46 | sendMessage(event.getPlayer());
47 | }
48 | }, 3 * 20L); // Run with a 3 seconds delay
49 | }
50 | }
51 |
52 | protected abstract void sendMessage(final Player player);
53 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/MarriagePlayerQuitEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
21 |
22 | import org.bukkit.event.HandlerList;
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | /**
26 | * Event is fired when a married player disconnects form the server.
27 | */
28 | @SuppressWarnings("unused")
29 | public class MarriagePlayerQuitEvent extends MarriageMasterEvent
30 | {
31 | private final MarriagePlayer player;
32 |
33 | public MarriagePlayerQuitEvent(MarriagePlayer player)
34 | {
35 | this.player = player;
36 | }
37 |
38 | /**
39 | * @return The married player that has disconnected from the server
40 | */
41 | public MarriagePlayer getPlayer()
42 | {
43 | return this.player;
44 | }
45 |
46 | // Bukkit handler stuff
47 | private static final HandlerList handlers = new HandlerList();
48 |
49 | @Override
50 | public @NotNull HandlerList getHandlers()
51 | {
52 | return getHandlerList();
53 | }
54 |
55 | public static HandlerList getHandlerList()
56 | {
57 | return handlers;
58 | }
59 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/SurnameChangedEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 |
22 | import org.bukkit.command.CommandSender;
23 | import org.bukkit.event.HandlerList;
24 | import org.jetbrains.annotations.NotNull;
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | import lombok.AllArgsConstructor;
28 | import lombok.Getter;
29 | import lombok.Setter;
30 |
31 | /**
32 | * Event is fired after the surname of a couple has been changed.
33 | */
34 | @AllArgsConstructor
35 | @Getter
36 | public class SurnameChangedEvent extends MarriageMasterEvent
37 | {
38 | @NotNull private final Marriage marriageData;
39 | @Setter @Nullable private String newSurname;
40 | @NotNull private final CommandSender changedBy;
41 |
42 | // Bukkit handler stuff
43 | private static final HandlerList handlers = new HandlerList();
44 |
45 | @Override
46 | public @NotNull HandlerList getHandlers()
47 | {
48 | return getHandlerList();
49 | }
50 |
51 | public static HandlerList getHandlerList()
52 | {
53 | return handlers;
54 | }
55 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/MarriedPlayerQuitEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
21 |
22 | import org.bukkit.event.HandlerList;
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | /**
26 | * Event is fired when a married player disconnects form the server.
27 | */
28 | @SuppressWarnings("unused")
29 | public class MarriedPlayerQuitEvent extends MarriageMasterEvent
30 | {
31 | private final MarriagePlayer player;
32 |
33 | public MarriedPlayerQuitEvent(final @NotNull MarriagePlayer player)
34 | {
35 | this.player = player;
36 | }
37 |
38 | /**
39 | * @return The married player that has disconnected from the server
40 | */
41 | public @NotNull MarriagePlayer getPlayer()
42 | {
43 | return this.player;
44 | }
45 |
46 | // Bukkit handler stuff
47 | private static final HandlerList handlers = new HandlerList();
48 |
49 | @Override
50 | public @NotNull HandlerList getHandlers()
51 | {
52 | return getHandlerList();
53 | }
54 |
55 | public static HandlerList getHandlerList()
56 | {
57 | return handlers;
58 | }
59 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/Formatted/HomeWorldFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "HomeWorld", aliases = "Home_World")
29 | public class HomeWorldFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public HomeWorldFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getWorld().getName()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/Extensions/MarriageMaster-MinepacksV1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-MinepacksV1
4 |
5 | MarriageMaster-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 | ../../pom.xml
9 |
10 | ${revision}
11 | jar
12 |
13 | MarriageMaster Minepacks V1.x integration
14 | The Minepacks integration of Marriage Master.
15 |
16 |
17 |
18 |
19 | org.bukkit
20 | bukkit
21 | ${bukkitVersion}
22 | provided
23 |
24 |
25 |
26 | at.pcgamingfreaks
27 | MarriageMaster-BackpackIntegration
28 | ${revision}
29 |
30 |
31 |
32 | at.pcgamingfreaks
33 | PluginLib
34 | 1.0.15
35 | provided
36 |
37 |
38 |
39 | at.pcgamingfreaks
40 | MinePacks
41 | 1.18.1
42 | provided
43 |
44 |
45 | at.pcgamingfreaks
46 | PluginLib
47 |
48 |
49 |
50 |
51 |
52 |
53 | clean install
54 | src
55 |
56 |
57 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/HomeWorld.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.HomeWorldFormatted;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = "Home_World")
30 | @PlaceholderFormatted(formattedClass = HomeWorldFormatted.class)
31 | public class HomeWorld extends PlaceholderReplacerBaseValueHome
32 | {
33 | public HomeWorld(MarriageMaster plugin)
34 | {
35 | super(plugin);
36 | }
37 |
38 | @Override
39 | protected @Nullable String replaceMarried(MarriagePlayer player)
40 | {
41 | Marriage marriageData = player.getMarriageData();
42 | //noinspection ConstantConditions
43 | return marriageData.isHomeSet() ? marriageData.getHome().getLocation().getWorld().getName() : valueNoHome;
44 | }
45 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestSurname.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted.NearestSurnameFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = "Nearest_Surname")
30 | @PlaceholderFormatted(formattedClass = NearestSurnameFormatted.class)
31 | public class NearestSurname extends PlaceholderReplacerBaseValue
32 | {
33 | public NearestSurname(MarriageMaster plugin)
34 | {
35 | super(plugin);
36 | }
37 |
38 | @Override
39 | protected @Nullable String replaceMarried(MarriagePlayer player)
40 | {
41 | //noinspection ConstantConditions
42 | return player.getNearestPartnerMarriageData().getSurnameString();
43 | }
44 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/Formatted/NearestHomeXFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "NearestHomeX", aliases = { "Nearest_HomeX", "Nearest_Home_X" })
29 | public class NearestHomeXFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public NearestHomeXFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getNearestPartnerMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getX()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/Formatted/NearestHomeYFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "NearestHomeY", aliases = { "Nearest_HomeY", "Nearest_Home_Y" })
29 | public class NearestHomeYFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public NearestHomeYFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getNearestPartnerMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getY()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/Formatted/NearestHomeZFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "NearestHomeZ", aliases = { "Nearest_HomeZ", "Nearest_Home_Z" })
29 | public class NearestHomeZFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public NearestHomeZFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getNearestPartnerMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getZ()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestPrefix.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.PrefixSuffixFormatter;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = "Nearest_Prefix")
30 | public class NearestPrefix extends PlaceholderReplacerBaseValue
31 | {
32 | private final PrefixSuffixFormatter formatter;
33 |
34 | public NearestPrefix(MarriageMaster plugin)
35 | {
36 | super(plugin);
37 | formatter = plugin.getPrefixSuffixFormatter();
38 | }
39 |
40 | @Override
41 | protected @Nullable String replaceMarried(MarriagePlayer player)
42 | {
43 | Marriage marriage = player.getNearestPartnerMarriageData();
44 | return formatter.formatPrefix(marriage, marriage.getPartner(player));
45 | }
46 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestSuffix.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.PrefixSuffixFormatter;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = "Nearest_Suffix")
30 | public class NearestSuffix extends PlaceholderReplacerBaseValue
31 | {
32 | private final PrefixSuffixFormatter formatter;
33 |
34 | public NearestSuffix(MarriageMaster plugin)
35 | {
36 | super(plugin);
37 | formatter = plugin.getPrefixSuffixFormatter();
38 | }
39 |
40 | @Override
41 | protected @Nullable String replaceMarried(MarriagePlayer player)
42 | {
43 | Marriage marriage = player.getNearestPartnerMarriageData();
44 | return formatter.formatSuffix(marriage, marriage.getPartner(player));
45 | }
46 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Placeholder/Processors/DisplayNamePlaceholderProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Placeholder.Processors;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Database.MarriagePlayerDataBase;
21 | import at.pcgamingfreaks.Message.MessageComponent;
22 | import at.pcgamingfreaks.Message.Placeholder.Processors.IFormattedPlaceholderProcessor;
23 |
24 | import org.jetbrains.annotations.NotNull;
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | public final class DisplayNamePlaceholderProcessor implements IFormattedPlaceholderProcessor
28 | {
29 | private static final MessageComponent NULL_COMPONENT = new MessageComponent("null");
30 |
31 | public static final DisplayNamePlaceholderProcessor INSTANCE = new DisplayNamePlaceholderProcessor();
32 |
33 | @Override
34 | public @NotNull MessageComponent processFormatted(@Nullable Object parameter)
35 | {
36 | if (parameter == null) return NULL_COMPONENT;
37 | return ((MarriagePlayerDataBase) parameter).getDisplayNameMessageComponent();
38 | }
39 |
40 | @Override
41 | public @NotNull String process(@Nullable Object parameter)
42 | {
43 | if (parameter == null) return "null";
44 | return ((MarriagePlayerDataBase) parameter).getDisplayName();
45 | }
46 | }
--------------------------------------------------------------------------------
/Extensions/MarriageMaster-BackpackIntegration/src/at/pcgamingfreaks/MarriageMaster/Bukkit/BackpackIntegration/IBackpackIntegration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.BackpackIntegration;
19 |
20 | import org.bukkit.entity.Player;
21 | import org.bukkit.inventory.ItemStack;
22 | import org.jetbrains.annotations.NotNull;
23 |
24 | public interface IBackpackIntegration
25 | {
26 | /**
27 | * Opens the backpack of another player.
28 | *
29 | * @param opener The player that opens the backpack.
30 | * @param owner The owner of the backpack.
31 | * @param editable Weather or not the player that has opened the backpack should be able to edit the content of the backpack.
32 | */
33 | void openBackpack(final @NotNull Player opener, final @NotNull Player owner, boolean editable);
34 |
35 | /**
36 | * Disables the integration with the backpack plugin.
37 | */
38 | void close();
39 |
40 | /**
41 | * Gets the name of the used backpack plugin.
42 | *
43 | * @return The name of the backpack plugin.
44 | */
45 | @NotNull String getName();
46 |
47 | /**
48 | * Gets the version of the used backpack plugin.
49 | *
50 | * @return The version of the backpack plugin.
51 | */
52 | @NotNull String getVersion();
53 |
54 | boolean isBackpackItem(final ItemStack item);
55 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/Formatted/NearestHomeWorldFormatted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(name = "NearestHomeWorld", aliases = { "Nearest_HomeWorld", "Nearest_Home_World" })
29 | public class NearestHomeWorldFormatted extends PlaceholderReplacerBaseValueHome
30 | {
31 | public NearestHomeWorldFormatted(MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | }
35 |
36 | @Override
37 | protected @Nullable String replaceMarried(MarriagePlayer player)
38 | {
39 | Marriage marriageData = player.getNearestPartnerMarriageData();
40 | //noinspection ConstantConditions
41 | return marriageData.isHomeSet() ? String.format(valueMarried, marriageData.getHome().getLocation().getWorld().getName()) : valueNoHome;
42 | }
43 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/MarriageMasterCancellableEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import org.bukkit.event.Cancellable;
21 |
22 | /**
23 | * Base class of all cancellable events fired by the Marriage Master plugin
24 | */
25 | public abstract class MarriageMasterCancellableEvent extends MarriageMasterEvent implements Cancellable
26 | {
27 | private boolean cancelled = false;
28 |
29 | protected MarriageMasterCancellableEvent() {}
30 |
31 | protected MarriageMasterCancellableEvent(boolean async)
32 | {
33 | super(async);
34 | }
35 |
36 | /**
37 | * Gets the cancellation state of this event. A cancelled event will not
38 | * be executed in the server, but will still pass to other plugins.
39 | *
40 | * @return True if this event is cancelled.
41 | */
42 | @Override
43 | public boolean isCancelled()
44 | {
45 | return cancelled;
46 | }
47 |
48 | /**
49 | * Sets the cancellation state of this event. A cancelled event will not
50 | * be executed in the server, but will still pass to other plugins.
51 | *
52 | * @param cancel True if you wish to cancel this event.
53 | */
54 | @Override
55 | public void setCancelled(boolean cancel)
56 | {
57 | cancelled = cancel;
58 | }
59 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestPartnerName.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted.NearestPartnerNameFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = { "Nearest_PartnerName", "Nearest_Partner_Name" })
30 | @PlaceholderFormatted(formattedClass = NearestPartnerNameFormatted.class)
31 | public class NearestPartnerName extends PlaceholderReplacerBaseValue
32 | {
33 | public NearestPartnerName(MarriageMaster plugin)
34 | {
35 | super(plugin);
36 | }
37 |
38 | @Override
39 | protected @Nullable String replaceMarried(MarriagePlayer player)
40 | {
41 | //noinspection ConstantConditions
42 | return player.getNearestPartnerMarriageData().getPartner(player).getName();
43 | }
44 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestHome.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.bukkit.Location;
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = "Nearest_Home")
30 | public class NearestHome extends PlaceholderReplacerBaseValueHome
31 | {
32 | public NearestHome(MarriageMaster plugin)
33 | {
34 | super(plugin);
35 | }
36 |
37 | @Override
38 | protected @Nullable String replaceMarried(MarriagePlayer player)
39 | {
40 | Marriage marriageData = player.getNearestPartnerMarriageData();
41 | if(marriageData != null && marriageData.isHomeSet())
42 | {
43 | Location location = marriageData.getHome().getLocation();
44 | return String.format(valueMarried, location.getWorld().getName(), location.getX(), location.getY(), location.getZ());
45 | }
46 | return valueNoHome;
47 | }
48 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/PlaceholderReplacerBaseBoolean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
21 |
22 | import org.jetbrains.annotations.NotNull;
23 |
24 | import java.util.Locale;
25 |
26 | public abstract class PlaceholderReplacerBaseBoolean extends PlaceholderReplacerBase
27 | {
28 | private static final String PLACEHOLDER_BOOLEAN_KEY = "Boolean.", KEY_TRUE = "True", KEY_FALSE = "False";
29 | protected final String valueTrue, valueFalse;
30 |
31 | protected PlaceholderReplacerBaseBoolean(final @NotNull MarriageMaster plugin)
32 | {
33 | super(plugin);
34 | valueTrue = getBooleanPlaceholderValue(this.getClass().getSimpleName(), KEY_TRUE);
35 | valueFalse = getBooleanPlaceholderValue(this.getClass().getSimpleName(), KEY_FALSE);
36 | }
37 |
38 | protected @NotNull String getBooleanPlaceholderValue(final @NotNull String placeholder, final @NotNull String booleanKey)
39 | {
40 | String val = getPlaceholderValue(placeholder, PLACEHOLDER_BOOLEAN_KEY + booleanKey);
41 | return (val == null) ? booleanKey.toLowerCase(Locale.ENGLISH) : val;
42 | }
43 |
44 | protected @NotNull String toString(boolean bool)
45 | {
46 | return bool ? valueTrue : valueFalse;
47 | }
48 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Events/SurnameChangeEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
21 |
22 | import org.bukkit.command.CommandSender;
23 | import org.bukkit.event.HandlerList;
24 | import org.jetbrains.annotations.NotNull;
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | import lombok.Getter;
28 | import lombok.Setter;
29 |
30 | /**
31 | * Event is fired before the surname of a couple is changed.
32 | */
33 | @Getter
34 | public class SurnameChangeEvent extends MarriageMasterCancellableEvent
35 | {
36 | private final Marriage marriageData;
37 | @Setter @Nullable private String newSurname;
38 | @NotNull private final CommandSender changedBy;
39 |
40 | // Bukkit handler stuff
41 | private static final HandlerList handlers = new HandlerList();
42 |
43 | public SurnameChangeEvent(Marriage marriageData, @Nullable String newSurname, @NotNull CommandSender changedBy) {
44 | this.marriageData = marriageData;
45 | this.newSurname = newSurname;
46 | this.changedBy = changedBy;
47 | }
48 |
49 | @Override
50 | public @NotNull HandlerList getHandlers()
51 | {
52 | return getHandlerList();
53 | }
54 |
55 | public static HandlerList getHandlerList()
56 | {
57 | return handlers;
58 | }
59 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Listener/JoinLeaveInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Listener;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events.MarriedPlayerJoinEvent;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events.MarriedPlayerQuitEvent;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Listener.JoinLeaveInfoBase;
24 |
25 | import org.bukkit.event.EventHandler;
26 | import org.bukkit.event.Listener;
27 | import org.jetbrains.annotations.NotNull;
28 |
29 | public class JoinLeaveInfo extends JoinLeaveInfoBase implements Listener
30 | {
31 | private final MarriageMaster plugin;
32 | private final long delay;
33 |
34 | public JoinLeaveInfo(MarriageMaster plugin)
35 | {
36 | super(plugin.getLanguage());
37 | this.plugin = plugin;
38 | delay = plugin.getConfiguration().getJoinInfoDelay();
39 | }
40 |
41 | @EventHandler
42 | public void onJoin(MarriedPlayerJoinEvent event)
43 | {
44 | onJoin(event.getPlayer());
45 | }
46 |
47 | @EventHandler
48 | public void onLeave(MarriedPlayerQuitEvent event)
49 | {
50 | onLeave(event.getPlayer());
51 | }
52 |
53 | @Override
54 | protected void runTaskLater(@NotNull Runnable task)
55 | {
56 | plugin.getServer().getScheduler().runTaskLater(plugin, task, delay);
57 | }
58 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestHomeCoordinates.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
25 |
26 | import org.bukkit.Location;
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = { "Nearest_HomeCoordinates", "Nearest_Home_Coordinates" })
30 | public class NearestHomeCoordinates extends PlaceholderReplacerBaseValueHome
31 | {
32 | public NearestHomeCoordinates(MarriageMaster plugin)
33 | {
34 | super(plugin);
35 | }
36 |
37 | @Override
38 | protected @Nullable String replaceMarried(MarriagePlayer player)
39 | {
40 | Marriage marriageData = player.getNearestPartnerMarriageData();
41 | if(marriageData != null && marriageData.isHomeSet())
42 | {
43 | Location location = marriageData.getHome().getLocation();
44 | return String.format(valueMarried, location.getX(), location.getY(), location.getZ());
45 | }
46 | return valueNoHome;
47 | }
48 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestPartnerDisplayName.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted.NearestPartnerDisplayNameFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | @PlaceholderName(aliases = { "Nearest_PartnerDisplayName", "Nearest_Partner_DisplayName" })
30 | @PlaceholderFormatted(formattedClass = NearestPartnerDisplayNameFormatted.class)
31 | public class NearestPartnerDisplayName extends PlaceholderReplacerBaseValue
32 | {
33 | public NearestPartnerDisplayName(MarriageMaster plugin)
34 | {
35 | super(plugin);
36 | }
37 |
38 | @Override
39 | protected @Nullable String replaceMarried(MarriagePlayer player)
40 | {
41 | //noinspection ConstantConditions
42 | return player.getNearestPartnerMarriageData().getPartner(player).getDisplayName();
43 | }
44 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/HomeX.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.HomeXFormatted;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | import java.text.DecimalFormat;
30 |
31 | @PlaceholderName(aliases = "Home_X")
32 | @PlaceholderFormatted(formattedClass = HomeXFormatted.class)
33 | public class HomeX extends PlaceholderReplacerBaseValueHome
34 | {
35 | ThreadLocal format = ThreadLocal.withInitial(() -> new DecimalFormat("#.0"));
36 |
37 | public HomeX(MarriageMaster plugin)
38 | {
39 | super(plugin);
40 | }
41 |
42 | @Override
43 | protected @Nullable String replaceMarried(MarriagePlayer player)
44 | {
45 | Marriage marriageData = player.getMarriageData();
46 | //noinspection ConstantConditions
47 | return marriageData.isHomeSet() ? format.get().format(marriageData.getHome().getLocation().getX()) : valueNoHome;
48 | }
49 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/HomeY.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.HomeYFormatted;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | import java.text.DecimalFormat;
30 |
31 | @PlaceholderName(aliases = "Home_Y")
32 | @PlaceholderFormatted(formattedClass = HomeYFormatted.class)
33 | public class HomeY extends PlaceholderReplacerBaseValueHome
34 | {
35 | ThreadLocal format = ThreadLocal.withInitial(() -> new DecimalFormat("#.0"));
36 |
37 | public HomeY(MarriageMaster plugin)
38 | {
39 | super(plugin);
40 | }
41 |
42 | @Override
43 | protected @Nullable String replaceMarried(MarriagePlayer player)
44 | {
45 | Marriage marriageData = player.getMarriageData();
46 | //noinspection ConstantConditions
47 | return marriageData.isHomeSet() ? format.get().format(marriageData.getHome().getLocation().getY()) : valueNoHome;
48 | }
49 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/HomeZ.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.Formatted.HomeZFormatted;
26 |
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | import java.text.DecimalFormat;
30 |
31 | @PlaceholderName(aliases = "Home_Z")
32 | @PlaceholderFormatted(formattedClass = HomeZFormatted.class)
33 | public class HomeZ extends PlaceholderReplacerBaseValueHome
34 | {
35 | ThreadLocal format = ThreadLocal.withInitial(() -> new DecimalFormat("#.0"));
36 |
37 | public HomeZ(MarriageMaster plugin)
38 | {
39 | super(plugin);
40 | }
41 |
42 | @Override
43 | protected @Nullable String replaceMarried(MarriagePlayer player)
44 | {
45 | Marriage marriageData = player.getMarriageData();
46 | //noinspection ConstantConditions
47 | return marriageData.isHomeSet() ? format.get().format(marriageData.getHome().getLocation().getZ()) : valueNoHome;
48 | }
49 | }
--------------------------------------------------------------------------------
/Extensions/MarriageMaster-BackpackIntegration/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-BackpackIntegration
4 |
5 | MarriageMaster-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 | ../../pom.xml
9 |
10 | ${revision}
11 | jar
12 |
13 | MarriageMaster Backpack Integration API
14 | The API for the Marriage Master backpack integration.
15 |
16 |
17 |
18 |
19 | org.bukkit
20 | bukkit
21 | ${bukkitVersion}
22 | provided
23 |
24 |
25 |
26 |
27 | clean install
28 |
29 |
30 |
31 | org.apache.maven.plugins
32 | maven-source-plugin
33 | 2.2.1
34 |
35 |
36 | attach-sources
37 |
38 | jar
39 |
40 |
41 |
42 |
43 |
44 |
45 | org.apache.maven.plugins
46 | maven-javadoc-plugin
47 | 3.1.1
48 |
49 |
50 | attach-javadocs
51 |
52 | jar
53 |
54 |
55 | -Xdoclint:none
56 | 8
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/PartnerList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(aliases = { "Partner_List", "PartnerNameList", "Partner_Name_List" })
29 | public class PartnerList extends PlaceholderReplacerBaseValue
30 | {
31 | private final String valueSeparator;
32 |
33 | public PartnerList(MarriageMaster plugin)
34 | {
35 | super(plugin);
36 | valueSeparator = getPlaceholderValue("Separator");
37 | }
38 |
39 | @Override
40 | protected @Nullable String replaceMarried(MarriagePlayer player)
41 | {
42 | StringBuilder stringBuilder = new StringBuilder();
43 | String separator = "";
44 | for(Marriage marriage : player.getMultiMarriageData())
45 | {
46 | //noinspection ConstantConditions
47 | stringBuilder.append(separator).append(marriage.getPartner(player).getName());
48 | separator = valueSeparator;
49 | }
50 | return stringBuilder.toString();
51 | }
52 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/Helper/DbElementStatementWithKeyRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.Helper;
19 |
20 | import at.pcgamingfreaks.Database.DBTools;
21 | import at.pcgamingfreaks.MarriageMaster.Database.Backend.SQLBasedDatabase;
22 | import at.pcgamingfreaks.MarriageMaster.Database.DatabaseElement;
23 |
24 | import org.intellij.lang.annotations.Language;
25 | import org.jetbrains.annotations.NonNls;
26 | import org.jetbrains.annotations.NotNull;
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | import java.sql.Connection;
30 | import java.util.Arrays;
31 |
32 | public class DbElementStatementWithKeyRunnable extends DbElementStatementRunnable
33 | {
34 | public DbElementStatementWithKeyRunnable(@NotNull SQLBasedDatabase database, @NotNull DatabaseElement databaseElement, @NonNls @Language("SQL") String query, @Nullable Object... args)
35 | {
36 | super(database, databaseElement, query, args);
37 | }
38 |
39 | @Override
40 | protected void runStatement(Connection connection)
41 | {
42 | if(args == null)
43 | {
44 | DBTools.runStatementWithoutException(connection, query, databaseElement.getDatabaseKey());
45 | }
46 | else
47 | {
48 | Object[] comboArgs = Arrays.copyOf(args, args.length + 1);
49 | comboArgs[args.length] = databaseElement.getDatabaseKey();
50 | DBTools.runStatementWithoutException(connection, query, comboArgs);
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/Helper/DbElementStatementWithKeyFirstRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.Helper;
19 |
20 | import at.pcgamingfreaks.Database.DBTools;
21 | import at.pcgamingfreaks.MarriageMaster.Database.Backend.SQLBasedDatabase;
22 | import at.pcgamingfreaks.MarriageMaster.Database.DatabaseElement;
23 |
24 | import org.intellij.lang.annotations.Language;
25 | import org.jetbrains.annotations.NonNls;
26 | import org.jetbrains.annotations.NotNull;
27 | import org.jetbrains.annotations.Nullable;
28 |
29 | import java.sql.Connection;
30 |
31 | public class DbElementStatementWithKeyFirstRunnable extends DbElementStatementRunnable
32 | {
33 | public DbElementStatementWithKeyFirstRunnable(@NotNull SQLBasedDatabase database, @NotNull DatabaseElement databaseElement, @NonNls @Language("SQL") String query, @Nullable Object... args)
34 | {
35 | super(database, databaseElement, query, args);
36 | }
37 |
38 | @Override
39 | protected void runStatement(Connection connection)
40 | {
41 | if(args == null)
42 | {
43 | DBTools.runStatementWithoutException(connection, query, databaseElement.getDatabaseKey());
44 | return;
45 | }
46 | Object[] comboArgs = new Object[args.length + 1];
47 | comboArgs[0] = databaseElement.getDatabaseKey();
48 | System.arraycopy(args, 0, comboArgs, 1, args.length);
49 | DBTools.runStatementWithoutException(connection, query, comboArgs);
50 | }
51 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestHomeWorld.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted.NearestHomeWorldFormatted;
26 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
27 |
28 | import org.jetbrains.annotations.Nullable;
29 |
30 | @PlaceholderName(aliases = { "Nearest_HomeWorld", "Nearest_Home_World" })
31 | @PlaceholderFormatted(formattedClass = NearestHomeWorldFormatted.class)
32 | public class NearestHomeWorld extends PlaceholderReplacerBaseValueHome
33 | {
34 | public NearestHomeWorld(MarriageMaster plugin)
35 | {
36 | super(plugin);
37 | }
38 |
39 | @Override
40 | protected @Nullable String replaceMarried(MarriagePlayer player)
41 | {
42 | Marriage marriageData = player.getNearestPartnerMarriageData();
43 | //noinspection ConstantConditions
44 | return marriageData.isHomeSet() ? marriageData.getHome().getLocation().getWorld().getName() : valueNoHome;
45 | }
46 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/PartnerDisplayNameList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValue;
25 |
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | @PlaceholderName(aliases = { "PartnerDisplayName_List", "Partner_DisplayName_List" })
29 | public class PartnerDisplayNameList extends PlaceholderReplacerBaseValue
30 | {
31 | private final String valueSeparator;
32 |
33 | public PartnerDisplayNameList(MarriageMaster plugin)
34 | {
35 | super(plugin);
36 | valueSeparator = getPlaceholderValue("Separator");
37 | }
38 |
39 | @Override
40 | protected @Nullable String replaceMarried(MarriagePlayer player)
41 | {
42 | StringBuilder stringBuilder = new StringBuilder();
43 | String separator = "";
44 | for(Marriage marriage : player.getMultiMarriageData())
45 | {
46 | //noinspection ConstantConditions
47 | stringBuilder.append(separator).append(marriage.getPartner(player).getDisplayName());
48 | separator = valueSeparator;
49 | }
50 | return stringBuilder.toString();
51 | }
52 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/DatabaseConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database;
19 |
20 | import at.pcgamingfreaks.Database.Cache.IUnCacheStrategyConfig;
21 | import at.pcgamingfreaks.Database.DatabaseConnectionConfiguration;
22 |
23 | import org.jetbrains.annotations.Contract;
24 | import org.jetbrains.annotations.NotNull;
25 | import org.jetbrains.annotations.Nullable;
26 |
27 | import java.util.Locale;
28 |
29 | public interface DatabaseConfiguration extends DatabaseConnectionConfiguration, IUnCacheStrategyConfig
30 | {
31 | default @NotNull String getDatabaseType()
32 | {
33 | return getConfigE().getString("Database.Type", "MySQL").toLowerCase(Locale.ENGLISH);
34 | }
35 |
36 | default boolean useUUIDSeparators()
37 | {
38 | return getConfigE().getBoolean("Database.UseUUIDSeparators", false);
39 | }
40 |
41 | boolean useOnlineUUIDs();
42 |
43 | @Contract("_, !null -> !null")
44 | default @NotNull String getSQLTable(final @NotNull String table, final @Nullable String defaultValue)
45 | {
46 | return getConfigE().getString("Database.SQL.Tables." + table, defaultValue);
47 | }
48 |
49 | @Contract("_, !null -> !null")
50 | default @Nullable String getSQLField(final @NotNull String field, final @Nullable String defaultValue)
51 | {
52 | return getConfigE().getString("Database.SQL.Tables.Fields." + field, defaultValue);
53 | }
54 |
55 | default void setDatabaseType(final @NotNull String type) {}
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/ILanguage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database;
19 |
20 | import at.pcgamingfreaks.Message.Message;
21 | import at.pcgamingfreaks.yaml.YAML;
22 |
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | import java.util.LinkedList;
26 | import java.util.List;
27 |
28 | public interface ILanguage
29 | {
30 | @NotNull YAML getLangE();
31 |
32 | @NotNull String getTranslated(final @NotNull String key);
33 |
34 | @NotNull String getTranslatedPlaceholder(final @NotNull String key);
35 |
36 | @NotNull String getDialog(final @NotNull String key);
37 |
38 | default @NotNull String[] getCommandAliases(final @NotNull String command)
39 | {
40 | return getCommandAliases(command, new String[0]);
41 | }
42 |
43 | default @NotNull String[] getCommandAliases(final @NotNull String command, final @NotNull String[] defaults)
44 | {
45 | List aliases = getLangE().getStringList("Command." + command, new LinkedList<>());
46 | return (!aliases.isEmpty()) ? aliases.toArray(new String[0]) : defaults;
47 | }
48 |
49 | default @NotNull String[] getSwitch(final @NotNull String key, final @NotNull String defaultSwitch)
50 | {
51 | List switches = getLangE().getStringList("Command.Switches." + key, new LinkedList<>());
52 | if(!switches.contains(defaultSwitch)) switches.add(defaultSwitch);
53 | return switches.toArray(new String[0]);
54 | }
55 |
56 | @NotNull Message getMessage(final @NotNull String path);
57 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bungee/CommonMessages.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee;
19 |
20 | import at.pcgamingfreaks.Bungee.Message.Message;
21 | import at.pcgamingfreaks.MarriageMaster.Bungee.Database.Language;
22 |
23 | import lombok.Getter;
24 |
25 | public class CommonMessages
26 | {
27 | private CommonMessages() { /* Prevent class instantiation */ }
28 |
29 | @Getter private static Message messageNoPermission, messageNotMarried, messagePartnerOffline, messageNotFromConsole, messageTargetPartnerNotFound, messagePlayerNotMarried, messagePlayersNotMarried;
30 |
31 | @Getter private static String helpPartnerNameVariable;
32 |
33 | public static void loadCommonMessages(Language language)
34 | {
35 | final String playerNamePlaceholder = "PlayerName";
36 |
37 | helpPartnerNameVariable = language.get("Commands.PartnerNameVariable");
38 | messageNotFromConsole = language.getMessage("NotFromConsole");
39 | messageNoPermission = language.getMessage("Ingame.NoPermission");
40 | messageNotMarried = language.getMessage("Ingame.NotMarried");
41 | messagePartnerOffline = language.getMessage("Ingame.PartnerOffline");
42 | messagePlayerNotMarried = language.getMessage("Ingame.PlayerNotMarried").placeholder(playerNamePlaceholder);
43 | messagePlayersNotMarried = language.getMessage("Ingame.PlayersNotMarried");
44 | messageTargetPartnerNotFound = language.getMessage("Ingame.TargetPartnerNotFound");
45 | }
46 | }
--------------------------------------------------------------------------------
/API/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | MarriageMaster-API-Parent
4 |
5 | MarriageMaster-Parent
6 | at.pcgamingfreaks
7 | ${revision}
8 | ../pom.xml
9 |
10 | ${revision}
11 | pom
12 |
13 | MarriageMaster API Parent
14 | The API for the Marriage Master plugin.
15 |
16 |
17 |
18 |
19 | at.pcgamingfreaks
20 | PluginLib
21 | 1.0.15
22 | provided
23 |
24 |
25 |
26 |
27 | clean install
28 |
29 |
30 |
31 | org.apache.maven.plugins
32 | maven-source-plugin
33 | 2.2.1
34 |
35 |
36 | attach-sources
37 |
38 | jar
39 |
40 |
41 |
42 |
43 |
44 |
45 | org.apache.maven.plugins
46 | maven-javadoc-plugin
47 | 3.1.1
48 |
49 |
50 | attach-javadocs
51 |
52 | jar
53 |
54 |
55 | 8
56 | none
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | MarriageMaster-API-Common
66 | MarriageMaster-API-Bukkit
67 | MarriageMaster-API-Bungee
68 | MarriageMaster-API
69 |
70 |
71 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/SpecialInfoWorker/DbErrorLoadingDataInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.SpecialInfoWorker;
19 |
20 | import at.pcgamingfreaks.Bukkit.Message.Message;
21 | import at.pcgamingfreaks.Bukkit.Message.MessageBuilder;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Permissions;
24 | import at.pcgamingfreaks.Message.MessageColor;
25 |
26 | import org.bukkit.Bukkit;
27 | import org.bukkit.entity.Player;
28 | import org.jetbrains.annotations.NotNull;
29 |
30 | /**
31 | * This worker will inform the admin that the plugin failed to connect to the database, he hopefully is able to solve the problem.
32 | * It registers a new command that only allows to reload the plugin to prevent unnecessary downtime for the server cause of restarts.
33 | */
34 | public class DbErrorLoadingDataInfo extends SpecialInfoBase
35 | {
36 | private final Message messageDbError;
37 |
38 | public DbErrorLoadingDataInfo(final @NotNull MarriageMaster plugin, final @NotNull String msg)
39 | {
40 | super(plugin, Permissions.RELOAD);
41 | Bukkit.getPluginManager().registerEvents(this, plugin);
42 | messageDbError = new MessageBuilder("[Marriage Master] ", MessageColor.GOLD).append("There was a problem loading data from the database! Please check your log file.", MessageColor.RED)
43 | .appendNewLine().append("Error: " + msg, MessageColor.RED).getMessage();
44 | }
45 |
46 | @Override
47 | protected void sendMessage(Player player)
48 | {
49 | messageDbError.send(player);
50 | }
51 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestHomeX.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted.NearestHomeXFormatted;
26 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
27 |
28 | import org.jetbrains.annotations.Nullable;
29 |
30 | import java.text.DecimalFormat;
31 |
32 | @PlaceholderName(aliases = { "Nearest_HomeX", "Nearest_Home_X" })
33 | @PlaceholderFormatted(formattedClass = NearestHomeXFormatted.class)
34 | public class NearestHomeX extends PlaceholderReplacerBaseValueHome
35 | {
36 | ThreadLocal format = ThreadLocal.withInitial(() -> new DecimalFormat("#.0"));
37 |
38 | public NearestHomeX(MarriageMaster plugin)
39 | {
40 | super(plugin);
41 | }
42 |
43 | @Override
44 | protected @Nullable String replaceMarried(MarriagePlayer player)
45 | {
46 | Marriage marriageData = player.getNearestPartnerMarriageData();
47 | //noinspection ConstantConditions
48 | return marriageData.isHomeSet() ? format.get().format(marriageData.getHome().getLocation().getX()) : valueNoHome;
49 | }
50 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestHomeY.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted.NearestHomeYFormatted;
26 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
27 |
28 | import org.jetbrains.annotations.Nullable;
29 |
30 | import java.text.DecimalFormat;
31 |
32 | @PlaceholderName(aliases = { "Nearest_HomeY", "Nearest_Home_Y" })
33 | @PlaceholderFormatted(formattedClass = NearestHomeYFormatted.class)
34 | public class NearestHomeY extends PlaceholderReplacerBaseValueHome
35 | {
36 | ThreadLocal format = ThreadLocal.withInitial(() -> new DecimalFormat("#.0"));
37 |
38 | public NearestHomeY(MarriageMaster plugin)
39 | {
40 | super(plugin);
41 | }
42 |
43 | @Override
44 | protected @Nullable String replaceMarried(MarriagePlayer player)
45 | {
46 | Marriage marriageData = player.getNearestPartnerMarriageData();
47 | //noinspection ConstantConditions
48 | return marriageData.isHomeSet() ? format.get().format(marriageData.getHome().getLocation().getY()) : valueNoHome;
49 | }
50 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Placeholder/Replacer/MultiPartner/NearestHomeZ.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner;
19 |
20 | import at.pcgamingfreaks.Bukkit.Placeholder.PlaceholderName;
21 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Marriage;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
23 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
24 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.PlaceholderFormatted;
25 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.MultiPartner.Formatted.NearestHomeZFormatted;
26 | import at.pcgamingfreaks.MarriageMaster.Bukkit.Placeholder.Replacer.PlaceholderReplacerBaseValueHome;
27 |
28 | import org.jetbrains.annotations.Nullable;
29 |
30 | import java.text.DecimalFormat;
31 |
32 | @PlaceholderName(aliases = { "Nearest_HomeZ", "Nearest_Home_Z" })
33 | @PlaceholderFormatted(formattedClass = NearestHomeZFormatted.class)
34 | public class NearestHomeZ extends PlaceholderReplacerBaseValueHome
35 | {
36 | ThreadLocal format = ThreadLocal.withInitial(() -> new DecimalFormat("#.0"));
37 |
38 | public NearestHomeZ(MarriageMaster plugin)
39 | {
40 | super(plugin);
41 | }
42 |
43 | @Override
44 | protected @Nullable String replaceMarried(MarriagePlayer player)
45 | {
46 | Marriage marriageData = player.getNearestPartnerMarriageData();
47 | //noinspection ConstantConditions
48 | return marriageData.isHomeSet() ? format.get().format(marriageData.getHome().getLocation().getZ()) : valueNoHome;
49 | }
50 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/SpecialInfoWorker/UpgradedInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.SpecialInfoWorker;
19 |
20 | import at.pcgamingfreaks.Bukkit.Message.Message;
21 | import at.pcgamingfreaks.Bukkit.Message.MessageBuilder;
22 | import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
23 | import at.pcgamingfreaks.MarriageMaster.Permissions;
24 | import at.pcgamingfreaks.Message.MessageColor;
25 | import at.pcgamingfreaks.Message.MessageFormat;
26 |
27 | import org.bukkit.Bukkit;
28 | import org.bukkit.entity.Player;
29 |
30 | public class UpgradedInfo extends SpecialInfoBase
31 | {
32 | private final Message messagePluginUpgraded;
33 |
34 | public UpgradedInfo(MarriageMaster plugin)
35 | {
36 | super(plugin, Permissions.RELOAD);
37 | Bukkit.getPluginManager().registerEvents(this, plugin);
38 | // I don't load this message from the config. He just upgraded, the messages in the config would probably be exactly the same.
39 | messagePluginUpgraded = new MessageBuilder("Marriage Master", MessageColor.GOLD).append(" has been upgraded to ", MessageColor.AQUA)
40 | .append(MarriageMaster.getInstance().getDescription().getVersion(), MessageColor.BLUE, MessageFormat.BOLD).append(".", MessageColor.AQUA).appendNewLine()
41 | .append("Your config and language files have been backuped, since they are not compatible with this version of the plugin!", MessageColor.AQUA).appendNewLine()
42 | .append("You can try to use v2.5 to convert them to the new format or apply your changes manually.", MessageColor.AQUA).getMessage();
43 | }
44 |
45 | @Override
46 | protected void sendMessage(Player player)
47 | {
48 | messagePluginUpgraded.send(player);
49 | }
50 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bungee/Database/Language.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.Database;
19 |
20 | import at.pcgamingfreaks.Config.YamlFileManager;
21 | import at.pcgamingfreaks.MarriageMaster.Bungee.MarriageMaster;
22 | import at.pcgamingfreaks.MarriageMaster.Database.ILanguage;
23 | import at.pcgamingfreaks.MarriageMaster.MagicValues;
24 | import at.pcgamingfreaks.Message.MessageColor;
25 | import at.pcgamingfreaks.Version;
26 |
27 | import org.jetbrains.annotations.NotNull;
28 |
29 | import java.util.HashMap;
30 | import java.util.Map;
31 |
32 | public class Language extends at.pcgamingfreaks.Bungee.Config.Language implements ILanguage
33 | {
34 | public Language(final @NotNull MarriageMaster plugin)
35 | {
36 | super(plugin, new Version(MagicValues.LANG_VERSION));
37 | }
38 |
39 | @Override
40 | protected void doUpgrade(final @NotNull YamlFileManager oldLang)
41 | {
42 | Map remapping = new HashMap<>();
43 | remapping.put("Command.Main", "Command.Marry");
44 | super.doUpgrade(oldLang, remapping);
45 | }
46 |
47 | @Override
48 | public @NotNull String getTranslated(final @NotNull String key)
49 | {
50 | return super.getTranslated(key).replace("", MessageColor.RED + MagicValues.SYMBOL_HEART + MessageColor.RESET).replace("", MessageColor.RED + MagicValues.SYMBOL_SMALL_HEART + MessageColor.RESET);
51 | }
52 |
53 | @Override
54 | public @NotNull String getTranslatedPlaceholder(@NotNull String key)
55 | {
56 | throw new UnsupportedOperationException("Placeholders are not available on BungeeCord!");
57 | }
58 |
59 | @Override
60 | public @NotNull String getDialog(@NotNull String key)
61 | {
62 | throw new UnsupportedOperationException("Dialog is not available on BungeeCord!");
63 | }
64 |
65 | }
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Database/FilesMigrator/Converter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Database.FilesMigrator;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Database.Backend.DatabaseBackend;
21 | import at.pcgamingfreaks.MarriageMaster.Database.DatabaseConfiguration;
22 |
23 | import org.jetbrains.annotations.NotNull;
24 |
25 | import java.io.File;
26 | import java.util.Set;
27 | import java.util.logging.Logger;
28 |
29 | public class Converter
30 | {
31 | public static void runConverter(final @NotNull Logger logger, final @NotNull DatabaseConfiguration config, final @NotNull DatabaseBackend newDB, final File pluginDir)
32 | {
33 | logger.info("Loading config file ...");
34 | logger.info("Config file loaded.");
35 |
36 | Files f = new Files(config.getConfigE().getBoolean("Database.UseUUIDs", true), logger, pluginDir);
37 | Set players = f.getPlayers();
38 | Set marriages = f.getMarriages();
39 | f.close();
40 | logger.info("Start migration to " + newDB.getDatabaseTypeName() + " database ...");
41 | for(MigrationPlayer p : players)
42 | {
43 | newDB.migratePlayer(p);
44 | }
45 | logger.info("Finished writing players to " + newDB.getDatabaseTypeName() + " database.");
46 | logger.info("Writing marriages to " + newDB.getDatabaseTypeName() + " database ...");
47 | for(MigrationMarriage m : marriages)
48 | {
49 | newDB.migrateMarriage(m);
50 | }
51 | newDB.checkUUIDs();
52 | logger.info("Finished writing marriages to " + newDB.getDatabaseTypeName() + " database.");
53 | config.setDatabaseType(newDB.getDatabaseTypeName());
54 | logger.info("Finished migrating files to " + newDB.getDatabaseTypeName() + " database.");
55 | }
56 |
57 | private Converter() { /* You should not create an instance of this utility class! */ }
58 | }
--------------------------------------------------------------------------------
/API/MarriageMaster-API-Bukkit/src/at/pcgamingfreaks/MarriageMaster/Bukkit/API/Home.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
19 |
20 | import org.bukkit.Bukkit;
21 | import org.bukkit.Location;
22 | import org.bukkit.World;
23 | import org.jetbrains.annotations.NotNull;
24 | import org.jetbrains.annotations.Nullable;
25 |
26 | /**
27 | * Represents a home for a marriage
28 | */
29 | @SuppressWarnings("unused")
30 | public abstract class Home extends at.pcgamingfreaks.MarriageMaster.API.Home
31 | {
32 | private final Location location;
33 |
34 | protected Home(Location location)
35 | {
36 | this(location, null);
37 | }
38 |
39 | protected Home(@NotNull Location location, @Nullable String homeServer)
40 | {
41 | super(location.getWorld().getName(), homeServer, location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
42 | this.location = location;
43 | }
44 |
45 | protected Home(final @NotNull String world, final @Nullable String server, final double x, final double y, final double z, final float yaw, final float pitch)
46 | {
47 | super(world, server, x, y, z, yaw, pitch);
48 | this.location = new Location(Bukkit.getServer().getWorld(world), x, y, z, yaw, pitch);
49 | }
50 |
51 | /**
52 | * Gets the location of the represented home.
53 | *
54 | * @return The location of the home.
55 | */
56 | public @NotNull Location getLocation()
57 | {
58 | return location;
59 | }
60 |
61 | /**
62 | * Gets the world of the represented home.
63 | *
64 | * @return The x position.
65 | */
66 | public @NotNull World getWorld()
67 | {
68 | return location.getWorld();
69 | }
70 |
71 | /**
72 | * Checks if the home is on the server.
73 | *
74 | * @return True if the home is on the server, false if not.
75 | */
76 | public abstract boolean isOnThisServer();
77 | }
78 |
--------------------------------------------------------------------------------
/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bungee/Listener/JoinLeaveInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 GeorgH93
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package at.pcgamingfreaks.MarriageMaster.Bungee.Listener;
19 |
20 | import at.pcgamingfreaks.MarriageMaster.Bungee.API.MarriagePlayer;
21 | import at.pcgamingfreaks.MarriageMaster.Bungee.MarriageMaster;
22 | import at.pcgamingfreaks.MarriageMaster.Listener.JoinLeaveInfoBase;
23 |
24 | import net.md_5.bungee.api.event.PlayerDisconnectEvent;
25 | import net.md_5.bungee.api.event.PostLoginEvent;
26 | import net.md_5.bungee.api.plugin.Listener;
27 | import net.md_5.bungee.event.EventHandler;
28 | import net.md_5.bungee.event.EventPriority;
29 |
30 | import org.jetbrains.annotations.NotNull;
31 |
32 | import java.util.concurrent.TimeUnit;
33 |
34 | public class JoinLeaveInfo extends JoinLeaveInfoBase implements Listener
35 | {
36 | private final MarriageMaster plugin;
37 | private final long delay;
38 |
39 | public JoinLeaveInfo(MarriageMaster plugin)
40 | {
41 | super(plugin.getLanguage());
42 | this.plugin = plugin;
43 | delay = plugin.getConfig().getJoinInfoDelay() + 1;
44 | }
45 |
46 | @SuppressWarnings("unused")
47 | @EventHandler(priority = Byte.MAX_VALUE)
48 | public void onLogin(PostLoginEvent event)
49 | {
50 | MarriagePlayer player = plugin.getPlayerData(event.getPlayer());
51 | if(player.isMarried())
52 | {
53 | onJoin(player);
54 | }
55 | }
56 |
57 | @SuppressWarnings("unused")
58 | @EventHandler(priority = EventPriority.NORMAL)
59 | public void onDisconnect(PlayerDisconnectEvent event)
60 | {
61 | MarriagePlayer player = plugin.getPlayerData(event.getPlayer());
62 | if(player.isMarried())
63 | {
64 | onLeave(player);
65 | }
66 | }
67 |
68 | @Override
69 | protected void runTaskLater(@NotNull Runnable task)
70 | {
71 | plugin.getProxy().getScheduler().schedule(plugin, task, delay, TimeUnit.SECONDS);
72 | }
73 | }
--------------------------------------------------------------------------------