Skip to content

Commit

Permalink
Update_15
Browse files Browse the repository at this point in the history
  • Loading branch information
Happyuky7 committed Sep 21, 2022
1 parent 6a0e5bd commit 8c0cea1
Show file tree
Hide file tree
Showing 21 changed files with 112 additions and 62 deletions.
2 changes: 1 addition & 1 deletion Code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.happyrogelio7</groupId>
<artifactId>SepareWorldItems</artifactId>
<version>1.2.19-DEV-112</version>
<version>1.2.19-DEV-116</version>
<packaging>jar</packaging>

<name>SepareWorldItems</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package com.github.happyrogelio7.separeworlditems;

/*
* Code by: HappyRogelio7
* Github: https://github.com/happyrogelio7
* License: Custom
* Link: https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS
*/

import com.github.happyrogelio7.separeworlditems.commands.SepareWorldItemsCMD;
import com.github.happyrogelio7.separeworlditems.filemanagers.FileManager;
import com.github.happyrogelio7.separeworlditems.listeners.WorldChangeEvent;
Expand All @@ -13,6 +20,7 @@
import org.bukkit.plugin.java.JavaPlugin;

import java.util.ArrayList;
import java.util.Objects;
import java.util.UUID;
import java.util.logging.Level;

Expand Down Expand Up @@ -66,24 +74,25 @@ public void onEnable() {
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&f [Register]: &aReload Files."));
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&3&m------------------------------------"));

/*if (getConfig().getString("general.config").contains("1.2.19-DEV-112")) {
if (!getConfig().getString("general.config").equals("1.2.19-DEV-116")) {
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&3&m------------------------------------"));
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&f [Error]: &cConfig Version ERROR."));
getLogger().log(Level.SEVERE, "[Error]: &cConfig Version ERROR.");
getLogger().log(Level.SEVERE, "[Error]: Config Version ERROR.");
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&3&m------------------------------------"));
//Bukkit.getPluginManager().disablePlugin(this);
//onDisable();
}

if (getConfig().getString("general.java-version").contains("17")) {
if (!Objects.equals(getConfig().getString("general.java-version"), "17")) {
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&3&m------------------------------------"));
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&f [Error]: &cConfig Version JAVA ERROR."));
getLogger().log(Level.SEVERE, "[Error]: &cConfig Version JAVA ERROR.");
getLogger().log(Level.SEVERE, "[Error]: &cJava 17");
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&f [Error]: &cJava Build 17"));
getLogger().log(Level.SEVERE, "[Error]: Config Version JAVA ERROR.");
getLogger().log(Level.SEVERE, "[Error]: Java Build 17");
Bukkit.getConsoleSender().sendMessage(MessageColors.getMsgColor("&3&m------------------------------------"));
//Bukkit.getPluginManager().disablePlugin(this);
//onDisable();
}*/
}

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package com.github.happyrogelio7.separeworlditems.commands;

/*
* Code by: HappyRogelio7
* Github: https://github.com/happyrogelio7
* License: Custom
* Link: https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS
*/

import com.github.happyrogelio7.separeworlditems.SepareWorldItems;
import com.github.happyrogelio7.separeworlditems.utils.MessageColors;
import org.bukkit.command.Command;
Expand Down Expand Up @@ -136,6 +143,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
if (!plugin.getConfig().getBoolean("Options.bypass-world-options.use_bypass", false)) {
p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-world-options.use_bypass")
.replaceAll(MessageColors.getMsgColor("%prefix%"), plugin.getMsgs().getString("general.prefix"))));
return true;

}

Expand All @@ -149,58 +157,58 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;
}

if (args[1].equalsIgnoreCase("on")){
if (args[1].equalsIgnoreCase("on")) {

p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-warning-alert")
.replaceAll(MessageColors.getMsgColor("%prefix%"), plugin.getMsgs().getString("general.prefix"))));
p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-warning-alert")
.replaceAll(MessageColors.getMsgColor("%prefix%"), plugin.getMsgs().getString("general.prefix"))));

plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".name", p.getName());
plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".name", p.getName());

System.out.println("worlds-1");
System.out.println("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName());
System.out.println("worlds-1");
System.out.println("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName());

plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".inventory", p.getInventory().getContents());
plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".armor", p.getInventory().getArmorContents());
plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".inventory", p.getInventory().getContents());
plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".armor", p.getInventory().getArmorContents());

plugin.getBypassSave().save();
plugin.getBypassSave().reload();
plugin.getBypassSave().save();
plugin.getBypassSave().reload();

