Jump to content

Recommended Posts

Posted

Hey,

 

my mod is ready to publish, in client and LAN works fine so far, but if I want to install it in minecraftserver, I get an crash report.

Class atd is ClientWorld, but im not using it in my ServerTickHandler.

I've looked for hours and couldn't find the reason.

Build #200 MCversion 1.3.2

 

 

crash report:

 

2012-08-18 14:14:49 [iNFO] [ForgeModLoader] Forge Mod Loader version 3.0.71.289 for Minecraft client:1.3.2, server:1.3.2 loading
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] All core mods are successfully located
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Discovering coremods
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Found library file argo-2.25.jar present and correct in lib dir

2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Found library file guava-12.0.1.jar present and correct in lib dir

2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Found library file asm-all-4.0.jar present and correct in lib dir

2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Running coremod plugins
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Running coremod plugin FMLCorePlugin
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Coremod plugin FMLCorePlugin run successfully
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Running coremod plugin FMLForgePlugin
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Coremod plugin FMLForgePlugin run successfully
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Validating minecraft
2012-08-18 14:14:49 [FINEST] [ForgeModLoader] Minecraft validated, launching...
2012-08-18 14:14:50 [iNFO] [sTDOUT] 195 recipes
2012-08-18 14:14:50 [iNFO] [sTDOUT] 27 achievements
2012-08-18 14:14:50 [iNFO] [sTDERR] java.io.IOException: Das Handle ist ungültig
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.FileInputStream.readBytes(Native Method)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.FileInputStream.read(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.BufferedInputStream.read1(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.BufferedInputStream.read(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.nio.cs.StreamDecoder.read(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.InputStreamReader.read(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.BufferedReader.fill(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.BufferedReader.readLine(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.io.BufferedReader.readLine(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at fv.run(SourceFile:60)
2012-08-18 14:14:50 [iNFO] [ForgeModLoader] Attempting early MinecraftForge initialization
2012-08-18 14:14:50 [iNFO] [ForgeModLoader] Completed early MinecraftForge initialization
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Building injected Mod Containers [cpw.mods.fml.common.FMLDummyContainer, net.minecraftforge.common.ForgeDummyContainer]
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Attempting to load mods contained in the minecraft jar file and associated classes
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Found a minecraft related file at C:\Users\pitman\Desktop\server\minecraft_server(1).jar, examining for mod candidates
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Skipping known library file C:\Users\pitman\Desktop\server\lib\argo-2.25.jar
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Skipping known library file C:\Users\pitman\Desktop\server\lib\guava-12.0.1.jar
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Skipping known library file C:\Users\pitman\Desktop\server\lib\asm-all-4.0.jar
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Minecraft jar mods loaded successfully
2012-08-18 14:14:50 [iNFO] [ForgeModLoader] Searching C:\Users\pitman\Desktop\server\mods for mods
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Found a candidate zip or jar file TF2.zip
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Examining file minecraft_server(1).jar for potential mods
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Examining file TF2.zip for potential mods
2012-08-18 14:14:50 [FINER] [ForgeModLoader] Located mcmod.info file in file TF2.zip
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Identified a FMLMod type mod TF2.Teleporter.common.TF2TeleporterMod
2012-08-18 14:14:50 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 3 mods to load
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Received a system property request ''
2012-08-18 14:14:50 [FINE] [ForgeModLoader] System property request managing the state of 0 mods
2012-08-18 14:14:50 [FINE] [ForgeModLoader] After merging, found state information for 0 mods
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Verifying mod requirements are satisfied
2012-08-18 14:14:50 [FINE] [ForgeModLoader] All mod requirements are satisfied
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Sorting mods into an ordered list
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Mod sorting completed successfully
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Mod sorting data:
2012-08-18 14:14:50 [FINE] [ForgeModLoader] 	pitman-87_TF2_Teleporter(TF2_Teleporter): TF2.zip ()
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Activating mod FML
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Activating mod Forge
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Enabling mod pitman-87_TF2_Teleporter
2012-08-18 14:14:50 [FINE] [ForgeModLoader] Activating mod pitman-87_TF2_Teleporter
2012-08-18 14:14:50 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLConstructionEvent@140984b to mod FML
2012-08-18 14:14:50 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLConstructionEvent@140984b delivered to mod FML
2012-08-18 14:14:50 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLConstructionEvent@140984b to mod Forge
2012-08-18 14:14:50 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLConstructionEvent@140984b delivered to mod Forge
2012-08-18 14:14:50 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLConstructionEvent@140984b to mod pitman-87_TF2_Teleporter
2012-08-18 14:14:50 [iNFO] [sTDERR] 2012-08-18 14:14:50 [iNFO] Starting minecraft server version 1.3.2
2012-08-18 14:14:50 [WARNING] To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
java.lang.NoClassDefFoundError: atd
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.Class.getDeclaredConstructors0(Native Method)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.Class.getConstructor0(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.Class.newInstance0(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.Class.newInstance(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.NetworkModHandler.tryCreatingPacketHandler(NetworkModHandler.java:143)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.NetworkModHandler.<init>(NetworkModHandler.java:103)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.FMLNetworkHandler.registerNetworkMod(FMLNetworkHandler.java:217)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:283)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:127)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:85)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.loadMods(Loader.java:420)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:108)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:351)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at ft.b(DedicatedServer.java:49)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:415)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at ep.run(SourceFile:539)
2012-08-18 14:14:50 [iNFO] [sTDERR] Caused by: java.lang.ClassNotFoundException: atd
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:99)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.ClassLoader.loadClass(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at java.lang.ClassLoader.loadClass(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	... 35 more
2012-08-18 14:14:50 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at org.objectweb.asm.ClassReader.<init>(Unknown Source)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:28)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:141)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:92)
2012-08-18 14:14:50 [iNFO] [sTDERR] 	... 37 more
2012-08-18 14:14:50 [iNFO] [sTDERR] 2012-08-18 14:14:50 [sEVERE] Encountered an unexpected exception NoClassDefFoundError
java.lang.NoClassDefFoundError: atd
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at cpw.mods.fml.common.network.NetworkModHandler.tryCreatingPacketHandler(NetworkModHandler.java:143)
at cpw.mods.fml.common.network.NetworkModHandler.<init>(NetworkModHandler.java:103)
at cpw.mods.fml.common.network.FMLNetworkHandler.registerNetworkMod(FMLNetworkHandler.java:217)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:283)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:85)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:420)
at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:108)
at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:351)
at ft.b(DedicatedServer.java:49)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:415)
at ep.run(SourceFile:539)
Caused by: java.lang.ClassNotFoundException: atd
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:99)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 35 more
Caused by: java.lang.NullPointerException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:28)
at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:141)
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:92)
... 37 more
2012-08-18 14:15:11 [iNFO] [sTDERR] 2012-08-18 14:14:50 [sEVERE] This crash report has been saved to: C:\Users\pitman\Desktop\server\.\crash-reports\crash-2012-08-18_14.14.50-server.txt
2012-08-18 14:15:11 [iNFO] Stopping server
2012-08-18 14:15:11 [iNFO] Saving worlds
java.lang.NullPointerException
2012-08-18 14:15:11 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:323)
2012-08-18 14:15:11 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.j(MinecraftServer.java:371)
2012-08-18 14:15:11 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:498)
2012-08-18 14:15:11 [iNFO] [sTDERR] 	at ep.run(SourceFile:539)
2012-08-18 14:15:11 [iNFO] [sTDERR] 2012-08-18 14:15:11 [iNFO] Stopping server
Exception in thread "Thread-5" java.lang.NullPointerException
2012-08-18 14:15:11 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:323)
2012-08-18 14:15:11 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.j(MinecraftServer.java:371)
2012-08-18 14:15:11 [iNFO] [sTDERR] 	at eo.run(SourceFile:527)

 

 

