Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2015-10-01 07:39:17 -07:00
commit bc84dc6817
12 changed files with 62 additions and 13 deletions

View File

@ -19,6 +19,7 @@
<element id="module-output" name="Mineplex.Database" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.5.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/commons-dbcp2-2.0.1.jar" path-in-jar="/" />
<element id="module-output" name="Mineplex.PlayerCache" />
</root>
</artifact>
</component>

View File

@ -12,6 +12,10 @@ import org.bukkit.inventory.ItemStack;
public class UtilItem
{
private static final Material[] FOOD_LIST = { Material.APPLE, Material.BAKED_POTATO, Material.BREAD, Material.CARROT, Material.CARROT_ITEM, Material.COOKED_CHICKEN,
Material.COOKED_FISH, Material.GRILLED_PORK, Material.COOKIE, Material.GOLDEN_APPLE, Material.GOLDEN_CARROT, Material.MELON, Material.MUSHROOM_SOUP, Material.POISONOUS_POTATO,
Material.PUMPKIN_PIE, Material.RAW_BEEF, Material.RAW_CHICKEN, Material.RAW_FISH, Material.PORK, Material.ROTTEN_FLESH, Material.SPIDER_EYE, Material.COOKED_BEEF};
public static LinkedList<ItemContainer> matchItem(Player caller, String items, boolean inform)
{
LinkedList<ItemContainer> matchList = new LinkedList<ItemContainer>();
@ -136,4 +140,20 @@ public class UtilItem
return item.getType() + ":" + item.getAmount() + ":" + item.getDurability() + ":" + data;
}
public static boolean isFood(ItemStack item)
{
return item == null ? false : isFood(item.getType());
}
public static boolean isFood(Material material)
{
for (Material food : FOOD_LIST)
{
if (food.equals(material))
return true;
}
return false;
}
}

View File

@ -0,0 +1,29 @@
package mineplex.core;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.UtilItem;
public class FoodDupeFix extends MiniPlugin
{
public FoodDupeFix(JavaPlugin plugin)
{
super("Food Dupe Fix", plugin);
}
// Use Lowest priority so we get called first event.getItem isn't changed
@EventHandler(priority = EventPriority.LOWEST)
public void fixFoodDupe(PlayerItemConsumeEvent event)
{
if (UtilItem.isFood(event.getItem()))
{
if (!event.getItem().equals(event.getPlayer().getItemInHand()))
{
event.setCancelled(true);
}
}
}
}

View File

@ -56,7 +56,7 @@ public enum Achievement
//Survival Games
SURVIVAL_GAMES_WINS("Katniss Everdeen", 600,
new String[]{"Survival Games.Wins"},
new String[]{"Win 20 games of Survival Games"},
new String[]{"Win 30 games of Survival Games"},
new int[]{30},
AchievementCategory.SURVIVAL_GAMES),

View File

@ -75,7 +75,7 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
if (pet.GetPetType() == EntityType.WITHER)
{
itemLore.add(C.cBlack);
itemLore.add(ChatColor.RESET + C.cYellow + "Unlocked with Legend Rank");
itemLore.add(ChatColor.RESET + C.cGreen + "Unlocked with Legend Rank");
}
}

View File

@ -59,8 +59,7 @@ public class MorphBunny extends MorphGadget
" ",
C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" ,
" ",
C.cPurple + "Special Limited Time Morph",
C.cPurple + "Purchase at www.mineplex.com/shop",
C.cPurple + "No longer available",
},
-1,
Material.MONSTER_EGG, (byte)98);

View File

@ -38,7 +38,7 @@ public class MorphPig extends MorphGadget
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink",
C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce",
" ",
C.cPurple + "Unlocked with Ultra Rank",
C.cAqua + "Unlocked with Ultra Rank",
},
-1,
Material.PORK, (byte)0);

View File

@ -47,7 +47,7 @@ public class MorphWither extends MorphGadget
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull",
" ",
C.cPurple + "Unlocked with Legend Rank",
C.cGreen + "Unlocked with Legend Rank",
},
-1,
Material.SKULL_ITEM, (byte)1);
@ -177,10 +177,7 @@ public class MorphWither extends MorphGadget
@EventHandler
public void legendOwner(PlayerJoinEvent event)
{
if (Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.LEGEND ||
Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.ADMIN ||
Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.DEVELOPER ||
Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.OWNER)
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.LEGEND))
{
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
}

View File

@ -22,7 +22,7 @@ public class ParticleLegend extends ParticleGadget
C.cWhite + "These mystic particle attach to",
C.cWhite + "only the most legendary of players!",
" ",
C.cPurple + "Unlocked with Legend Rank",
C.cGreen + "Unlocked with Legend Rank",
},
-2,
Material.ENDER_PORTAL, (byte)0);

View File

@ -146,7 +146,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
{
Player p = event.getPlayer();
Rank rank = _clientManager.Get(p).GetRank();
if (rank == Rank.LEGEND || rank == Rank.ADMIN || rank == Rank.DEVELOPER || rank == Rank.OWNER)
if (rank.has(Rank.LEGEND))
{
_donationManager.Get(p.getName()).AddUnknownSalesPackagesOwned("Widder");
}

View File

@ -4,6 +4,8 @@ import java.io.File;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.FoodDupeFix;
import org.omg.CORBA._PolicyStub;
import net.minecraft.server.v1_7_R4.BiomeBase;
@ -154,6 +156,7 @@ public class Arcade extends JavaPlugin
new MemoryFix(this);
new CustomTagFix(this, packetHandler);
new TablistFix(this);
new FoodDupeFix(this);
//Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);

View File

@ -947,7 +947,7 @@ public class GameFlagManager implements Listener
Game game = Manager.GetGame();
if (game == null) return;
if (!game.IsLive())
if (!(game.IsLive() || game.GetState() == GameState.Prepare))
return;
if (!game.TeleportsDisqualify)