-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete re-writing of methods and fixing all existing bugs. Complete optimization. Independence of InvUI external library (Own inventory management system)
- Loading branch information
1 parent
ed0d86c
commit 5060218
Showing
23 changed files
with
2,378 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
# Default ignored files | ||
/shelf/ | ||
/workspace.xml | ||
# Editor-based HTTP Client requests | ||
/httpRequests/ | ||
# Datasource local storage ignored files | ||
/dataSources/ | ||
/dataSources.local.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
460 changes: 208 additions & 252 deletions
460
src/main/java/ir/Mehran1022/EventCore/Commands/EventCommand.java
Large diffs are not rendered by default.
Oops, something went wrong.
61 changes: 18 additions & 43 deletions
61
src/main/java/ir/Mehran1022/EventCore/Listeners/PlayerJoinEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,35 @@ | ||
/* | ||
MIT License | ||
package ir.mehran1022.eventcore.Listeners; | ||
|
||
Copyright (c) 2023 Mehran1022 | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
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. | ||
*/ | ||
|
||
package ir.Mehran1022.EventCore.Listeners; | ||
|
||
import ir.Mehran1022.EventCore.Main; | ||
import ir.Mehran1022.EventCore.Managers.ConfigManager; | ||
import ir.Mehran1022.EventCore.Utils.Common; | ||
import ir.mehran1022.eventcore.Main; | ||
import ir.mehran1022.eventcore.Managers.ConfigManager; | ||
import ir.mehran1022.eventcore.Utils.Common; | ||
import ir.mehran1022.eventcore.Commands.EventCommand; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
|
||
import java.io.IOException; | ||
import java.util.UUID; | ||
|
||
import static ir.Mehran1022.EventCore.Commands.EventCommand.Active; | ||
import static ir.Mehran1022.EventCore.Commands.EventCommand.EventDesc; | ||
|
||
public class PlayerJoinEvent implements Listener { | ||
public final class PlayerJoinEvent implements Listener { | ||
@EventHandler | ||
public void EventNotification (org.bukkit.event.player.PlayerJoinEvent event) { | ||
Player player = event.getPlayer(); | ||
if (Active) { | ||
Common.SendMessage(player, ConfigManager.PREFIX + EventDesc); | ||
} | ||
} | ||
@EventHandler | ||
public void DataSave (org.bukkit.event.player.PlayerJoinEvent event) { | ||
public void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event) { | ||
Player player = event.getPlayer(); | ||
UUID uuid = player.getUniqueId(); | ||
Main.PlayersData.set(uuid.toString() + ".NAME", player.getName()); | ||
Main.PlayersData.set(uuid.toString() + ".BANNED", false); | ||
String uuidString = uuid.toString(); | ||
|
||
if (EventCommand.Active) { | ||
Common.sendMessage(player, ConfigManager.PREFIX + EventCommand.EventDesc); | ||
} | ||
|
||
Main.playersData.set(uuidString + ".NAME", player.getName()); | ||
Main.playersData.set(uuidString + ".BANNED", false); | ||
|
||
try { | ||
Main.PlayersData.save(Main.File); | ||
Main.playersData.save(Main.file); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.