Skip to content

Commit

Permalink
Merge pull request #3 from PixelOutlaw/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
UltraFaceguy authored Apr 18, 2020
2 parents 86a52a8 + ec82cf9 commit a3650f9
Show file tree
Hide file tree
Showing 40 changed files with 1,020 additions and 405 deletions.
21 changes: 19 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</parent>

<artifactId>loot</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>
<packaging>jar</packaging>

<name>loot</name>
Expand All @@ -48,6 +48,13 @@
<tag>HEAD</tag>
</scm>

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
Expand All @@ -62,13 +69,23 @@
<dependency>
<groupId>io.pixeloutlaw</groupId>
<artifactId>strife</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>com.github.UltraFaceguy</groupId>
<artifactId>FacelandMarket</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.github.Mitsugaru</groupId>
<artifactId>PlayerPoints</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
Expand Down
37 changes: 36 additions & 1 deletion src/main/java/info/faceland/loot/LootPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import info.faceland.loot.api.sockets.SocketGem;
import info.faceland.loot.api.sockets.SocketGemBuilder;
import info.faceland.loot.api.sockets.effects.SocketEffect;
import info.faceland.loot.api.tier.Tier;
import info.faceland.loot.api.tier.TierBuilder;
import info.faceland.loot.commands.LootCommand;
import info.faceland.loot.creatures.LootCreatureModBuilder;
Expand All @@ -55,11 +54,15 @@
import info.faceland.loot.io.SmartTextFile;
import info.faceland.loot.items.LootCustomItemBuilder;
import info.faceland.loot.items.LootItemBuilder;
import info.faceland.loot.items.prefabs.ArcaneEnhancer;
import info.faceland.loot.items.prefabs.PurifyingScroll;
import info.faceland.loot.listeners.DeconstructListener;
import info.faceland.loot.listeners.EnchantDegradeListener;
import info.faceland.loot.listeners.EnchantMenuListener;
import info.faceland.loot.listeners.EntityDeathListener;
import info.faceland.loot.listeners.HeadHelmetsListener;
import info.faceland.loot.listeners.InteractListener;
import info.faceland.loot.listeners.ItemListListener;
import info.faceland.loot.listeners.PawnMenuListener;
import info.faceland.loot.listeners.StrifeListener;
import info.faceland.loot.listeners.anticheat.AnticheatListener;
Expand All @@ -86,6 +89,7 @@
import info.faceland.loot.sockets.LootSocketGemBuilder;
import info.faceland.loot.sockets.effects.LootSocketPotionEffect;
import info.faceland.loot.tier.LootTierBuilder;
import info.faceland.loot.tier.Tier;
import info.faceland.loot.utils.DropUtil;
import info.faceland.loot.utils.MaterialUtil;
import io.pixeloutlaw.minecraft.spigot.config.MasterConfiguration;
Expand All @@ -101,15 +105,19 @@
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import land.face.market.data.PlayerMarketState.FilterFlagA;
import land.face.strife.StrifePlugin;
import net.milkbowl.vault.economy.Economy;
import org.black_ixx.playerpoints.PlayerPoints;
import org.black_ixx.playerpoints.PlayerPointsAPI;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.EntityType;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import se.ranzdo.bukkit.methodcommand.CommandHandler;

