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

Conflicts:
	Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java
This commit is contained in:
Jonathan Williams 2015-02-10 18:17:13 -08:00
commit 6383cf7ce6
8 changed files with 57 additions and 39 deletions

View File

@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="NoCheatPlus">
<CLASSES>
<root url="jar://$PROJECT_DIR$/Libraries/NoCheatPlus.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -85,16 +85,7 @@ public class PlayerStatsRepository
{ {
exception.printStackTrace(); exception.printStackTrace();
try return false;
{
Thread.sleep(10);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
return addPlayer(playerName);
} }
finally finally
{ {

View File

@ -19,5 +19,6 @@
<orderEntry type="library" name="jooq" level="project" /> <orderEntry type="library" name="jooq" level="project" />
<orderEntry type="library" name="commons-dbcp2" level="project" /> <orderEntry type="library" name="commons-dbcp2" level="project" />
<orderEntry type="module" module-name="Classpath.Dummy" /> <orderEntry type="module" module-name="Classpath.Dummy" />
<orderEntry type="library" name="NoCheatPlus" level="project" />
</component> </component>
</module> </module>

View File

@ -107,6 +107,10 @@ public abstract class RepositoryBase implements Listener
if (callable != null) if (callable != null)
callable.processResultSet(preparedStatement.getGeneratedKeys()); callable.processResultSet(preparedStatement.getGeneratedKeys());
} }
catch (SQLException exception)
{
// exception.getSQLState()
}
catch (Exception exception) catch (Exception exception)
{ {
exception.printStackTrace(); exception.printStackTrace();

View File

@ -277,6 +277,8 @@ public class Treasure
_rewards[_currentReward].giveReward("Treasure", _player); _rewards[_currentReward].giveReward("Treasure", _player);
} }
_currentReward = _rewards.length;
// Remove any extra blocks // Remove any extra blocks
resetBlockInfo(_chestBlockInfo); resetBlockInfo(_chestBlockInfo);
resetBlockInfo(_openedChestBlockInfo); resetBlockInfo(_openedChestBlockInfo);

View File

@ -169,7 +169,7 @@ public class TreasureLocation implements Listener
treasure.update(); treasure.update();
if (treasure.isFinished() && treasure.getFinishedTickCount() >= 80) if (!treasure.getPlayer().isOnline() || (treasure.isFinished() && treasure.getFinishedTickCount() >= 80))
{ {
treasure.cleanup(); treasure.cleanup();
@ -191,24 +191,6 @@ public class TreasureLocation implements Listener
} }
} }
@EventHandler
public void preventGadgetBlockEvent(GadgetBlockEvent event)
{
if (isTreasureInProgress())
{
List<Block> blocks = event.getBlocks();
for (Block block : blocks)
{
if (_currentTreasure.containsBlock(block))
{
event.setCancelled(true);
return;
}
}
}
}
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void interact(PlayerInteractEvent event) public void interact(PlayerInteractEvent event)
{ {
@ -237,6 +219,10 @@ public class TreasureLocation implements Listener
@EventHandler @EventHandler
public void inventoryOpen(InventoryOpenEvent event) public void inventoryOpen(InventoryOpenEvent event)
{ {
// Ignore punish gui
if (event.getInventory().getTitle() != null && event.getInventory().getTitle().contains("Punish"))
return;
if (isTreasureInProgress() && event.getPlayer().equals(_currentTreasure.getPlayer())) if (isTreasureInProgress() && event.getPlayer().equals(_currentTreasure.getPlayer()))
{ {
event.setCancelled(true); event.setCancelled(true);
@ -268,7 +254,7 @@ public class TreasureLocation implements Listener
Location centerLocation = _currentTreasure.getCenterBlock().getLocation().add(0.5, 1.5, 0.5); Location centerLocation = _currentTreasure.getCenterBlock().getLocation().add(0.5, 1.5, 0.5);
double toDistanceFromCenter = centerLocation.distanceSquared(toLocation); double toDistanceFromCenter = centerLocation.distanceSquared(toLocation);
if (toDistanceFromCenter <= 16 && player.getVelocity().lengthSquared() < 10) if (toDistanceFromCenter <= 16)
{ {
// Only cancel movement if they are moving towards the center // Only cancel movement if they are moving towards the center
double fromDistanceFromCenter = centerLocation.distanceSquared(fromLocation); double fromDistanceFromCenter = centerLocation.distanceSquared(fromLocation);
@ -276,7 +262,7 @@ public class TreasureLocation implements Listener
{ {
Location spawnLocation = new Location(player.getWorld(), 0, 64, 0); Location spawnLocation = new Location(player.getWorld(), 0, 64, 0);
UtilAction.velocity(player, UtilAlg.getTrajectory(player.getLocation(), spawnLocation).multiply(-1), 1.5, true, 0.8, 0, 1.0, true); UtilAction.velocity(player, UtilAlg.getTrajectory(player.getLocation(), spawnLocation).multiply(-1), 1.5, true, 0.8, 0, 1.0, true);
event.setTo(event.getFrom()); // event.setTo(event.getFrom());
} }
} }
} }
@ -293,6 +279,29 @@ public class TreasureLocation implements Listener
} }
} }
@EventHandler
public void preventGadgetBlockEvent(GadgetBlockEvent event)
{
List<Block> blocks = event.getBlocks();
int x = _chestBlock.getX();
int y = _chestBlock.getY();
int z = _chestBlock.getZ();
for (Block block : blocks)
{
int dx = Math.abs(x - block.getX());
int dy = Math.abs(y - block.getY());
int dz = Math.abs(z - block.getZ());
if (dx <= 4 && dz <= 4 && dy <= 4)
{
event.setCancelled(true);
return;
}
}
}
@EventHandler @EventHandler
public void quit(PlayerQuitEvent event) public void quit(PlayerQuitEvent event)
{ {

View File

@ -1,8 +1,8 @@
package mineplex.game.clans; package mineplex.game.clans;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import net.minecraft.server.v1_7_R4.MinecraftServer; import net.minecraft.server.v1_7_R4.MinecraftServer;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.antihack.AntiHack; import mineplex.core.antihack.AntiHack;
import mineplex.core.blockrestore.BlockRestore; import mineplex.core.blockrestore.BlockRestore;
@ -68,7 +68,6 @@ public class Clans extends JavaPlugin
new Spawn(this, serverStatusManager.getCurrentServerName()); new Spawn(this, serverStatusManager.getCurrentServerName());
Teleport teleport = new Teleport(this); Teleport teleport = new Teleport(this);
Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName()); Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
new MessageManager(this, _clientManager, preferenceManager, new IgnoreManager(this, _clientManager, preferenceManager, portal), null);
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion()); new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
@ -78,6 +77,9 @@ public class Clans extends JavaPlugin
BlockRestore blockRestore = new BlockRestore(this); BlockRestore blockRestore = new BlockRestore(this);
IgnoreManager ignoreManager = new IgnoreManager(this, _clientManager, preferenceManager, portal);
new MessageManager(this, _clientManager, preferenceManager, ignoreManager, punish);
new MemoryFix(this); new MemoryFix(this);
new Explosion(this, blockRestore); new Explosion(this, blockRestore);
new FriendManager(this, _clientManager, preferenceManager, portal); new FriendManager(this, _clientManager, preferenceManager, portal);

View File

@ -9,6 +9,6 @@
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="Mineplex.Core.Common" /> <orderEntry type="module" module-name="Mineplex.Core.Common" />
<orderEntry type="library" name="craftbukkit" level="project" /> <orderEntry type="library" name="craftbukkit" level="project" />
<orderEntry type="library" name="NoCheatPlus" level="project" />
</component> </component>
</module> </module>