plugin.playerlist1.add(p.getUniqueId());
plugin.playerlist1.add(p.getUniqueId());

p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-enabled")
.replaceAll(MessageColors.getMsgColor("%prefix%"), plugin.getMsgs().getString("general.prefix"))));
p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-enabled")
.replaceAll(MessageColors.getMsgColor("%prefix%"), plugin.getMsgs().getString("general.prefix"))));

return true;
return true;

} else if (args[1].equalsIgnoreCase("off")){
} else if (args[1].equalsIgnoreCase("off")) {

plugin.getBypassSave().getString("save-bypass." + p.getUniqueId() + ".name");
if (Objects.equals(plugin.getBypassSave().getString("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName()), p.getWorld().getName())) {
plugin.getBypassSave().getString("save-bypass." + p.getUniqueId() + ".name");
if (Objects.equals(plugin.getBypassSave().getString("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName()), p.getWorld().getName())) {

String toConfig = plugin.getBypassSave().getString("save-bypass." + p.getUniqueId() + ".worlds.");
String toConfig = plugin.getBypassSave().getString("save-bypass." + p.getUniqueId() + ".worlds.");

if (toConfig.contains(p.getWorld().getName() + ".inventory"))
if (toConfig.contains(p.getWorld().getName() + ".inventory"))

for (String s : plugin.getBypassSave().getConfigurationSection("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".inventory").getKeys(false)) {
for (String s : plugin.getBypassSave().getConfigurationSection("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".inventory").getKeys(false)) {

p.getInventory().setItem(Integer.parseInt(s), plugin.getBypassSave().getItemStack("inventory." + s));
}
p.getInventory().setItem(Integer.parseInt(s), plugin.getBypassSave().getItemStack("inventory." + s));
}

for (String s : plugin.getBypassSave().getConfigurationSection("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".armor").getKeys(false)) {

for (String s : plugin.getBypassSave().getConfigurationSection("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName() + ".armor").getKeys(false)) {
p.getInventory().setItem(Integer.parseInt(s), plugin.getBypassSave().getItemStack("armor." + s));
}

p.getInventory().setItem(Integer.parseInt(s), plugin.getBypassSave().getItemStack("armor." + s));
plugin.playerlist1.remove(p.getUniqueId());
}

plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName(), null);
plugin.playerlist1.remove(p.getUniqueId());
}

plugin.getBypassSave().set("save-bypass." + p.getUniqueId() + ".worlds." + p.getWorld().getName(), null);
plugin.playerlist1.remove(p.getUniqueId());
p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-disabled")
.replaceAll(MessageColors.getMsgColor("%prefix%"), plugin.getMsgs().getString("general.prefix"))));

p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-disabled")
.replaceAll(MessageColors.getMsgColor("%prefix%"), plugin.getMsgs().getString("general.prefix"))));

return true;
return true;

} else {
p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.unknown-cmd-args")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package com.github.happyrogelio7.separeworlditems.filemanagers;

/*
* Code by: HappyRogelio7
* Github: https://github.com/happyrogelio7
* License: Custom
* Link: https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS
*/

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package com.github.happyrogelio7.separeworlditems.filemanagers;

/*
* Code by: HappyRogelio7
* Github: https://github.com/happyrogelio7
* License: Custom
* Link: https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS
*/

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package com.github.happyrogelio7.separeworlditems.listeners;

/*
* Code by: HappyRogelio7
* Github: https://github.com/happyrogelio7
* License: Custom
* Link: https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS
*/

import com.github.happyrogelio7.separeworlditems.SepareWorldItems;
import com.github.happyrogelio7.separeworlditems.filemanagers.FileManager2;
import com.github.happyrogelio7.separeworlditems.utils.MessageColors;
Expand Down Expand Up @@ -43,10 +50,10 @@ public void onWorldChange(PlayerChangedWorldEvent event){

if (plugin.playerlist1.contains(p.getUniqueId())) {

if (plugin.getConfig().getBoolean("Options.bypass-world-options.use_bypass", true)) {
if (!plugin.getConfig().getBoolean("Options.bypass-world-options.use_bypass", true)) {

p.sendMessage(MessageColors.getMsgColor(plugin.getMsgs().getString("general.bypass.bypass-warning-alert")));

return;
}
plugin.playerlist1.remove(p.getUniqueId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

public class MessageColors {

/*
Code by: HappyRogelio7
Github: https://github.com/HappyRogelio7
License: Custom
Link: https://github.com/HappyRogelio7/getMsgColorSpigotClass1
*/

public static String getMsgColor(String text) {

if (Bukkit.getVersion().contains("1.16") || Bukkit.getVersion().contains("1.16.1")
Expand Down
6 changes: 3 additions & 3 deletions Code/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# Discord OR Support: https://discord.gg/3EebYUyeUX
# Config Plugin SepareWorldItems 1.2.19
# Update = true
# Config = 1.2.19-DEV-112
# Config = 1.2.19-DEV-116
#
general:
update: true
update-link: "https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS/" #Do not change.
config: 1.2.19-DEV-112 #Do not change
config: 1.2.19-DEV-116 #Do not change
java-version: 17 #Do not change, This version is build for Java 17.
#
# Options.
Expand All @@ -29,7 +29,7 @@ Options:
health-default-save: true #BUKKIT
health-custom-save: false #CUSTOM
#
# Alpha Option bypass world:
# Beta Option bypass world:
#
bypass-world-options:
use_bypass: false
Expand Down
2 changes: 1 addition & 1 deletion Code/src/main/resources/langs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Config Langs
# Config = 1.2.19-DEV-112
# Config = 1.2.19-DEV-116
# Prefix Value: %prefix%
general:
prefix: "&8[&aSepareWorldItems&8]&r" #Value: %prefix%
Expand Down
4 changes: 3 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

Web: https://happyrogelio7.github.io/
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ SEPARE WORLD ITEMS, It's a echo plugin to be for your invention by world.

## Download

### Author's note:
**As of Version 1.2.19, there will only be one version of the plugin which will be compatible with any version from 1.16 to 1.19.2 without errors, it should also work perfectly on 1.12.2 servers. Not sure if it will work 100% on 1.8.8**

[Donwload / 1.17-1.19 Version Java 17](https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS/blob/master/SepareWorldItems-Downloads/Updates/SepareWorldItems-1.2.18.jar)

[Donwload / 1.8-1.16 Version java 11](https://github.com/HappyRogelio7/SEPARE-WORLD-ITEMS/blob/master/SepareWorldItems-Downloads/Updates/SepareWorldItems-1.2.18-Legacy.jar)
Expand All @@ -28,7 +31,7 @@ $ cd SEPARE-WORLD-ITEMS/Code/
Now inside the directory you execute the following maven command:

```bash
$ mvn clean install
$ mvn clean install package
```

Then you will find the compiled in the following folder
Expand All @@ -38,7 +41,7 @@ SEPARE-WORLD-ITEMS/Code/target/
```


--
---

## Join us

Expand All @@ -53,7 +56,7 @@ SEPARE-WORLD-ITEMS/Code/target/

[Discord](https://discord.gg/3EebYUyeUX), Support My Server Discord

[Kaory Studios](https://kaorystudios.xyz), Support Kaory Studios
[Kaory Studios](https://kaorystudios.xyz), Website Kaory Studios

[Kaory Studios Discord](https://discord.gg/Gw7m8kC), Support Kaory Studios

Expand Down
28 changes: 14 additions & 14 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ currently being supported with security updates.

**Official Verions | Security Update Support**

| Version | Supported |
| ------- | ------------------ |
| 1.2.18 | :white_check_mark: |
| 1.2.18-Legacy | :white_check_mark: |
| 1.2.17 | :white_check_mark: |
| 1.2.17-Legacy | :white_check_mark: |
| < 1.2.16 | :x: |
| Version | Supported |
|--------------|--------------------|
| 1.2.18 | :white_check_mark: |
| 1.2.18-Legacy | :white_check_mark: |
| 1.2.17 | :x: |
| 1.2.17-Legacy | :x: |
| < 1.2.16 | :x: |

**Dev Versions, Beta's, Alpha's | Security Update Support**

| Version | Supported |
| ------- | ------------------ |
| 1.2.19-DEV-112 | :white_check_mark: |
| 1.2.19-DEV-100 | :x: |
| 1.2.17-DEV-101 | :x: |
| 1.2.17-DEV-100 | :x: |
| < 1.2.16 | :x: |
| Version | Supported |
|----------------| ------------------ |
| 1.2.19-DEV-116 | :white_check_mark: |
| 1.2.19-DEV-100 | :x: |
| 1.2.17-DEV-101 | :x: |
| 1.2.17-DEV-100 | :x: |
| < 1.2.16 | :x: |

## Reporting a Vulnerability

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 8c0cea1

Please sign in to comment.