mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-22 18:46:45 +01:00
v0.87.3 - Fixed players being able to leave and keep their items.
This commit is contained in:
parent
bd0b311a60
commit
7ff9e1b251
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: MobArena
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.87.2
|
||||
version: 0.87.3
|
||||
commands:
|
||||
mobarena:
|
||||
description: Base command for MobArena
|
||||
|
@ -221,11 +221,11 @@ public class ArenaManager
|
||||
return;
|
||||
}
|
||||
|
||||
if (ArenaManager.isRunning)
|
||||
MAUtils.clearInventory(p);
|
||||
|
||||
if (playerSet.contains(p))
|
||||
{
|
||||
playerSet.remove(p);
|
||||
MAUtils.clearInventory(p);
|
||||
}
|
||||
|
||||
if (readySet.contains(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.
|
||||
*/
|
||||
@ -164,18 +218,18 @@ public class MAUtils
|
||||
new File("plugins/MobArena").mkdir();
|
||||
File configFile = new File("plugins/MobArena/config.yml");
|
||||
|
||||
if(!configFile.exists())
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!configFile.exists())
|
||||
{
|
||||
configFile.createNewFile();
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
System.out.println("[MobArena] ERROR: Config file could not be created.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return new Configuration(configFile);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user