Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Mobcash/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ Mobcash:
Mushroom Cow: 3
Ocelot: 3
Pig: 3
Rabbit: 3
Sheep: 3
Squid: 3
Villager: 3
Agressive Mobs:
Blaze: 10
Cave Spider: 10
Chicken Jockey: 10
Creeper: 10
Enderman: 10
Endermite: 10
Ghast: 10
Giant: 10
Iron Golem: 10
Expand All @@ -60,4 +63,5 @@ Mobcash:
Zombie: 10
Bosses:
Ender Dragon: 40
Wither: 40
Guardian: 40
Wither: 40
4 changes: 2 additions & 2 deletions Mobcash/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Mobcash
author: Feazes
main: me.Feazes.MobCash.Mobcash
version: 2.3
version: 2.5
description: MobCash gives players money when they kill a mob
depend: [Vault]

commands:
mobcash:
description: shows information about the plugin
permission: mobcash.admin
permission-message: You dont have the permission for this command
permission-message: You don''t have the permission for this command.
5 changes: 4 additions & 1 deletion Mobcash/src/me/Feazes/plugins/mobcash/EntityName.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.Feazes.plugins.mobcash;
package me.Feazes.mobcash;

import org.bukkit.entity.Entity;

Expand All @@ -14,15 +14,18 @@ public static String readEntity(Entity e) {
case CREEPER:return"Creeper";
case ENDERMAN:return"Enderman";
case ENDER_DRAGON:return"Ender Dragon";
case ENDERMITE:return"Endermite";
case GHAST:return"Ghast";
case GIANT:return"Giant";
case GUARDIAN:return"Guardian";
case HORSE:return"Horse";
case IRON_GOLEM:return"Iron Golem";
case MAGMA_CUBE:return"Magma Cube";
case MUSHROOM_COW:return"Mushroom Cow";
case OCELOT:return"Ocelot";
case PIG:return"Pig";
case PIG_ZOMBIE:return"Pig Zombie";
case RABBIT:return"Rabbit";
case SHEEP:return"Sheep";
case SILVERFISH:return"Silver Fish";
case SKELETON:return"Skeleton";
Expand Down
126 changes: 65 additions & 61 deletions Mobcash/src/me/Feazes/plugins/mobcash/Mobcash.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package me.Feazes.plugins.mobcash;
package me.Feazes.mobcash;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import me.Feazes.plugins.mobcash.Metrics.Metrics;
import me.Feazes.plugins.mobcash.Reason.Breeding;
import me.Feazes.plugins.mobcash.Reason.Egg;
import me.Feazes.plugins.mobcash.Reason.Natural;
import me.Feazes.plugins.mobcash.Reason.Slime_Split;
import me.Feazes.plugins.mobcash.Reason.Spawner;
import me.Feazes.plugins.mobcash.World.WorldListener;
import me.Feazes.mobcash.Metrics.Metrics;
import me.Feazes.mobcash.Reason.Breeding;
import me.Feazes.mobcash.Reason.Egg;
import me.Feazes.mobcash.Reason.Natural;
import me.Feazes.mobcash.Reason.Slime_Split;
import me.Feazes.mobcash.Reason.Spawner;
import me.Feazes.mobcash.World.WorldListener;
import net.milkbowl.vault.economy.Economy;

import org.bukkit.ChatColor;
Expand All @@ -22,37 +22,66 @@
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public class Mobcash extends JavaPlugin {

public Economy economy = null;

public List<UUID> spawnedMobs = new ArrayList<UUID>();

//Listeners
public class Mobcash extends JavaPlugin {

// Listeners
public final Breeding breeding = new Breeding(this);

public Economy economy = null;

public final Egg egg = new Egg(this);
public final MobKill mobkill = new MobKill(this);
public final Natural natural = new Natural(this);
public final Slime_Split slimeSplit = new Slime_Split(this);
public List<UUID> spawnedMobs = new ArrayList<UUID>();
public final Spawner spawner = new Spawner(this);
public final WorldListener world = new WorldListener(this);
public final MobKill mobkill = new MobKill(this);


@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
Player p = (Player) sender;
if (label.equalsIgnoreCase("mobcash")) {
if (p.hasPermission("mobcash.admin")) {
if (args.length == 0) {
p.sendMessage(ChatColor.GOLD + "--------[ Mobcash ]--------");
p.sendMessage(ChatColor.GRAY + "v2.5 created by Feazes");
p.sendMessage(ChatColor.GRAY + "Updated by Saiee_");
p.sendMessage(ChatColor.GOLD + "--------[ Commands ]--------");
p.sendMessage(ChatColor.GRAY + "- /mobcash reload");
} else if (args.length == 1) {
if (args[0].equalsIgnoreCase("reload")) {
reloadConfig();
p.sendMessage(ChatColor.GOLD + "[Mobcash] "
+ ChatColor.GRAY + "Config Reloded!");
}
}
}
}
return false;
}

@Override
public void onDisable() {
this.getLogger().info("[Mobcash] has been disabled!");
}

@Override
public void onEnable() {

try {
Metrics metrics = new Metrics(this);
metrics.start();
this.getLogger().info("Now tracking stats!");
} catch (IOException e) {
// Failed to submit the stats :-(
}
Metrics metrics = new Metrics(this);
metrics.start();
this.getLogger().info("Now tracking stats!");
} catch (IOException e) {
// Failed to submit the stats :-(
}

this.getLogger().info("[Mobcash] has been enabled!");
this.getConfig().options().copyDefaults(true);
saveConfig();
setupEconomy();

// Register events
PluginManager pm = this.getServer().getPluginManager();
pm.registerEvents(breeding, this);
Expand All @@ -63,42 +92,17 @@ public void onEnable() {
pm.registerEvents(world, this);
pm.registerEvents(mobkill, this);
}

@Override
public void onDisable() {
this.getLogger().info("[Mobcash] has been disabled!");
}

private boolean setupEconomy()
{

RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}

return (economy != null);
}

@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
Player p = (Player) sender;
if (label.equalsIgnoreCase("mobcash")) {
if (p.hasPermission("mobcash.admin")) {
if (args.length == 0) {
p.sendMessage(ChatColor.GOLD + "--------[Mobcash]--------");
p.sendMessage(ChatColor.GRAY+"v2.0 created by Feazes");
p.sendMessage(ChatColor.GRAY+"- /mobcash reload");
} else if (args.length == 1) {
if (args[0].equalsIgnoreCase("reload")) {
reloadConfig();
p.sendMessage(ChatColor.GOLD + "[Mobcash]"+ ChatColor.GRAY+" reloaded config!");
}
}
}

private boolean setupEconomy() {

RegisteredServiceProvider<Economy> economyProvider = getServer()
.getServicesManager().getRegistration(
net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
return false;

return (economy != null);
}

}