ServerTickHandler:

 

package TF2.Teleporter.common;

import java.util.EnumSet;


import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class ServerTickHandler implements ITickHandler
{
    private final EnumSet<TickType> ticksToGet;
    

    public ServerTickHandler(EnumSet<TickType> ticksToGet)
    {
        this.ticksToGet = ticksToGet;
    }


    @Override
    public void tickStart(EnumSet<TickType> type, Object... tickData)
    {
    	if (TF2TeleporterDBServer.needsUpdate)
	{
    		TF2TeleporterDBServer.writeChunkCoords();
	}
    }

    @Override
    public void tickEnd(EnumSet<TickType> type, Object... tickData)
    {
    }

    @Override
    public EnumSet<TickType> ticks()
    {
        return ticksToGet;
    }

    @Override
    public String getLabel()
    {
        return "TF2TeleporterServerTick";
    }
}

 

 

TF2TeleporterDBServer:

 

 

package TF2.Teleporter.common;

import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import cpw.mods.fml.common.FMLCommonHandler;

import net.minecraft.server.MinecraftServer;
import net.minecraft.src.ChunkProviderServer;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.WorldServer;

public class TF2TeleporterDBServer
{
public static Map<WorldServer, Map<Integer, TF2TeleporterFrequency>> frequencies;
public static boolean needsUpdate;

public static void init()
{
	frequencies = new HashMap<WorldServer, Map<Integer, TF2TeleporterFrequency>>();
	readChunkCoords();
}

public static TF2TeleporterFrequency getOrCreateFrequency(WorldServer w, int f)
{
	Map<Integer, TF2TeleporterFrequency> m = null;
	if (frequencies == null)
	{
		init();
	}
	if (!frequencies.containsKey(w))
	{
		frequencies.put(w, new HashMap<Integer, TF2TeleporterFrequency>());
	}
	m = frequencies.get(w);

	if (!m.containsKey(f))
	{
		m.put(f, new TF2TeleporterFrequency(f));
	}
	return m.get(f);
}

public static int[] getLocations(int dim)
{
	int[] temp = new int[200];
	int size = 0;

	if (frequencies == null || frequencies.isEmpty())
	{
		return null;
	}
	Map<Integer, TF2TeleporterFrequency> map = frequencies.get(MinecraftServer.getServer().worldServerForDimension(dim));
	if (map == null || map.isEmpty())
	{
		return null;
	}
	for (Entry<Integer, TF2TeleporterFrequency> entry : map.entrySet())
	{
		TF2TeleporterFrequency tf = entry.getValue();
		if (tf != null)
		{
			if (tf.getTp1() != null)
			{
				temp[size] = entry.getKey();
				temp[size + 1] = tf.getTp1().xCoord;
				temp[size + 2] = tf.getTp1().yCoord;
				temp[size + 3] = tf.getTp1().zCoord;
				size += 4;
			}
			if (tf.getTp2() != null)
			{
				temp[size] = entry.getKey();
				temp[size + 1] = tf.getTp2().xCoord;
				temp[size + 2] = tf.getTp2().yCoord;
				temp[size + 3] = tf.getTp2().zCoord;
				size += 4;
			}
		}

	}

	int[] finalArray = new int[size];
	for (int i = 0; i < size; i++)
	{
		finalArray[i] = temp[i];
	}

	return finalArray;
}

public static void writeChunkCoords()
{
	try
	{

		File file = new File(getPath());
		FileOutputStream fos = new FileOutputStream(file);
		DataOutputStream dos = new DataOutputStream(fos);

		if (!file.exists())
		{
			file.createNewFile();
		}
		if (file.canWrite())
		{
			for (Entry<WorldServer, Map<Integer, TF2TeleporterFrequency>> entry : frequencies.entrySet())
			{
				Map<Integer, TF2TeleporterFrequency> map = entry.getValue();
				if (map == null || map.isEmpty())
				{
					continue;
				}
				for (Entry<Integer, TF2TeleporterFrequency> entry2 : map.entrySet())
				{
					TF2TeleporterFrequency tf = entry2.getValue();

					if (tf != null)
					{
						if (tf.getTp1() != null)
						{
							dos.writeInt(tf.getTp1().xCoord >> 4);
							dos.writeInt(tf.getTp1().zCoord >> 4);
						}
						if (tf.getTp2() != null)
						{
							dos.writeInt(tf.getTp2().xCoord >> 4);
							dos.writeInt(tf.getTp2().zCoord >> 4);
						}
					}
				}
			}

			fos.close();
			dos.close();
		}
	} catch (Exception e)
	{
	}

	needsUpdate = false;

}

public static void readChunkCoords()
{
	try
	{

		File file = new File(getPath());
		FileInputStream fis = new FileInputStream(file);
		DataInputStream dis = new DataInputStream(fis);

		int x;
		int z;

		WorldServer[] worlds = MinecraftServer.getServer().theWorldServer;
		for (int i = 0; i < worlds.length; i++)
		{
			IChunkProvider cp = worlds[i].getChunkProvider();
			((ChunkProviderServer) cp).loadChunkOnProvideRequest = true;

		}

		try
		{
			while (true)
			{
				x = dis.readInt();
				z = dis.readInt();

				for (int i = 0; i < worlds.length; i++)
				{
					if (worlds[i] != null && worlds[i].getChunkFromChunkCoords(x, z) != null && !worlds[i].getChunkFromChunkCoords(x, z).isChunkLoaded)
					{
						worlds[i].getChunkFromChunkCoords(x, z).onChunkLoad();

					}
				}
			}

		} catch (EOFException e)
		{

		}

		for (int i = 0; i < worlds.length; i++)
		{
			IChunkProvider cp = worlds[i].getChunkProvider();
			if (cp instanceof ChunkProviderServer)
			{
				((ChunkProviderServer) cp).loadChunkOnProvideRequest = false;
			}
		}
		fis.close();
		dis.close();

	} catch (Exception e)
	{
		//			e.printStackTrace();
	}

}

private static String getPath()
{

	MinecraftServer ms = FMLCommonHandler.instance().getMinecraftServerInstance();
	String s = (new StringBuilder()).append(ms.getFile(ms.getFolderName())).append("/teleporterLocations").append(".dat").toString();

	if (ms.isSinglePlayer())
	{
		s = (new StringBuilder()).append(ms.getFile("/saves")).append("/").append(ms.getFolderName()).append("/teleporterLocations").append(".dat").toString();
	}
			System.out.println(s);
	return s;
}

public static void convertSaveFile()
{
	String path = getPath().replaceFirst(".dat", "0.dat");
//		System.out.println(path);
	readOld(path);
	path = getPath().replaceFirst(".dat", "-1.dat");
	readOld(path);
}

public static void readOld(String path)
{
	try
	{
		File file = new File(path);
		FileInputStream fis = new FileInputStream(file);
		DataInputStream dis = new DataInputStream(fis);

		int x;
		int z;

		WorldServer[] worlds = MinecraftServer.getServer().theWorldServer;
		for (int i = 0; i < worlds.length; i++)
		{
			IChunkProvider cp = worlds[i].getChunkProvider();
			((ChunkProviderServer) cp).loadChunkOnProvideRequest = true;

		}

		try
		{
			while (true)
			{
				x = dis.readInt();
				z = dis.readInt();

				for (int i = 0; i < worlds.length; i++)
				{
					if (worlds[i] != null && worlds[i].getChunkFromChunkCoords(x, z) != null && !worlds[i].getChunkFromChunkCoords(x, z).isChunkLoaded)
					{
						worlds[i].getChunkFromChunkCoords(x, z).onChunkLoad();

					}
				}
			}

		} catch (EOFException e)
		{

		}

		for (int i = 0; i < worlds.length; i++)
		{
			IChunkProvider cp = worlds[i].getChunkProvider();
			if (cp instanceof ChunkProviderServer)
			{
				((ChunkProviderServer) cp).loadChunkOnProvideRequest = false;
			}
		}
		fis.close();
		dis.close();
		file.delete();

	} catch (Exception e)
	{
		//			e.printStackTrace();
	}

}

}

 

 

