Skip to content

Commit

Permalink
Merge pull request #39 from IamTheDefender/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
IamTheDefender authored Feb 4, 2024
2 parents d46f054 + 11db650 commit 8b13cf8
Show file tree
Hide file tree
Showing 144 changed files with 1,578 additions and 2,349 deletions.
90 changes: 89 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,89 @@
/.idea/
# Git
*.orig
!.gitignore

# Windows
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.lnk

# Linux
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*

# MacOS
.DS_Store
.AppleDouble
.LSOverride
._*

# Java
*.class
*.log
*.ctxt
.mtj.tmp/
*.jar
*.war
*.nar
*.ear
hs_err_pid*

# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
pom.properties
createdFiles.lst
inputFiles.lst
dependency-reduced-pom.xml
buildNumber.properties

# Intellij
*.iml
*.java___jb_tmp___
.idea/*
*.ipr
*.iws
/out/
.idea_modules/

# Eclipse
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.project
.externalToolBuilders/
*.launch
.cproject
.classpath
.buildpath
.target

# NetBeans
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Github Repo for Cosmetics Addon
This is the github repo for the cosmetics addon, wiki at https://iamthedefender.gitbook.io/bedwars1058-cosmetics/
Not the worst code eh?
# BedWars Cosmetics
This is an addon that adds various sets of cosmetics to enchance a player's experience in your server. Before you start using this you would require a supported bedwars plugin and some other plugins on which this plugin rely to make it's features work as expected. The current author and maintainer of this plugin is [IamTheDefender](https://iamthedefender.xyz). As of 2022, this plugin is open source and will stay that way. This plugin is open source under the GPL-3.0 License

Thank you to all the contributers!
## Contributions
All contributions are welcome, after all, it is better to have all the required features in this plugin itself rather than creating multiple forks. I would really appericate if you contribute into this project. But please note that, try not to use NMS

## Documentation (or Wiki)
A detailed documentaion of this plugin is provided at the [wiki](https://dev-wiki.iamthedefender.xyz/bedwars-cosmetics), please look through the wiki before reporting an issue in this GitHub Repository or the Discord Support Server.

## Support Server
You can join our [discord support server](discord.iamthedefender.xyz) if you have issues with the plugin but please do check wiki before doing so, you can create a ticket in the discord server only if you think you need immediate help with a critical issue, I check every message whenever I have the time so don't ping me please.

## 3rd Party libraries
- [HikariCP](https://github.com/brettwooldridge/HikariCP)
- [HCore](https://github.com/hakan-krgn/hCore)
- [XSeries](https://github.com/CryptoMorin/XSeries)
- [ParticleLib](https://github.com/ByteZ1337/ParticleLib/tree/master)
Binary file added lib/proxy-plugin-1.0-SNAPSHOT (1).jar
Binary file not shown.
21 changes: 0 additions & 21 deletions license

This file was deleted.

22 changes: 15 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<exclude>com/cryptomorin/xseries/NMSExtras*</exclude>
<exclude>com/cryptomorin/xseries/NoteBlockMusic*</exclude>
<exclude>com/cryptomorin/xseries/SkullCacheListener*</exclude>
<exclude>com/hakan/core/scoreboard</exclude>
</excludes>
</filter>
</filters>
Expand Down Expand Up @@ -156,17 +155,13 @@
<type>jar</type>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>


<dependency>
<groupId>com.github.hakan-krgn.hCore</groupId>
<artifactId>hCore-bukkit</artifactId>
<version>0.7.3.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
Expand All @@ -191,11 +186,24 @@
<version>1.8.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>

<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.tompkeuper</groupId>
<artifactId>bedwars2023-proxy</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/proxy-plugin-1.0-SNAPSHOT (1).jar</systemPath>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
package me.defender.cosmetics.api;
package me.defender.cosmetics;

import com.hakan.core.HCore;
import me.defender.cosmetics.Cosmetics;
import me.defender.cosmetics.api.CosmeticsAPI;
import me.defender.cosmetics.api.cosmetics.CosmeticsType;
import me.defender.cosmetics.util.Utility;
import me.defender.cosmetics.database.PlayerData;
import me.defender.cosmetics.api.database.IDatabase;
import me.defender.cosmetics.api.handler.IHandler;
import me.defender.cosmetics.data.PlayerData;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;

public class BwcAPI {
public class BwcAPI implements CosmeticsAPI {

/**
* Check if MySQL is enabled.
* @return true if enabled.
*/
public Boolean isMySQL() {
public boolean isMySQL() {
return Cosmetics.getInstance().getConfig().getBoolean("mysql.enable");
}

@Override
public IHandler getHandler() {
return Cosmetics.getInstance().getHandler();
}

/**
* Get the selected cosmetic for a player.
* @param p Player
Expand All @@ -30,7 +37,7 @@ public String getSelectedCosmetic(Player p, CosmeticsType cos){
if(p == null){
return null;
}
PlayerData playerData = Utility.playerDataList.get(p.getUniqueId());
PlayerData playerData = Cosmetics.getInstance().getPlayerManager().getPlayerData(p.getUniqueId());
switch (cos){
case BedBreakEffects:
return playerData.getBedDestroy();
Expand Down Expand Up @@ -65,7 +72,7 @@ public String getSelectedCosmetic(Player p, CosmeticsType cos){
* @param value Cosmetic value.
*/
public void setSelectedCosmetic(Player p, CosmeticsType cos, String value){
PlayerData playerData = Utility.playerDataList.get(p.getUniqueId());
PlayerData playerData = Cosmetics.getInstance().getPlayerManager().getPlayerData(p.getUniqueId());
switch (cos){
case BedBreakEffects:
playerData.setBedDestroy(value);
Expand Down Expand Up @@ -101,25 +108,20 @@ public void setSelectedCosmetic(Player p, CosmeticsType cos, String value){
playerData.setWoodSkin(value);
break;
}
Utility.playerDataList.replace(p.getUniqueId(), playerData);
// Ran ASYNC
HCore.asyncScheduler().run(playerData::save);
}

/**
* Get the vault economy.
* @return the vault economy.
*/
public Economy getEco(){
final RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
return rsp.getProvider();
}

/**
* Check if the plugin is running on a proxy.
* @return true if running on a proxy.
*/
public Boolean isProxy(){
return Bukkit.getPluginManager().getPlugin("BedWarsProxy") != null;
public boolean isProxy(){
return Bukkit.getPluginManager().getPlugin("BedWarsProxy") != null ||
Bukkit.getPluginManager().getPlugin("BWProxy2023") != null;
}

public IDatabase getDatabase(){
return Cosmetics.getInstance().getRemoteDatabase();
}
}
Loading

0 comments on commit 8b13cf8

Please sign in to comment.