Merge branch 'clans/alpha' of ssh://184.154.0.242:7999/min/Mineplex into clans/beta

This commit is contained in:
NewGarbo 2016-01-26 09:24:53 +00:00
commit 467af4b835
6 changed files with 54 additions and 6 deletions

View File

@ -53,7 +53,7 @@ import net.minecraft.server.v1_8_R3.MinecraftServer;
public class Clans extends JavaPlugin
{
public static final String VERSION = "0.18b";
public static final String VERSION = "0.19";
private String WEB_CONFIG = "webServer";
// Modules

View File

@ -1,6 +1,5 @@
package mineplex.game.clans.clans.ban.commands;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;

View File

@ -211,7 +211,7 @@ public class ClansRegions extends MiniPlugin
if (_manager.getClaimMap().containsKey(chunkStr))
{
System.out.println("get claim map contains " + chunkStr); // this is really really slowing server startup down. just saying.
// System.out.println("get claim map contains " + chunkStr); // this is really really slowing server startup down. just saying.
continue;
}

View File

@ -6,6 +6,7 @@ import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -41,6 +42,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.weather.WeatherChangeEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.Dye;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
@ -485,12 +487,32 @@ public class Gameplay extends MiniPlugin
}
}
if (!Recharge.Instance.use(event.getPlayer(), "Place Sapling", 1000, true, false))
if (!Recharge.Instance.use(event.getPlayer(), "Place Sapling", 20 * 60 * 1000, true, false))
{
event.setCancelled(true);
return;
}
}
@EventHandler
public void blockDispenser(BlockDispenseEvent event)
{
// Block bonemeal
if (event.getItem().getType() == Material.INK_SACK && ((Dye) event.getItem().getData()).getColor() == DyeColor.WHITE)
{
event.setCancelled(true);
}
// Block flint-and-steal
if (event.getItem().getType() == Material.FLINT_AND_STEEL)
{
event.setCancelled(true);
}
if (event.getItem().getType() == Material.FIREWORK_CHARGE)
{
event.setCancelled(true);
}
}
// @EventHandler(priority = EventPriority.LOWEST)

View File

@ -1,6 +1,8 @@
package mineplex.game.clans.gameplay.safelog;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -49,6 +51,12 @@ public class SafeLog extends MiniPlugin
isSafeLog = true;
}
if (_flying.contains(player.getName()))
{
_flying.remove(player.getName());
return;
}
if (!isSafeLog)
{
NPCManager.getInstance().spawnLogoutNpc(player);
@ -93,6 +101,8 @@ public class SafeLog extends MiniPlugin
}
}
}
private List<String> _flying = new ArrayList<>();
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerQuit(PlayerQuitEvent event)
@ -101,6 +111,16 @@ public class SafeLog extends MiniPlugin
onPlayerQuit(event.getPlayer());
}
@EventHandler(priority = EventPriority.HIGHEST)
public void flyCheck(PlayerKickEvent event)
{
if (event.getPlayer().getItemInHand() != null && event.getPlayer().getItemInHand().getItemMeta() != null && (C.cGold + "Wind Blade").equals(event.getPlayer().getItemInHand().getItemMeta().getDisplayName()))
if (event.getReason().contains("flying is not enabled"))
return;
_flying.add(event.getPlayer().getName());
}
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerKicked(PlayerKickEvent event)

View File

@ -211,15 +211,22 @@ public class NPCManager extends MiniPlugin
{
CombatLogNPC npc = iterator.next();
if (Bukkit.getPlayer(npc.getPlayerInfo().getPlayerName()) != null)
{
System.out.println("{NPCMANAGER} ORIGINAL PLAYER ALIVE AND DESPAWNING");
npc.despawn();
iterator.remove();
}
if (!npc.isAlive())
{
System.out.println("NOT ALIVE AND REMOVING");
System.out.println("{NPCMANAGER} NOT ALIVE AND REMOVING");
npc.remove();
iterator.remove();
}
else if (npc.getAliveDuation() > COMBAT_LOG_DURATION)
{
System.out.println("DESPAWNING");
System.out.println("{NPCMANAGER} DESPAWNING");
npc.despawn();
iterator.remove();
}