v0.87.3 - Fixed players being able to leave and keep their items.
This commit is contained in:
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name: MobArena
|
name: MobArena
|
||||||
main: com.garbagemule.MobArena.MobArena
|
main: com.garbagemule.MobArena.MobArena
|
||||||
version: 0.87.2
|
version: 0.87.3
|
||||||
commands:
|
commands:
|
||||||
mobarena:
|
mobarena:
|
||||||
description: Base command for MobArena
|
description: Base command for MobArena
|
||||||
|
|||||||
@@ -221,11 +221,11 @@ public class ArenaManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ArenaManager.isRunning)
|
|
||||||
MAUtils.clearInventory(p);
|
|
||||||
|
|
||||||
if (playerSet.contains(p))
|
if (playerSet.contains(p))
|
||||||
|
{
|
||||||
playerSet.remove(p);
|
playerSet.remove(p);
|
||||||
|
MAUtils.clearInventory(p);
|
||||||
|
}
|
||||||
|
|
||||||
if (readySet.contains(p))
|
if (readySet.contains(p))
|
||||||
readySet.remove(p);
|
readySet.remove(p);
|
||||||
|
|||||||
@@ -156,6 +156,60 @@ public class MAUtils
|
|||||||
|
|
||||||
// ///////////////////////////////////////////////////////////////////// */
|
// ///////////////////////////////////////////////////////////////////// */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces all tabs with 4 spaces in config.yml
|
||||||
|
|
||||||
|
public static void fixConfigFile()
|
||||||
|
{
|
||||||
|
new File("plugins/MobArena").mkdir();
|
||||||
|
File configFile = new File("plugins/MobArena/config.yml");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if(!configFile.exists())
|
||||||
|
{
|
||||||
|
configFile.createNewFile();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Create an inputstream from the file
|
||||||
|
FileInputStream fis = new FileInputStream(configFile);
|
||||||
|
|
||||||
|
// Read the file into a byte array, and make a String out of it.
|
||||||
|
byte[] bytes = new byte[(int)configFile.length()];
|
||||||
|
fis.read(bytes);
|
||||||
|
String input = new String(bytes);
|
||||||
|
|
||||||
|
// Close the stream.
|
||||||
|
fis.close();
|
||||||
|
|
||||||
|
// Replace all tabs with 4 spaces.
|
||||||
|
String output = "";
|
||||||
|
for (char c : input.toCharArray())
|
||||||
|
{
|
||||||
|
if (c == '\t')
|
||||||
|
output += " ";
|
||||||
|
else
|
||||||
|
output += c;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create an outputstream from the file.
|
||||||
|
FileOutputStream fos = new FileOutputStream(configFile);
|
||||||
|
|
||||||
|
// Write all the bytes to it.
|
||||||
|
for (byte b : output.getBytes())
|
||||||
|
fos.write(b);
|
||||||
|
|
||||||
|
// Close the stream.
|
||||||
|
fos.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
System.out.println("[MobArena] ERROR: Config file could not be created.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* Creates a Configuration object from the config.yml file.
|
* Creates a Configuration object from the config.yml file.
|
||||||
*/
|
*/
|
||||||
@@ -164,18 +218,18 @@ public class MAUtils
|
|||||||
new File("plugins/MobArena").mkdir();
|
new File("plugins/MobArena").mkdir();
|
||||||
File configFile = new File("plugins/MobArena/config.yml");
|
File configFile = new File("plugins/MobArena/config.yml");
|
||||||
|
|
||||||
if(!configFile.exists())
|
try
|
||||||
{
|
{
|
||||||
try
|
if(!configFile.exists())
|
||||||
{
|
{
|
||||||
configFile.createNewFile();
|
configFile.createNewFile();
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
}
|
||||||
{
|
catch(Exception e)
|
||||||
System.out.println("[MobArena] ERROR: Config file could not be created.");
|
{
|
||||||
return null;
|
System.out.println("[MobArena] ERROR: Config file could not be created.");
|
||||||
}
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Configuration(configFile);
|
return new Configuration(configFile);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user