Jump to content

SirEntropy

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

SirEntropy's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm well aware of how inheritance works. What you say it's true when you have only one thread running with that instance or two+ threads sharing the same memory. If you run two threads, one for the client and one of the server, as it happens in MC 1.3.2, and you are not sharing memory, you may have more than one instance, which means that I would have expected that the line "Crated Common Registy Server" should have been printed twice. Perhaps I should reformulate my question: When running MC 1.3.2 in standalone mode (client and embedded server), do both threads (client and server) share the same memory space or do they have different spaces for their variables? If the latter is true the instance of MCModsCommon in the server thread should have the attribute 'registry' of type CommonRegistry, while the instance in the client thread should have the attribute 'registry' of type CommonRegistryClient. Since you say that there is only one instance of the class, the answer might be the former. If so, wouldn't be useful to change MC Forge to create two different instances of the mod class, one for client and one for server, (e.g., using the ThreadLocal class)? That way would make coding for standalone MC be more consistent with coding for MC server and bukkit, since there will be an effective separation between the client and server code.
  2. Hi. I was trying to create a mod proxy to manage client and server-side data. However, it is not behaving the way I expect. This is the mod class: @Mod(modid = "mcmods.common", name = "MCMods Common", version = "0.0.1") @NetworkMod( clientSideRequired = true, serverSideRequired = false, packetHandler = MCModsPacketHandler.class, channels = { "SubWorld" } ) public class MCModsCommon { @Instance public static MCModsCommon instance; @SidedProxy( clientSide = "mcmods.common.registry.CommonRegistryClient", serverSide = "mcmods.common.registry.CommonRegistry") public static CommonRegistry registry; @Init public void load(FMLInitializationEvent evt) { System.out.println(registry); registry.init(this); } } This is the server-side proxy class public class CommonRegistry extends Registry { public CommonRegistry() { System.out.println("Crated Common Registy Server"); } ... } and the client-side proxy class public class CommonRegistryClient extends CommonRegistry { public CommonRegistryClient() { System.out.println("Crated Common Registy Client"); } ... } The problem is that, although both classes are instantiated, only the client-side instance gets assigned to the MCModsCommon.registry attribute. ... 2012-09-15 21:06:48 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 5 mods to load 2012-09-15 21:06:48 [iNFO] [sTDOUT] Crated Common Registy Server 2012-09-15 21:06:48 [iNFO] [sTDOUT] Crated Common Registy Client 2012-09-15 21:06:48 [iNFO] [sTDOUT] Starting up SoundSystem... 2012-09-15 21:06:49 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2012-09-15 21:06:49 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2012-09-15 21:06:49 [iNFO] [sTDOUT] OpenAL initialized. 2012-09-15 21:06:49 [iNFO] [sTDOUT] mcmods.common.registry.CommonRegistryClient@7f32e910 ... As far as I know, there should be two separate instances of MCModsCommon (one for the client thread and one for the server thread), so when the load method is called, it should print both CommonRegistry and CommonRegistryClient. Currently it only prints CommonRegistryClient (see the last line of the last output). Is it right my assumption that MCModsCommon should have two different instances? If so, what am I doing wrong?
  3. I'm trying to register two new boat entities (Dinghy and Skiff, both subclasses of EntityBoat) in my mod using this code: registerEntity(Dinghy.class, "EntityDinghy", 80, 3, true); registerEntity(Skiff.class, "EntitySkiff", 80, 3, true); where protected void registerEntity(Class<? extends Entity> entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { int id = ModLoader.getUniqueEntityId(); System.out.println("Registered: " + entityClass + " id: " + id); EntityRegistry.registerModEntity(entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates); EntityRegistry.registerGlobalEntityID(entityClass, entityName, id); } However, I get the following output: 2012-08-25 10:07:47 [iNFO] [sTDOUT] Registered: class mcmods.shipsAndBoats.boats.Dinghy id: 0 2012-08-25 10:07:47 [WARNING] [ForgeModLoader] The mod mcmods.shipsAndBoats tried to register the entity class class mcmods.shipsAndBoats.boats.Dinghy which was already registered - if you wish to override default naming for FML mod entities, register it here first 2012-08-25 10:07:47 [iNFO] [sTDOUT] Registered: class mcmods.shipsAndBoats.boats.Skiff id: 0 2012-08-25 10:07:47 [WARNING] [ForgeModLoader] The mod mcmods.shipsAndBoats tried to register the entity class class mcmods.shipsAndBoats.boats.Skiff which was already registered - if you wish to override default naming for FML mod entities, register it here first For some weird reason, the method ModLoader.getUniqueEntityId() / EntityRegistry.findGlobalUniqueEntityId() is always returning 0. Is this a bug or am I doing something wrong? Note that the above code was working OK in Forge 4.0.0.204. EDIT: Here is the full log output: 2012-08-25 10:15:13 [iNFO] [ForgeModLoader] Forge Mod Loader version 3.0.148.332 for Minecraft client:1.3.2, server:1.3.2 loading 2012-08-25 10:15:13 [FINEST] [ForgeModLoader] All core mods are successfully located 2012-08-25 10:15:13 [FINEST] [ForgeModLoader] Discovering coremods 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Found library file argo-2.25.jar present and correct in lib dir 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Found library file guava-12.0.1.jar present and correct in lib dir 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Found library file asm-all-4.0.jar present and correct in lib dir 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Running coremod plugins 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Running coremod plugin FMLCorePlugin 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Coremod plugin FMLCorePlugin run successfully 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Running coremod plugin FMLForgePlugin 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Coremod plugin FMLForgePlugin run successfully 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Validating minecraft 2012-08-25 10:15:14 [FINEST] [ForgeModLoader] Minecraft validated, launching... 2012-08-25 10:15:16 [iNFO] [sTDOUT] 27 achievements 2012-08-25 10:15:16 [iNFO] [sTDOUT] 195 recipes 2012-08-25 10:15:16 [iNFO] [sTDOUT] Setting user: Player209, - 2012-08-25 10:15:16 [iNFO] [sTDERR] Client asked for parameter: server 2012-08-25 10:15:16 [iNFO] [sTDOUT] LWJGL Version: 2.4.2 2012-08-25 10:15:17 [iNFO] [ForgeModLoader] Attempting early MinecraftForge initialization 2012-08-25 10:15:17 [iNFO] [ForgeModLoader] Completed early MinecraftForge initialization 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Building injected Mod Containers [cpw.mods.fml.common.FMLDummyContainer, net.minecraftforge.common.ForgeDummyContainer] 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Attempting to load mods contained in the minecraft jar file and associated classes 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related directory at /Users/jaimepavlich-mariscal/workspace-MC/minecraft-mods/mcmods.base.forge/target/classes, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related directory at /Users/jaimepavlich-mariscal/workspace-MC/minecraft-mods/mcmods.common/target/classes, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related directory at /Users/jaimepavlich-mariscal/workspace-MC/minecraft-mods/mcmods.common/target/test-classes, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related directory at /Users/jaimepavlich-mariscal/workspace-MC/minecraft-mods/mcmods.shipsAndBoats/target/classes, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/bin/lwjgl.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/bin/lwjgl_util.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/bin/jinput.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related file at /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/bin/minecraft.jar, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related file at /Users/jaimepavlich-mariscal/.m2/repository/org/codehaus/groovy/groovy-all/1.7.0/groovy-all-1.7.0.jar, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related file at /Users/jaimepavlich-mariscal/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/lib/argo-2.25.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/lib/asm-all-4.0.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/lib/guava-12.0.1.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related file at /Users/jaimepavlich-mariscal/.m2/repository/com/jme3/jbullet/3.0.0.20120209-SNAPSHOT/jbullet-3.0.0.20120209-SNAPSHOT.jar, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related file at /Users/jaimepavlich-mariscal/.m2/repository/com/jme3/stack-alloc/3.0.0.20120209-SNAPSHOT/stack-alloc-3.0.0.20120209-SNAPSHOT.jar, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Found a minecraft related file at /Users/jaimepavlich-mariscal/.m2/repository/com/jme3/vecmath/3.0.0.20120209-SNAPSHOT/vecmath-3.0.0.20120209-SNAPSHOT.jar, examining for mod candidates 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/lib/argo-2.25.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/lib/guava-12.0.1.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Skipping known library file /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/lib/asm-all-4.0.jar 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Minecraft jar mods loaded successfully 2012-08-25 10:15:17 [iNFO] [ForgeModLoader] Searching /Users/jaimepavlich-mariscal/workspace-MC/mcp72/jars/mods for mods 2012-08-25 10:15:17 [FINE] [ForgeModLoader] Examining directory classes for potential mods 2012-08-25 10:15:17 [iNFO] [ForgeModLoader] No mcmod.info file found in directory classes 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.client 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.client.modloader 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.client.registry 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.asm 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.asm.transformers 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.discovery 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.discovery.asm 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.event 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.functions 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.modloader 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.network 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.registry 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.toposort 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.common.versioning 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.relauncher 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package cpw.mods.fml.server 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package ibxm 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraft 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraft.client 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraft.server 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraft.src 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.classloading 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.client 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.client.event 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.client.event.sound 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.common 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.event 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.event.entity 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.event.entity.living 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.event.entity.minecart 2012-08-25 10:15:17 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.event.entity.player 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.event.world 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.oredict 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package net.minecraftforge.transformers 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.asn1 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.asn1.bc 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.asn1.pkcs 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.crypto 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.crypto.engines 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.crypto.io 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.crypto.modes 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.crypto.params 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.jcajce 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.jcajce.provider 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.jcajce.provider.config 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.jcajce.provider.util 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.jce 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.jce.provider 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package org.bouncycastle.util 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package paulscode 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package paulscode.sound 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package paulscode.sound.codecs 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining directory classes for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] No mcmod.info file found in directory classes 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.blocks 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.common 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Identified a FMLMod type mod mcmods.common.MCModsCommon 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Parsed dependency info : [] [] [] 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.managers 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.registry 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.util 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package net 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package net.minecraft 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package net.minecraft.src 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining directory test-classes for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] No mcmod.info file found in directory test-classes 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining directory classes for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] No mcmod.info file found in directory classes 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.shipsAndBoats 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Identified a FMLMod type mod mcmods.shipsAndBoats.ShipsAndBoats 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Parsed dependency info : [] [] [] 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.shipsAndBoats.boats 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.shipsAndBoats.network 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.shipsAndBoats.registry 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.shipsAndBoats.resources 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.shipsAndBoats.resources.gui 2012-08-25 10:15:18 [FINEST] [ForgeModLoader] Recursing into package mcmods.shipsAndBoats.resources.models 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining file minecraft.jar for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] The mod container minecraft.jar appears to be missing an mcmod.info file 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining file groovy-all-1.7.0.jar for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] The mod container groovy-all-1.7.0.jar appears to be missing an mcmod.info file 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining file jline-0.9.94.jar for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] The mod container jline-0.9.94.jar appears to be missing an mcmod.info file 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining file jbullet-3.0.0.20120209-SNAPSHOT.jar for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] The mod container jbullet-3.0.0.20120209-SNAPSHOT.jar appears to be missing an mcmod.info file 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining file stack-alloc-3.0.0.20120209-SNAPSHOT.jar for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] The mod container stack-alloc-3.0.0.20120209-SNAPSHOT.jar appears to be missing an mcmod.info file 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Examining file vecmath-3.0.0.20120209-SNAPSHOT.jar for potential mods 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] The mod container vecmath-3.0.0.20120209-SNAPSHOT.jar appears to be missing an mcmod.info file 2012-08-25 10:15:18 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Received a system property request '' 2012-08-25 10:15:18 [FINE] [ForgeModLoader] System property request managing the state of 0 mods 2012-08-25 10:15:18 [FINE] [ForgeModLoader] After merging, found state information for 0 mods 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Activating mod FML 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Activating mod Forge 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Enabling mod mcmods.common 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Activating mod mcmods.common 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Enabling mod mcmods.shipsAndBoats 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Activating mod mcmods.shipsAndBoats 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Verifying mod requirements are satisfied 2012-08-25 10:15:18 [FINE] [ForgeModLoader] All mod requirements are satisfied 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Sorting mods into an ordered list 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Mod sorting completed successfully 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Mod sorting data: 2012-08-25 10:15:18 [FINE] [ForgeModLoader] mcmods.common(MCMods Common:0.0.1): classes () 2012-08-25 10:15:18 [FINE] [ForgeModLoader] mcmods.shipsAndBoats(Ships & Boats:0.11): classes () 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 to mod FML 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 delivered to mod FML 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 to mod Forge 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 delivered to mod Forge 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 to mod mcmods.common 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Attempting to inject @SidedProxy classes into mcmods.common 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 delivered to mod mcmods.common 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 to mod mcmods.shipsAndBoats 2012-08-25 10:15:18 [FINE] [ForgeModLoader] Attempting to inject @SidedProxy classes into mcmods.shipsAndBoats 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLConstructionEvent@39cd04f1 delivered to mod mcmods.shipsAndBoats 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 to mod FML 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 delivered to mod FML 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 to mod Forge 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 delivered to mod Forge 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 to mod mcmods.common 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 delivered to mod mcmods.common 2012-08-25 10:15:18 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 to mod mcmods.shipsAndBoats 2012-08-25 10:15:18 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLPreInitializationEvent@1a06f956 delivered to mod mcmods.shipsAndBoats 2012-08-25 10:15:19 [iNFO] [sTDOUT] Starting up SoundSystem... 2012-08-25 10:15:19 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2012-08-25 10:15:19 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2012-08-25 10:15:19 [iNFO] [sTDOUT] OpenAL initialized. 2012-08-25 10:15:20 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLInitializationEvent@40442b95 to mod FML 2012-08-25 10:15:20 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLInitializationEvent@40442b95 delivered to mod FML 2012-08-25 10:15:20 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLInitializationEvent@40442b95 to mod Forge 2012-08-25 10:15:20 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLInitializationEvent@40442b95 delivered to mod Forge 2012-08-25 10:15:20 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLInitializationEvent@40442b95 to mod mcmods.common 2012-08-25 10:15:20 [FINER] [ForgeModLoader] State event cpw.mods.fml.common.event.FMLInitializationEvent@40442b95 delivered to mod mcmods.common 2012-08-25 10:15:20 [FINER] [ForgeModLoader] Posting state event cpw.mods.fml.common.event.FMLInitializationEvent@40442b95 to mod mcmods.shipsAndBoats 2012-08-25 10:15:20 [iNFO] [sTDOUT] Registered: class mcmods.shipsAndBoats.boats.Dinghy id: 0 2012-08-25 10:15:31 [FINEST] [ForgeModLoader] Automatically registered mod mcmods.shipsAndBoats entity EntityDinghy as mcmods.shipsAndBoats.EntityDinghy 2012-08-25 10:15:41 [WARNING] [ForgeModLoader] The mod mcmods.shipsAndBoats tried to register the entity class class mcmods.shipsAndBoats.boats.Dinghy which was already registered - if you wish to override default naming for FML mod entities, register it here first 2012-08-25 10:15:43 [iNFO] [sTDOUT] Registered: class mcmods.shipsAndBoats.boats.Skiff id: 0 2012-08-25 10:16:09 [FINEST] [ForgeModLoader] Automatically registered mod mcmods.shipsAndBoats entity EntitySkiff as mcmods.shipsAndBoats.EntitySkiff 2012-08-25 10:16:16 [WARNING] [ForgeModLoader] The mod mcmods.shipsAndBoats tried to register the entity class class mcmods.shipsAndBoats.boats.Skiff which was already registered - if you wish to override default naming for FML mod entities, register it here first
  4. Update: I found the problem. Actually, there were two: - The entity with position 0,0,0 is at the client-side. My mistake - The problem is with EntityBoat.setPositionAndRotation2. The last parameter of this method (par9) is used by the EntityBoat class to smoothly move the client-side boat from its current position to the latest position reported by the server. The problem is the number of steps in that movement, stored in the attribute boatPosRotationIncrements, is calculated in a very weird way. See this snippet of EntityBoat.setPositionAndRotation2: if (this.field_70279_a) { this.boatPosRotationIncrements = par9 + 5; } else { ... this.boatPosRotationIncrements = 3; } The solution is to completely rewrite EntityBoat.onUpdate and EntityBoat.setPositionAndRotation2 in my subclass.
  5. I tried it and it doesn't work. My problem is entities spawning at 0,0,0 at the server side. Any other ideas on how to fix this problem?
  6. I'm writing a mod to add a new type of boat: the Dinghy and an ItemDinghy that spawns the dinghy in a similar way as a vanilla boat. However, when I spawn a dinghy in the world, strange things happens: Instead of the dinghy appearing right in front of the player, the dinghy appears at position 0,0,0, then quickly moves to the correct position. I printed the position of both the client-side and server-side dinghy entities. The client-side dinghy has the correct position from the beginning (right in front of the player). The server-side dinghy starts with position 0,0,0, then quickly moves to the correct position. This problem does not happen with the vanilla boat when the mod is installed. The code that registers the dinghy entity is: protected void registerEntity(Class<? extends Entity> entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { int id = ModLoader.getUniqueEntityId(); EntityRegistry.registerModEntity(entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates); EntityRegistry.registerGlobalEntityID(entityClass, entityName, id); } ... registerEntity(Dinghy.class, "EntityDinghy", 80, 3, false); The code of Dinghy entity public class Dinghy extends EntityAnyBoat { public Dinghy(World world, double x, double y, double z) { super(world, x, y, z, 1.5f, 0.5f); } public Dinghy(World world) { super(world); } @Override protected double getSpeedFactor() { return 0.1; } @Override protected int getMaxHP() { return 100; } } public abstract class EntityAnyBoat extends EntityBoat { public EntityAnyBoat(World world, double x, double y, double z, float width, float height) { super(world, x, y, z); setSize(width, height); this.yOffset = this.height / 2.0F; } public EntityAnyBoat(World world) { super(world); } protected abstract double getSpeedFactor(); protected abstract int getMaxHP(); } And the code of the Item that creates the dinghy: public abstract class ItemAnyBoat extends Item { public ItemAnyBoat(int par1) { super(par1); this.maxStackSize = 1; this.setTabToDisplayOn(CreativeTabs.tabTransport); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (!world.isRemote) { // findBoatPosition has the same code that ItemBoat uses to find the spawn position of the boat Vec3 pos = WorldUtil.findBoatPosition(itemStack, world, player); if (pos != null) { world.spawnEntityInWorld(createBoat(world, pos)); if (!player.capabilities.isCreativeMode) { --itemStack.stackSize; } } } return itemStack; } public abstract EntityAnyBoat createBoat(World world, Vec3 pos); @Override public String getTextureFile() { return SABResourceRegistry.ITEMS; } } public class ItemDinghy extends ItemAnyBoat { public ItemDinghy(int par1) { super(par1); setMaxStackSize(1); setIconIndex(items.DINGHY); } @Override public EntityAnyBoat createBoat(World world, Vec3 pos) { return new Dinghy(world, pos.xCoord, pos.yCoord, pos.zCoord); } } Could you please tell me what I'm doing wrong?
×
×
  • Create New...

Important Information

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