Expand Down Expand Up @@ -157,6 +165,7 @@ public final class LootPlugin extends FacePlugin {
private StrifePlugin strifePlugin;

private Economy economy;
private PlayerPointsAPI playerPointsAPI;

public static LootPlugin getInstance() {
return instance;
Expand Down Expand Up @@ -215,6 +224,7 @@ public void enable() {
scrollManager = new ScrollManager();

setupEconomy();
setupPlayerPoints();

loadItemGroups();
loadCraftBases();
Expand All @@ -235,6 +245,9 @@ public void enable() {
MaterialUtil.refreshConfig();
DropUtil.refresh();

ArcaneEnhancer.rebuild();
PurifyingScroll.rebuild();

strifePlugin = (StrifePlugin) Bukkit.getPluginManager().getPlugin("Strife");

CommandHandler handler = new CommandHandler(this);
Expand All @@ -247,6 +260,8 @@ public void enable() {
Bukkit.getPluginManager().registerEvents(new AnticheatListener(this), this);
Bukkit.getPluginManager().registerEvents(new EnchantDegradeListener(this), this);
Bukkit.getPluginManager().registerEvents(new EnchantMenuListener(), this);
Bukkit.getPluginManager().registerEvents(new ItemListListener(this), this);
Bukkit.getPluginManager().registerEvents(new HeadHelmetsListener(), this);
Bukkit.getPluginManager().registerEvents(new PawnMenuListener(this), this);
if (potionTriggersEnabled) {
Bukkit.getPluginManager().registerEvents(new SocketsListener(gemCacheManager), this);
Expand All @@ -262,9 +277,20 @@ public void disable() {
HandlerList.unregisterAll(this);
Bukkit.getScheduler().cancelTasks(this);

playerPointsAPI = null;
economy = null;
}

private boolean setupPlayerPoints() {
Plugin ppplugin = Bukkit.getPluginManager().getPlugin("PlayerPoints");
if (ppplugin == null) {
playerPointsAPI = null;
return false;
}
playerPointsAPI = ((PlayerPoints) ppplugin).getAPI();
return true;
}

private boolean setupEconomy() {
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
return false;
Expand Down Expand Up @@ -377,6 +403,7 @@ private void loadScrolls() {
scroll.setWeight(cs.getDouble("weight", 100));
scroll.setMinLevel(cs.getInt("min-level", 0));
scroll.setMaxLevel(cs.getInt("max-level", 14));
scroll.setCustomData(cs.getInt("custom-data", 100));
scroll.setBroadcast(cs.getBoolean("broadcast", false));
scrollManager.addScroll(key, scroll);
}
Expand Down Expand Up @@ -849,6 +876,10 @@ private void loadTiers() {
Tier t = builder.build();
t.getItemSuffixes().addAll(cs.getStringList("name-suffixes"));
loadedTiers.add(t.getName());

String marketFilterFlag = cs.getString("filter-flag", "ALL");
t.setFilterFlag(FilterFlagA.valueOf(marketFilterFlag));

tiers.add(t);
}
debug("Loaded tiers: " + loadedTiers.toString());
Expand Down Expand Up @@ -968,6 +999,10 @@ public Economy getEconomy() {
return economy;
}

public PlayerPointsAPI getPlayerPointsAPI() {
return playerPointsAPI;
}

public StrifePlugin getStrifePlugin() {
return strifePlugin;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@

import info.faceland.loot.api.items.CustomItem;
import info.faceland.loot.api.sockets.SocketGem;
import info.faceland.loot.api.tier.Tier;

import info.faceland.loot.data.JunkItemData;
import info.faceland.loot.enchantments.EnchantmentTome;
import info.faceland.loot.tier.Tier;
import java.util.Map;

public interface CreatureModBuilder {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/info/faceland/loot/api/creatures/MobInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@

import info.faceland.loot.api.items.CustomItem;
import info.faceland.loot.api.sockets.SocketGem;
import info.faceland.loot.api.tier.Tier;
import info.faceland.loot.data.JunkItemData;
import info.faceland.loot.enchantments.EnchantmentTome;
import org.bukkit.entity.EntityType;

import info.faceland.loot.tier.Tier;
import java.util.Map;
import org.bukkit.entity.EntityType;

public interface MobInfo {

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/info/faceland/loot/api/groups/ItemGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
*/
package info.faceland.loot.api.groups;

import org.bukkit.Material;

import java.util.Set;
import org.bukkit.Material;

public interface ItemGroup {

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/info/faceland/loot/api/items/ItemBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
*/
package info.faceland.loot.api.items;

import info.faceland.loot.api.tier.Tier;
import info.faceland.loot.data.BuiltItem;
import info.faceland.loot.data.ItemRarity;
import info.faceland.loot.tier.Tier;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public interface ItemBuilder {
boolean isBuilt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
package info.faceland.loot.api.managers;

import info.faceland.loot.api.groups.ItemGroup;
import info.faceland.loot.api.tier.Tier;
import info.faceland.loot.tier.Tier;
import java.util.Map;
import org.bukkit.Material;

import java.util.Set;
import org.bukkit.Material;

public interface ItemGroupManager {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/info/faceland/loot/api/sockets/SocketGem.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

import info.faceland.loot.api.groups.ItemGroup;
import info.faceland.loot.api.sockets.effects.SocketEffect;
import org.bukkit.inventory.ItemStack;

import java.util.List;
import org.bukkit.inventory.ItemStack;

public interface SocketGem extends Comparable<SocketGem> {

String getName();

double getWeight();
Expand Down
63 changes: 0 additions & 63 deletions src/main/java/info/faceland/loot/api/tier/Tier.java

This file was deleted.

6 changes: 4 additions & 2 deletions src/main/java/info/faceland/loot/api/tier/TierBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

import info.faceland.loot.api.groups.ItemGroup;
import info.faceland.loot.data.ItemStat;
import org.bukkit.ChatColor;

import info.faceland.loot.tier.Tier;
import java.util.List;
import java.util.Set;
import land.face.market.data.PlayerMarketState.FilterFlagA;

public interface TierBuilder {

Expand Down Expand Up @@ -55,6 +55,8 @@ public interface TierBuilder {

TierBuilder withCustomDataInterval(int i);

TierBuilder withFilterFlag(FilterFlagA filterFlag);

TierBuilder withItemGroups(Set<ItemGroup> s);

}
Loading

0 comments on commit a3650f9

Please sign in to comment.