이것때문에 3시간동안 해매는 중입니다
인스턴스를 출력하려고하면 위와같은 오류를 뿜으면서 출력이 정상적으로 되지 않습니다
직렬화 관련 문제라고 하는데..
구글에 검색해서 해결해보려 해도 답이 나오지 않아서
마지막으로 여기에 올려봅니다
오류 내용입니다
소스코드입니다
package kr.dja;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class SaveProvinceBlockData
{
public static Block[][][][][] savedBlock = new Block[9][9][16][255][16];
Chunk chunkTemp;
Chunk chunk;
Player player;
Plugin plugin;
public static int taskID;
public SaveProvinceBlockData(Chunk chunk, Player player, Plugin plugin)
{
this.chunk = chunk;
this.player = player;
this.plugin = plugin;
}
public void run()
{
ChunkSaver ch = new ChunkSaver(player.getLocation().getChunk());
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, ch, 1, 1);
}
}
class ChunkSaver implements Runnable
{
Chunk chunkTemp;
Chunk chunk;
int chunkX = 0;
int chunkZ = 0;
public ChunkSaver(Chunk chunk)
{
this.chunk = chunk;
}
@Override
public void run()
{
if(chunkX < 9)
{
if(chunkZ < 9)
{
chunkTemp = new Location(chunk.getWorld(), (chunk.getX() * 16) + (chunkX * 16), 0, (chunk.getZ() * 16) + (chunkZ * 16)).getChunk();
for(int i = 0; i < 16; i++)
{
for(int j = 0; j < 255; j++)
{
for(int k = 0; k < 16; k++)
{
SaveProvinceBlockData.savedBlock[chunkX][chunkZ][i][j][k] = chunkTemp.getBlock(i, j, k);
}
}
}
chunkZ += 1;
}
else
{
chunkZ = 0;
chunkX += 1;
}
}
else
{
System.out.println("end");
File file = new File(kr.dja.DJACORE.dir + "/province/" + "#0");
file.mkdir();
try {
ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(file + "/Province_Data"));
os.writeObject(SaveProvinceBlockData.savedBlock);
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Bukkit.getScheduler().cancelTask(SaveProvinceBlockData.taskID);
}
}
}