forked from Team-Inceptus/Novaconomy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to v1.8.2 (Team-Inceptus#120)
* Fix Team-Inceptus#114 (Team-Inceptus#115) Co-authored-by: ajh123 <ajh123@users.noreply.github.com> * Fix typo in custom_model_data and fix Vault (Team-Inceptus#116) * Fix Team-Inceptus#114 * Fix another typo * Make vault load once database has * Move vault and loadFiles into onLoad * Fix Plugin attempted to register task while disabled initializing * Fix another register task while disabled initializing --------- Co-authored-by: ajh123 <ajh123@users.noreply.github.com> Co-authored-by: Gregory Mitchell <gamercoder215@gmail.com> * Bump org.mockito:mockito-core from 5.5.0 to 5.6.0 (Team-Inceptus#118) Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.5.0 to 5.6.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](mockito/mockito@v5.5.0...v5.6.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gregory Mitchell <gamercoder215@gmail.com> * Fix 1.20.2 Protocol Changes, Null Checks (Closes Team-Inceptus#111) * Update Lamp to v3.1.7 * Fix API Errors (Closes Team-Inceptus#117) - Update Lamp - Add Null Check for NovaPlayer#stats - Make Generic Settings Serializable * Update Version to 1.8.2 * Fix 1.20.2 Support Fix Packet Handlers * Fix `#playerStatistics`, Add Market Stock Command * Add Market Stock Implementation, Update Market API - Add Checks in `#setStock` - Add `setStock(Iterable, long)` - Create MaterialSelector for parsing tags and `all` as Material types * Add Market Stock Command Translations * Update Novaconomy.java Update Donation Link * Add Whitelisted & Blacklisted Market Economies (Closes Team-Inceptus#113) * Update GUIManager.java Fix Whitelisted/Blacklisted Economies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Samuel Hulme <41990982+ajh123@users.noreply.github.com> Co-authored-by: ajh123 <ajh123@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
Showing
32 changed files
with
539 additions
and
171 deletions.
There are no files selected for viewing
296 changes: 161 additions & 135 deletions
296
abstraction/src/main/java/us/teaminceptus/novaconomy/abstraction/CommandWrapper.java
Large diffs are not rendered by default.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
abstraction/src/main/java/us/teaminceptus/novaconomy/util/command/MaterialSelector.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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package us.teaminceptus.novaconomy.util.command; | ||
|
||
import com.google.common.collect.ImmutableSet; | ||
import org.bukkit.Material; | ||
import us.teaminceptus.novaconomy.api.NovaConfig; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public final class MaterialSelector { | ||
|
||
private final Set<Material> materials = new HashSet<>(); | ||
|
||
MaterialSelector() {} | ||
|
||
MaterialSelector(Material... materials) { | ||
this.materials.addAll(Arrays.asList(materials)); | ||
} | ||
|
||
MaterialSelector(Iterable<Material> materials) { | ||
materials.forEach(this.materials::add); | ||
} | ||
|
||
public MaterialSelector add(Material material) { | ||
materials.add(material); | ||
return this; | ||
} | ||
|
||
public Set<Material> getMaterials() { | ||
return ImmutableSet.copyOf(materials); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public static MaterialSelector of(String entry) { | ||
String[] split = entry.split(":"); | ||
String entry0 = split[split.length - 1]; | ||
|
||
if (entry0.equalsIgnoreCase("all")) | ||
return new MaterialSelector(Material.values()); | ||
|
||
if (entry0.startsWith("#")) { | ||
try { | ||
Class<?> tags = Class.forName("org.bukkit.Tag"); | ||
|
||
Object tag = tags.getField(entry0.substring(1).toUpperCase()).get(null); | ||
Set<Material> materials = (Set<Material>) tags.getMethod("getValues").invoke(tag); | ||
|
||
return new MaterialSelector(materials); | ||
} catch (ClassNotFoundException ignored) { | ||
return null; | ||
} catch (ReflectiveOperationException e) { | ||
NovaConfig.print(e); | ||
} | ||
} else | ||
return new MaterialSelector(Material.matchMaterial(entry0)); | ||
|
||
return null; | ||
} | ||
} |
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
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
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
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
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
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
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
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
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.