This commit is contained in:
Carter 2016-12-05 15:45:29 -05:00
commit 7a14952611
7 changed files with 215 additions and 163 deletions

View File

@ -13,7 +13,7 @@ This plugin allows the players to get spawn eggs by throwing regular eggs at mob
* Explosion effects.
## Installation and requirements ##
**Vault is not required unless you intend to use it**
**Vault is supported but not required**
Download the jar file and the [configuration](http://dev.bukkit.org/server-mods/eggcatcher/pages/configuration/) file will be generated on the first startup.

View File

@ -75,7 +75,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.10-R0.1-SNAPSHOT</version>
<version>1.11-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -64,37 +64,7 @@ public class EggCatcher extends JavaPlugin {
public void CheckConfigurationFile() {
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
if (configVersion == 2.6) {
this.saveConfig();
} else if (configVersion == 2.5) {
this.getConfig().set("CatchChance.PolarBear", 100.0);
this.getConfig().set("VaultCost.PolarBear", 0);
this.getConfig().set("ItemCost.Amount.PolarBear", 0);
this.getConfig().set("HealthPercentage.PolarBear", 100.0);
this.getConfig().set("ConfigVersion", 2.6);
this.saveConfig();
} else if (configVersion == 2.2) {
this.getConfig().set("DeleteVillagerInventoryOnCatch", false);
this.getConfig().set("ConfigVersion", 2.5);
this.saveConfig();
} else if (configVersion == 2.0) {
this.getConfig().set("CatchChance.Endermite", 100.0);
this.getConfig().set("VaultCost.Endermite", 0);
this.getConfig().set("ItemCost.Amount.Endermite", 0);
this.getConfig().set("HealthPercentage.Endermite", 100.0);
this.getConfig().set("CatchChance.Guardian", 100.0);
this.getConfig().set("VaultCost.Guardian", 0);
this.getConfig().set("ItemCost.Amount.Guardian", 0);
this.getConfig().set("HealthPercentage.Guardian", 100.0);
this.getConfig().set("CatchChance.Rabbit", 100.0);
this.getConfig().set("VaultCost.Rabbit", 0);
this.getConfig().set("ItemCost.Amount.Rabbit", 0);
this.getConfig().set("HealthPercentage.Rabbit", 100.0);
this.getConfig().set("ConfigVersion", 2.2);
if (configVersion == 3.0) {
this.saveConfig();
} else {
this.saveResource("config.yml", true);

View File

@ -22,13 +22,20 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
public enum EggType {
EVOKER(EntityType.EVOKER, 34, "Evoker"),
VEX(EntityType.VEX, 35, "Vex"),
VINDICATOR(EntityType.VINDICATOR, 36, "Vindicator"),
PIG_ZOMBIE(EntityType.PIG_ZOMBIE, 57, "PigZombie"),
MAGMA_CUBE(EntityType.MAGMA_CUBE, 62, "MagmaCube"),
CAVE_SPIDER(EntityType.CAVE_SPIDER, 59, "CaveSpider"),
MUSHROOM_COW(EntityType.MUSHROOM_COW, 96, "MushroomCow"),
CREEPER(EntityType.CREEPER, 50, "Creeper"),
WITHER_SKELETON(EntityType.WITHER_SKELETON, 5, "WitherSkeleton"),
STRAY(EntityType.STRAY, 6, "Stray"),
SKELETON(EntityType.SKELETON, 51, "Skeleton"),
SPIDER(EntityType.SPIDER, 52, "Spider"),
HUSK(EntityType.HUSK, 23, "Husk"),
ZOMBIE_VILLAGER(EntityType.ZOMBIE_VILLAGER, 27, "ZombieVillager"),
ZOMBIE(EntityType.ZOMBIE, 54, "Zombie"),
SLIME(EntityType.SLIME, 55, "Slime"),
GHAST(EntityType.GHAST, 56, "Ghast"),
@ -45,13 +52,18 @@ public enum EggType {
OCELOT(EntityType.OCELOT, 98, "Ocelot"),
BAT(EntityType.BAT, 65, "Bat"),
WITCH(EntityType.WITCH, 66, "Witch"),
ZOMBIE_HORSE(EntityType.ZOMBIE_HORSE, 29, "ZombieHorse"),
SKELETON_HORSE(EntityType.SKELETON_HORSE, 28, "SkeletonHorse"),
LLAMA(EntityType.LLAMA, 103, "Llama"),
DONKEY(EntityType.DONKEY, 31, "Donkey"),
MULE(EntityType.MULE, 32, "Mule"),
HORSE(EntityType.HORSE, 100, "Horse"),
ENDERMITE(EntityType.ENDERMITE, 67, "Endermite"),
ELDER_GUARDIAN(EntityType.ELDER_GUARDIAN, 4, "ElderGuardian"),
GUARDIAN(EntityType.GUARDIAN, 68, "Guardian"),
RABBIT(EntityType.RABBIT, 101, "Rabbit"),
POLAR_BEAR(EntityType.POLAR_BEAR, 102, "PolarBear");
POLAR_BEAR(EntityType.POLAR_BEAR, 102, "PolarBear"),
SHULKER(EntityType.SHULKER, 69, "Shulker");
private final EntityType entityType;
private final Integer creatureId;

View File

@ -17,7 +17,7 @@ public class NbtReflection {
Object rootTag = Class.forName("net.minecraft.server." + version + ".NBTTagCompound").newInstance();
Object nbtEntityTag = Class.forName("net.minecraft.server." + version + ".NBTTagCompound").newInstance();
nbtEntityTag.getClass().getMethod("setString", String.class, String.class).invoke(nbtEntityTag, "id", entityType);
nbtEntityTag.getClass().getMethod("setString", String.class, String.class).invoke(nbtEntityTag, "id", "minecraft:" + entityType);
rootTag.getClass().getMethod("set", String.class, rootTag.getClass().getSuperclass())
.invoke(rootTag, "EntityTag", nbtEntityTag);

View File

@ -16,124 +16,180 @@ VaultTargetBankAccount: ""
DeleteVillagerInventoryOnCatch: false
LogEggCaptures: false
CatchChance:
Pig: 100.0
Sheep: 100.0
MushroomCow: 100.0
Cow: 100.0
Chicken: 100.0
Squid: 100.0
Wolf: 100.0
Creeper: 0.0
Skeleton: 100.0
CaveSpider: 100.0
Spider: 100.0
PigZombie: 100.0
Zombie: 100.0
MagmaCube: 100.0
Slime: 100.0
Ghast: 0.0
Enderman: 100.0
Silverfish: 100.0
Blaze: 0.0
Villager: 100.0
Ocelot: 100.0
Witch: 100.0
Bat: 100.0
Horse: 100.0
Blaze: 100.0
CaveSpider: 100.0
Chicken: 100.0
Cow: 100.0
Creeper: 100.0
Donkey: 100.0
ElderGuardian: 100.0
Enderman: 100.0
Endermite: 100.0
Evoker: 100.0
Ghast: 100.0
Guardian: 100.0
Rabbit: 100.0
Horse: 100.0
Husk: 100.0
Llama: 100.0
MagmaCube: 100.0
Mule: 100.0
MushroomCow: 100.0
Ocelot: 100.0
Pig: 100.0
PigZombie: 100.0
PolarBear: 100.0
Rabbit: 100.0
Sheep: 100.0
Shulker: 100.0
Silverfish: 100.0
Skeleton: 100.0
SkeletonHorse: 100.0
Slime: 100.0
Spider: 100.0
Squid: 100.0
Stray: 100.0
Vex: 100.0
Villager: 100.0
Vindicator: 100.0
Witch: 100.0
WitherSkeleton: 100.0
Wolf: 100.0
Zombie: 100.0
ZombieHorse: 100.0
ZombieVillager: 100.0
VaultCost:
Pig: 0.0
Sheep: 0.0
MushroomCow: 0.0
Cow: 0.0
Chicken: 0.0
Squid: 0.0
Wolf: 0.0
Creeper: 0.0
Skeleton: 0.0
CaveSpider: 0.0
Spider: 0.0
PigZombie: 0.0
Zombie: 0.0
MagmaCube: 0.0
Slime: 0.0
Ghast: 0.0
Enderman: 0.0
Silverfish: 0.0
Blaze: 0.0
Villager: 0.0
Ocelot: 0.0
Witch: 0.0
Bat: 0.0
Horse: 0.0
Blaze: 0.0
CaveSpider: 0.0
Chicken: 0.0
Cow: 0.0
Creeper: 0.0
Donkey: 0.0
ElderGuardian: 0.0
Enderman: 0.0
Endermite: 0.0
Evoker: 0.0
Ghast: 0.0
Guardian: 0.0
Rabbit: 0.0
Horse: 0.0
Husk: 0.0
Llama: 0.0
MagmaCube: 0.0
Mule: 0.0
MushroomCow: 0.0
Ocelot: 0.0
Pig: 0.0
PigZombie: 0.0
PolarBear: 0.0
Rabbit: 0.0
Sheep: 0.0
Shulker: 0.0
Silverfish: 0.0
Skeleton: 0.0
SkeletonHorse: 0.0
Slime: 0.0
Spider: 0.0
Squid: 0.0
Stray: 0.0
Vex: 0.0
Villager: 0.0
Vindicator: 0.0
Witch: 0.0
WitherSkeleton: 0.0
Wolf: 0.0
Zombie: 0.0
ZombieHorse: 0.0
ZombieVillager: 0.0
ItemCost:
ItemId: 371
ItemData: 0
Amount:
Pig: 0
Sheep: 0
MushroomCow: 0
Cow: 0
Chicken: 0
Squid: 0
Wolf: 0
Creeper: 0
Skeleton: 0
CaveSpider: 0
Spider: 0
PigZombie: 0
Zombie: 0
MagmaCube: 0
Slime: 0
Ghast: 0
Enderman: 0
Silverfish: 0
Blaze: 0
Villager: 0
Ocelot: 0
Witch: 0
Bat: 0
Horse: 0
Endermite: 0
Guardian: 0
Rabbit: 0
PolarBear: 0
Bat: 0.0
Blaze: 0.0
CaveSpider: 0.0
Chicken: 0.0
Cow: 0.0
Creeper: 0.0
Donkey: 0.0
ElderGuardian: 0.0
Enderman: 0.0
Endermite: 0.0
Evoker: 0.0
Ghast: 0.0
Guardian: 0.0
Horse: 0.0
Husk: 0.0
Llama: 0.0
MagmaCube: 0.0
Mule: 0.0
MushroomCow: 0.0
Ocelot: 0.0
Pig: 0.0
PigZombie: 0.0
PolarBear: 0.0
Rabbit: 0.0
Sheep: 0.0
Shulker: 0.0
Silverfish: 0.0
Skeleton: 0.0
SkeletonHorse: 0.0
Slime: 0.0
Spider: 0.0
Squid: 0.0
Stray: 0.0
Vex: 0.0
Villager: 0.0
Vindicator: 0.0
Witch: 0.0
WitherSkeleton: 0.0
Wolf: 0.0
Zombie: 0.0
ZombieHorse: 0.0
ZombieVillager: 0.0
HealthPercentage:
Pig: 100.0
Sheep: 100.0
MushroomCow: 100.0
Cow: 100.0
Chicken: 100.0
Squid: 100.0
Wolf: 100.0
Creeper: 100.0
Skeleton: 100.0
CaveSpider: 100.0
Spider: 100.0
PigZombie: 100.0
Zombie: 100.0
MagmaCube: 100.0
Slime: 100.0
Ghast: 100.0
Enderman: 100.0
Silverfish: 100.0
Blaze: 100.0
Villager: 100.0
Ocelot: 100.0
Witch: 100.0
Bat: 100.0
Horse: 100.0
Blaze: 100.0
CaveSpider: 100.0
Chicken: 100.0
Cow: 100.0
Creeper: 100.0
Donkey: 100.0
ElderGuardian: 100.0
Enderman: 100.0
Endermite: 100.0
Evoker: 100.0
Ghast: 100.0
Guardian: 100.0
Rabbit: 100.0
Horse: 100.0
Husk: 100.0
Llama: 100.0
MagmaCube: 100.0
Mule: 100.0
MushroomCow: 100.0
Ocelot: 100.0
Pig: 100.0
PigZombie: 100.0
PolarBear: 100.0
Rabbit: 100.0
Sheep: 100.0
Shulker: 100.0
Silverfish: 100.0
Skeleton: 100.0
SkeletonHorse: 100.0
Slime: 100.0
Spider: 100.0
Squid: 100.0
Stray: 100.0
Vex: 100.0
Villager: 100.0
Vindicator: 100.0
Witch: 100.0
WitherSkeleton: 100.0
Wolf: 100.0
Zombie: 100.0
ZombieHorse: 100.0
ZombieVillager: 100.0
Messages:
PermissionFail: "You do not have permission to catch this mob!"
VaultFail: "It costs %s dollars to catch this mob!"
@ -143,4 +199,4 @@ Messages:
CatchChanceFail: "You failed to catch this mob!"
CatchChanceSuccess: ""
HealthPercentageFail: "The mob has more than %s percent health left and cannot be caught!"
ConfigVersion: 2.6
ConfigVersion: 3.0

View File

@ -1,5 +1,5 @@
name: EggCatcher
version: 2.6
version: 3.0
description: This plugin allows you to catch mobs in eggs.
author: shansen
@ -10,34 +10,48 @@ permissions:
description: Gives access to catch all types of mobs.
default: op
children:
eggcatcher.catch.pig: true
eggcatcher.catch.sheep: true
eggcatcher.catch.cow: true
eggcatcher.catch.chicken: true
eggcatcher.catch.squid: true
eggcatcher.catch.wolf: true
eggcatcher.catch.mushroomCow: true
eggcatcher.catch.creeper: true
eggcatcher.catch.skeleton: true
eggcatcher.catch.spider: true
eggcatcher.catch.zombie: true
eggcatcher.catch.slime: true
eggcatcher.catch.ghast: true
eggcatcher.catch.pigzombie: true
eggcatcher.catch.enderman: true
eggcatcher.catch.cavespider: true
eggcatcher.catch.silverfish: true
eggcatcher.catch.blaze: true
eggcatcher.catch.magmacube: true
eggcatcher.catch.villager: true
eggcatcher.catch.ocelot: true
eggcatcher.catch.bat: true
eggcatcher.catch.witch: true
eggcatcher.catch.horse: true
eggcatcher.catch.blaze: true
eggcatcher.catch.cavespider: true
eggcatcher.catch.chicken: true
eggcatcher.catch.cow: true
eggcatcher.catch.creeper: true
eggcatcher.catch.donkey: true
eggcatcher.catch.elderguardian: true
eggcatcher.catch.enderman: true
eggcatcher.catch.endermite: true
eggcatcher.catch.evoker: true
eggcatcher.catch.ghast: true
eggcatcher.catch.guardian: true
eggcatcher.catch.rabbit: true
eggcatcher.catch.horse: true
eggcatcher.catch.husk: true
eggcatcher.catch.llama: true
eggcatcher.catch.magmacube: true
eggcatcher.catch.mule: true
eggcatcher.catch.mushroomcow: true
eggcatcher.catch.ocelot: true
eggcatcher.catch.pig: true
eggcatcher.catch.pigzombie: true
eggcatcher.catch.polarbear: true
eggcatcher.catch.rabbit: true
eggcatcher.catch.sheep: true
eggcatcher.catch.shulker: true
eggcatcher.catch.silverfish: true
eggcatcher.catch.skeleton: true
eggcatcher.catch.skeletonhorse: true
eggcatcher.catch.slime: true
eggcatcher.catch.spider: true
eggcatcher.catch.squid: true
eggcatcher.catch.stray: true
eggcatcher.catch.vex: true
eggcatcher.catch.villager: true
eggcatcher.catch.vindicator: true
eggcatcher.catch.witch: true
eggcatcher.catch.witherskeleton: true
eggcatcher.catch.wolf: true
eggcatcher.catch.zombie: true
eggcatcher.catch.zombiehorse: true
eggcatcher.catch.zombievillager: true
eggcatcher.free:
description: Makes catching a mob free.
default: false