My Mod-file:

 

package TF2.Teleporter.common;

import java.util.EnumSet;

import TF2.Teleporter.client.ClientTickHandler;
import TF2.Teleporter.client.ClientPacketHandler;

import net.minecraft.src.Block;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.MLProp;
import net.minecraftforge.common.MinecraftForge;


import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.Mod.ServerStarted;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.TickRegistry;


/**
* @author pitman-87
* 
*/

@Mod(modid = "pitman-87_TF2_Teleporter", name = "TF2 Teleporter", version = "1.3.2")
@NetworkMod(clientSideRequired = true, serverSideRequired = true, 
clientPacketHandlerSpec = @SidedPacketHandler(channels = { "TF2_Teleporter_C" }, 
packetHandler = ClientPacketHandler.class), 
serverPacketHandlerSpec = @SidedPacketHandler(channels = { "TF2_Teleporter_S" }, 
packetHandler = ServerPacketHandler.class))

public class TF2TeleporterMod
{

@SidedProxy(clientSide = "TF2.Teleporter.client.ClientProxy", serverSide = "TF2.Teleporter.common.CommonProxy")
public static CommonProxy proxy;

@MLProp
public static int blockIDblue = 233;
@MLProp
public static int blockIDred = 234;
@MLProp
public static int itemIDBlue = 2813;
@MLProp
public static int itemIDRed = 2816;
@MLProp
public static int itemIDBase = 2814;
@MLProp
public static int itemIDPropeller = 2815;
@MLProp(info = "the volume of teleporting sound", max = 1.0, min = 0.0, name = "teleportVolume")
public static float teleportVolume = 0.2F;
@MLProp(info = "the volume of spining sound of the teleporter", max = 1.0, min = 0.0, name = "spinVolume")
public static float spinVolume = 0.05F;

public static Block teleporterBlockBlue;
public static Block teleporterBlockRed;

public static Item teleporterItemBlue;
public static Item teleporterItemRed;
public static Item teleporterBase;
public static Item teleporterPropeller;

public static boolean teamsEnabled = false;
public static String itemsPath = "/TF2/Teleporter/sprites/TF2Items.png";

@PreInit
public void preInit(FMLPreInitializationEvent event)
{
	proxy.registerTextures();
}

@Init
public void load(FMLInitializationEvent evt)
{

	TickRegistry.registerTickHandler(new ClientTickHandler(EnumSet.of(TickType.CLIENT)), Side.CLIENT);
	TickRegistry.registerTickHandler(new ServerTickHandler(EnumSet.of(TickType.SERVER)), Side.SERVER);

	teleporterBlockBlue = new BlockTF2TeleporterBlue(blockIDblue).setHardness(0.5F).setResistance(2000F).setStepSound(Block.soundWoodFootstep).setBlockName("TF2 Teleporter");
	teleporterBlockRed = new BlockTF2TeleporterRed(blockIDred).setHardness(0.5F).setResistance(2000F).setStepSound(Block.soundWoodFootstep).setBlockName("TF2 Teleporter");

	teleporterItemBlue = new ItemTF2Teleporter(itemIDBlue).setItemName("TF2 Teleporter");
	teleporterItemRed = new ItemTF2Teleporter(itemIDRed).setItemName("TF2 Teleporter");
	teleporterBase = new ItemTF2TeleporterPiece(itemIDBase).setItemName("Teleporter Base");
	teleporterPropeller = new ItemTF2TeleporterPiece(itemIDPropeller).setItemName("Teleporter Propeller");


	GameRegistry.registerBlock(teleporterBlockBlue);
	GameRegistry.registerBlock(teleporterBlockRed);
	GameRegistry.registerTileEntity(TileEntityTF2Teleporter.class, "TF2 Teleporter");

	proxy.registerRenderThings();

	GameRegistry.addRecipe(new ItemStack(teleporterBase, 1), new Object[]
	{ "X X", "XXX", "X X", Character.valueOf('X'), Item.ingotIron });
	GameRegistry.addRecipe(new ItemStack(teleporterPropeller, 1), new Object[]
	{ "#Y#", "YYY", "XXX", Character.valueOf('X'), Item.ingotIron, Character.valueOf('Y'), Item.redstone, Character.valueOf('#'), Block.torchRedstoneActive });
	GameRegistry.addRecipe(new ItemStack(teleporterItemBlue, 1), new Object[]
	{ "#", "X", "Y", Character.valueOf('X'), teleporterPropeller, Character.valueOf('Y'), teleporterBase, Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4) });
	GameRegistry.addRecipe(new ItemStack(teleporterItemRed, 1), new Object[]
	{ "#", "X", "Y", Character.valueOf('X'), teleporterPropeller, Character.valueOf('Y'), teleporterBase, Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 1) });
	GameRegistry.addRecipe(new ItemStack(teleporterItemRed, 1), new Object[]
	{ "X", "Y", Character.valueOf('Y'), teleporterItemBlue, Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 1) });
	GameRegistry.addRecipe(new ItemStack(teleporterItemBlue, 1), new Object[]
	{ "X", "Y", Character.valueOf('Y'), teleporterItemRed, Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 4) });

}

@PostInit
public void modsLoaded(FMLPostInitializationEvent evt)
{

}

@ServerStarted
public void serverStarted(FMLServerStartedEvent event)
{
	TF2TeleporterDBServer.convertSaveFile();
	TF2TeleporterDBServer.needsUpdate = true;
}
}

 

Posted

Sorry for doublepost, but I have removed every clientside connected classes, but still get the error.

 

I assume it have something todo with

 

@NetworkMod(clientSideRequired = true, serverSideRequired = true, 
clientPacketHandlerSpec = @SidedPacketHandler(channels = {"TF2_Teleporter_C"}, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec = @SidedPacketHandler(channels = {"TF2_Teleporter_S"}, packetHandler = ServerPacketHandler.class))

 

because "ClientPacketHandler" is the last class I'm using in a common package, but I'm not sure about it.

 

 

Nevermind, notice to myself: Do not put ClientPackageHandler into client-package...

Posted

Can you elaborate on what you did to fix it. I am doing the same thing as you but I don't understand the mistake you made and corrected, but I am still making.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.