Résolu Crash lié à un TileEntity
-
Salut les gens, un crash que je ne comprend pas avec un TileEntity dont voici le CrashReport
Si quelqu’un saurait éclairé ma lanterne, je lui en serais gré.
–-- Minecraft Crash Report ---- // Who set us up the TNT? Time: 4/19/16 10:25 AM Description: Ticking entity java.lang.ClassCastException: fr.folgansky.powerdeco.client.TileEntityFauteuil cannot be cast to com.mia.props.common.TileProps at com.mia.props.common.TileFake.getMaster(TileFake.java:42) at com.mia.props.common.BlockFake.func_149731_a(BlockFake.java:63) at net.minecraft.world.World.func_147447_a(World.java:1603) at net.minecraft.world.World.func_72933_a(World.java:1406) at net.minecraft.entity.EntityLivingBase.func_70685_l(EntityLivingBase.java:2194) at net.minecraft.entity.ai.EntitySenses.func_75522_a(SourceFile:28) at noppes.npcs.ai.selector.NPCAttackSelector.func_82704_a(NPCAttackSelector.java:36) at net.minecraft.world.chunk.Chunk.func_76618_a(Chunk.java:1113) at net.minecraft.world.World.func_82733_a(World.java:3864) at noppes.npcs.ai.target.EntityAIClosestTarget.func_75250_a(EntityAIClosestTarget.java:56) at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:70) at net.minecraft.entity.EntityLiving.func_70619_bc(EntityLiving.java:579) at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2035) at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:388) at noppes.npcs.entity.EntityNPCInterface.func_70636_d(EntityNPCInterface.java:361) at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:1868) at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:213) at noppes.npcs.entity.EntityNPCInterface.func_70071_h_(EntityNPCInterface.java:246) at noppes.npcs.entity.EntityCustomNpc.func_70071_h_(EntityCustomNpc.java:34) at net.minecraft.world.World.func_72866_a(World.java:2643) at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:838) at net.minecraft.world.World.func_72870_g(World.java:2596) at net.minecraft.world.World.func_72939_s(World.java:2408) at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:669) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:943) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:423) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:798) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:658) at java.lang.Thread.run(Thread.java:745) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.mia.props.common.TileFake.getMaster(TileFake.java:42) at com.mia.props.common.BlockFake.func_149731_a(BlockFake.java:63) at net.minecraft.world.World.func_147447_a(World.java:1603) at net.minecraft.world.World.func_72933_a(World.java:1406) at net.minecraft.entity.EntityLivingBase.func_70685_l(EntityLivingBase.java:2194) at net.minecraft.entity.ai.EntitySenses.func_75522_a(SourceFile:28) at noppes.npcs.ai.selector.NPCAttackSelector.func_82704_a(NPCAttackSelector.java:36) at net.minecraft.world.chunk.Chunk.func_76618_a(Chunk.java:1113) at net.minecraft.world.World.func_82733_a(World.java:3864) at noppes.npcs.ai.target.EntityAIClosestTarget.func_75250_a(EntityAIClosestTarget.java:56) at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:70) at net.minecraft.entity.EntityLiving.func_70619_bc(EntityLiving.java:579) at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2035) at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:388) at noppes.npcs.entity.EntityNPCInterface.func_70636_d(EntityNPCInterface.java:361) at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:1868) at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:213) at noppes.npcs.entity.EntityNPCInterface.func_70071_h_(EntityNPCInterface.java:246) at noppes.npcs.entity.EntityCustomNpc.func_70071_h_(EntityCustomNpc.java:34) at net.minecraft.world.World.func_72866_a(World.java:2643) at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:838) at net.minecraft.world.World.func_72870_g(World.java:2596) -- Entity being ticked -- Details: Entity Type: customnpcs.CustomNpc (noppes.npcs.entity.EntityCustomNpc) Entity ID: 199 Entity Name: Miguel Entity's Exact location: 288.98, 75.00, 1126.77 Entity's Block location: World: (288,75,1126), Chunk: (at 0,4,6 in 18,70; contains blocks 288,0,1120 to 303,255,1135), Region: (0,2; contains chunks 0,64 to 31,95, blocks 0,0,1024 to 511,255,1535) Entity's Momentum: -0.07, -0.08, 0.00 Stacktrace: at net.minecraft.world.World.func_72939_s(World.java:2408) at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:669) -- Affected level -- Details: Level name: V All players: 1 total; [EntityPlayerMP['ID_WARHAMMER'/143, l='V', x=289.99, y=75.00, z=1118.00](ID_WARHAMMER at 289.98701430522243,75.0,1117.9972392659092)] Chunk stats: ServerChunkCache: 544 Drop: 0 Level seed: -8391295972675811935 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: 2;7,9x1,8x3,8x12,41x9;1;village,biome_1 Level spawn location: World: (431,75,1124), Chunk: (at 15,4,4 in 26,70; contains blocks 416,0,1120 to 431,255,1135), Region: (0,2; contains chunks 0,64 to 31,95, blocks 0,0,1024 to 511,255,1535) Level time: 283914471 game time, 285425694 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 40329 (now: false), thunder time: 131812 (now: false) Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:943) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:423) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:798) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:658) at java.lang.Thread.run(Thread.java:745) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Linux (amd64) version 3.14.32-xxxx-std-ipv6-64 Java Version: 1.7.0_79, Oracle Corporation Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 944201624 bytes (900 MB) / 4612685824 bytes (4399 MB) up to 15178137600 bytes (14475 MB) JVM Flags: 2 total; -Xmx16284M -Xms1028M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.25.1207 Minecraft Forge 10.13.0.1207 19 mods loaded, 19 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.25.1207} [Forge Mod Loader] (cauldron-1.7.10-1.1207.01.198-server.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.0.1207} [Minecraft Forge] (cauldron-1.7.10-1.1207.01.198-server.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available malisiscore{1.7.10-0.10.5+unknown-b0.git-unknown} [Malisis Core] (malisiscore-1.7.10-0.10.5.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available mod_AsyncWorldEdit_Injector{2.1.0} [AsyncWorldEdit Injector] (AsyncWorldEditInjector.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available customnpcs{1.7.10d} [CustomNpcs] (CustomNPCs_1.7.10d.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available PTRModelLib{1.0.0} [PTRModelLib] (Decocraft-2.1.1_1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available props{2.1.1} [Decocraft] (Decocraft-2.1.1_1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available DragonsRadioMod{1.7.1} [Dragon's Radio Mod] (Dragon's Radio Mod-MC1.7.10-1.7.1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available erc{1.10} [Ex Roller Coaster] (exRollerCoaster-1.10t.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available flansmod{4.10.0} [Flan's Mod] (Flans Mod-1.7.10-4.10.0.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available malisisdoors{1.7.10-1.4.3} [Malisis' Doors] (malisisdoors-1.7.10-1.4.3.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available modpg{2.5.6} [Mod Power Game] (ModPg-2.5.6.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available pda{1.7.10} [Plus d'aliments] (Plus daliments-1.7.10 v7.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available modonepiece{1.0.0} [Mod One Piece] (PowerDeco 1.0.0.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available modpowerdeco{1.0.0} [Mod Power Deco] (PowerDeco 1.0.0.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available modpg2{1.2.8} [Mod Power Game 2] (PowerGame 1.2.8.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available tts{0.6} [Tube Transport System] (TubeTransportSystem_1.7.10-0.6.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available worldedit{6.0-beta-01} [WorldEdit] (worldedit-forge-mc1.7.10-6.0-beta-01.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 50; [EntityPlayerMP['ID_WARHAMMER'/143, l='V', x=289.99, y=75.00, z=1118.00](ID_WARHAMMER at 289.98701430522243,75.0,1117.9972392659092)] Is Modded: Definitely; Server brand changed to 'cauldron,craftbukkit,mcpc,fml,forge' Type: Dedicated Server (map_server.txt)
Et la classe du TileEntity
package fr.folgansky.powerdeco.client; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; public class TileEntityFauteuil extends TileEntity { private byte direction; @Override public boolean canUpdate() { return false; } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); this.direction = compound.getByte("Direction"); } @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setByte("Direction", this.direction); } public byte getDirection() { return direction; } public void setDirection(byte direction) { this.direction = direction; this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); } @Override public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { this.readFromNBT(pkt.func_148857_g()); this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord); } }
-
at com.mia.props.common.TileFake.getMaster(TileFake.java:42)
Tu peux envoyer la classe TileFake ? -
Je n’ai pas ça dans mon mod.
Le crash se fait sur serveur, j’ai l’impression que c’est un soucis de compatibilité de mods, enfin si je suis là c’est parce que je n’en sais pas plus et débute en modding.
On suppose que le soucis est en partie lié à CustomNPC, mais toujours rien de sûr -
ah oui, en effet il y a un autre mod qui tente de cast ton tile entity avec le tien.
D’où le crash.
La personne qui a fait l’autre mod aurait du mettre un instanceof avant de cast. -
D’acc, si c’est CustomNpc qui fait ça ce sera simple de faire remonter l’info à Noppes
Mais sinon si je change le nom de mes classes ça règlerait le soucis ou “la vérité est ailleurs”?
-
Une nouvelle sorte de crash apparemment
–-- Minecraft Crash Report ---- // Don't be sad. I'll do better next time, I promise! Time: 19/04/16 13:59 Description: Ticking Particle java.lang.ClassCastException: fr.folgansky.powerdeco.client.TileEntityFauteuil cannot be cast to com.mia.props.common.TileProps at com.mia.props.common.TileFake.getMaster(TileFake.java:42) at com.mia.props.common.BlockFake.func_149743_a(BlockFake.java:76) at net.minecraft.world.World.func_72945_a(World.java:1437) at net.minecraft.entity.Entity.func_70091_d(Entity.java:596) at net.minecraft.client.particle.EntityFX.func_70071_h_(SourceFile:117) at net.minecraft.client.particle.EffectRenderer.func_78868_a(EffectRenderer.java:77) at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:2055) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898) at net.minecraft.client.main.Main.main(SourceFile:148) 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 net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.mia.props.common.TileFake.getMaster(TileFake.java:42) at com.mia.props.common.BlockFake.func_149743_a(BlockFake.java:76) at net.minecraft.world.World.func_72945_a(World.java:1437) at net.minecraft.entity.Entity.func_70091_d(Entity.java:596) at net.minecraft.client.particle.EntityFX.func_70071_h_(SourceFile:117) -- Particle being ticked -- Details: Particle: EntityDiggingFX, Pos (289.125,75.875,1130.125), RGBA (0.6,0.6,0.6,1.0), Age 1 Particle Type: TERRAIN_TEXTURE Stacktrace: at net.minecraft.client.particle.EffectRenderer.func_78868_a(EffectRenderer.java:77) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['_Bart'/32705, l='MpServer', x=289,70, y=76,62, z=1128,09]] Chunk stats: MultiplayerChunkCache: 380, 380 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: World: (431,75,1124), Chunk: (at 15,4,4 in 26,70; contains blocks 416,0,1120 to 431,255,1135), Region: (0,2; contains chunks 0,64 to 31,95, blocks 0,0,1024 to 511,255,1535) Level time: 284162084 game time, 285800112 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false Forced entities: 27 total; [EntityClientPlayerMP['_Bart'/32705, l='MpServer', x=289,70, y=76,62, z=1128,09], EntityMobGangster['Gangster à batte cloutée'/32768, l='MpServer', x=280,31, y=23,00, z=1146,69], EntityCustomNpc['Miguel'/32769, l='MpServer', x=283,53, y=75,00, z=1124,03], EntityCustomNpc['Dr. Cametouche'/32770, l='MpServer', x=270,50, y=75,00, z=1124,50], EntityCustomNpc['Dr. Ray'/32706, l='MpServer', x=298,50, y=82,00, z=1126,50], EntityMobGangster3['Costard'/32771, l='MpServer', x=290,59, y=82,00, z=1157,34], EntityMobGangster3['Costard'/32772, l='MpServer', x=291,31, y=82,00, z=1160,69], EntityMobGangster3['Costard'/32773, l='MpServer', x=288,09, y=82,00, z=1157,96], EntityMobGangster3['Costard'/32774, l='MpServer', x=281,53, y=82,00, z=1160,66], EntityCustomNpc['Dr. Chang'/32775, l='MpServer', x=283,50, y=75,00, z=1092,50], EntityCustomNpc['Cpt. Kineth'/32776, l='MpServer', x=282,50, y=75,50, z=1098,47], EntityCustomNpc['Alka''/32777, l='MpServer', x=279,50, y=82,00, z=1102,50], EntityMobGangster['Gangster à batte cloutée'/32778, l='MpServer', x=255,50, y=46,00, z=1129,31], EntityCustomNpc['Lily'/32780, l='MpServer', x=280,50, y=75,50, z=1085,50], EntityCustomNpc['Agnès'/32784, l='MpServer', x=284,53, y=82,00, z=1119,72], EntityCustomNpc['Dr. Bill'/32786, l='MpServer', x=290,50, y=82,00, z=1063,50], EntityCustomNpc['Jimmy'/32758, l='MpServer', x=273,50, y=76,00, z=1120,50], EntityMobGangster3['Costard'/32310, l='MpServer', x=305,25, y=22,00, z=1147,31], EntityMobGangster['Gangster à batte cloutée'/32759, l='MpServer', x=275,22, y=127,00, z=1129,22], EntityMobGangster['Gangster à batte cloutée'/32760, l='MpServer', x=284,09, y=127,00, z=1126,16], EntityMobGangster['Gangster à batte cloutée'/32761, l='MpServer', x=276,28, y=127,00, z=1126,63], EntityMobGangster2['Gangster fou'/32762, l='MpServer', x=278,84, y=122,00, z=1129,72], EntityMobGangster2['Gangster fou'/32763, l='MpServer', x=276,78, y=122,00, z=1123,91], EntityMobGangster2['Gangster fou'/32764, l='MpServer', x=280,16, y=122,00, z=1125,72], EntityMobGangster['Gangster à batte cloutée'/32765, l='MpServer', x=281,09, y=127,00, z=1123,16], EntityCustomNpc['Jimmy'/32766, l='MpServer', x=296,50, y=76,00, z=1116,50], EntityCustomNpc['Dr. Willis'/32767, l='MpServer', x=296,50, y=75,00, z=1118,50]] Retry entities: 0 total; [] Server brand: cauldron,craftbukkit,mcpc,fml,forge Server type: Non-integrated multiplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373) at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2444) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:919) at net.minecraft.client.main.Main.main(SourceFile:148) 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 net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_77, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 556921784 bytes (531 MB) / 1208287232 bytes (1152 MB) up to 2112618496 bytes (2014 MB) JVM Flags: 6 total; -Xms512M -Xmx2048M -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 Optifine OptiFine_1.7.10_HD_U_C1 20 mods loaded, 20 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJA FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10.jar) UCHIJA Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10.jar) UCHIJA malisiscore{1.7.10-0.10.5+unknown-b0.git-unknown} [Malisis Core] (malisiscore-1.7.10-0.10.5.jar) UCHIJA CustomMainMenu{1.9.2} [Custom Main Menu] (CustomMainMenu-MC1.7.10-1.9.2.jar) UCHIJA customnpcs{1.7.10d} [CustomNpcs] (CustomNPCs_1.7.10d(21feb16).jar) UCHIJA PTRModelLib{1.0.0} [PTRModelLib] (Decocraft-2.1.1_1.7.10.jar) UCHIJA props{2.1.1} [Decocraft] (Decocraft-2.1.1_1.7.10.jar) UCHIJA DragonsRadioMod{1.7.1} [Dragon's Radio Mod] (Dragon's Radio Mod-MC1.7.10-1.7.1.jar) UCHIJA erc{1.10} [Ex Roller Coaster] (exRollerCoaster-1.10t.zip) UCHIJA flansmod{4.10.0} [Flan's Mod] (Flans Mod-1.7.10-4.10.0.jar) UCHIJA malisisdoors{1.7.10-1.4.3} [Malisis' Doors] (malisisdoors-1.7.10-1.4.3.jar) UCHIJA modpg{2.5.6} [Mod Power Game] (ModPg-2.5.6.jar) UCHIJA pda{1.7.10} [Plus d'aliments] (Plus daliments-1.7.10 v7.jar) UCHIJA modonepiece{1.0.0} [Mod One Piece] (PowerDeco 1.0.0.jar) UCHIJA modpowerdeco{1.0.0} [Mod Power Deco] (PowerDeco 1.0.0.jar) UCHIJA modpg2{1.2.8} [Mod Power Game 2] (PowerGame 1.2.8.jar) UCHIJA ReiMinimap{1.7.10} [Rei's Minimap] (Reis-Minimap-Mod-1.7.10.jar) UCHIJA ResourceLoader{1.2} [Resource Loader] (ResourceLoader-1.2.jar) UCHIJA tts{0.6} [Tube Transport System] (TubeTransportSystem_1.7.10-0.6.jar) GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 364.72' Renderer: 'GeForce GT 740/PCIe/SSE2' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GT 740/PCIe/SSE2 GL version 4.5.0 NVIDIA 364.72, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
-
L’origine du problème est identique.
-
D’acc, j’étais pris d’un doute.
Du coup si je change certains noms de classes ça peut aider à résoudre le problème?
-
Si tu parles des classes dans TON mod et non dans celui qui cause le crash, alors oui essaie, ça résoudra sûrement le prob. Sinon peut-être qu’avec l’accord de l’auteur du mod causant ton crash, tu pourras avoir les sources, UNIQUEMENT dans le but de modifier le nom des classes, ou alors peut-être qu’avec la reflexion tu peux faire quelque chose. Je sais pas….
-
Non.
Tu ne peux pas résoudre le problème.
Le problème vient de l’autre mod qui tente de cast ce qu’il ne devrait pas cast. -
Ok j’ai compris
Bon bah à moins de demander les sources au créateur, je ne vois pas d’autres solutions (peut-être la reflexion, me faudrait un avis là dessus ?)…
Héé psst, ici… Sinon décompile le mod et sers toi des mappings pour modsifier ce que tu veux du mod Pas sûr que ce soit très légal légal étant donné que ton serveur n’est sûrement pas privé mais disponible au grand public …
-
Ouki, bah le dév du mod en question est en relation avec un serveur avec qui j’entretiens de bonnes relations, ça sert à ça les réseaux
Je ferai remonter l’info.
(Comme je ne comprend pas tous les mécanismes des cast, j’oublie l’idée de changer le nom de mes tileEntity si on me dit que cela n’aura aucun effet, ça m’épargne le fait de replacer tous les blocs)
En vous remerciant les gars.
-
Le cast sert à excéder aux fonctions d’une classe fille.
Par exemple tu as une fonction avec Entity en argument or toi tu as besoin de la fonction getCurrentEquipedItem de EntityPlayer.
Dans ce cas tu cast :EntityPlayer player = (EntityPlayer)entity.
Le problème c’est que entity peut être n’importe quel entité. Ça peut être un joueur tout comme ça peut être un zombie ou une flèche.
Si c’est un joueur ça va passer sans problème, dans les autres cas cela va causer un ClassCastException.D’où l’importance de faire un if(entity instanceof EntityPlayer) avant de cast pour exclure les cas où l’entité n’est pas un joueur.
-
Waow, quelle pédagogie Robin merci, j’ai reçu deux leçons de java aujourd’hui, mon quota est remplis pour la semaine x]
Il s’avère que le mod qui pose problème est decocraft et non pas CustomNpc, elle est au courant depuis normalement.
Et c’est un peu un comble car si je me remet à faire des rendus 3D c’est justement pour retirer ce mod (trop gourmand pour ce qu’on en fait)Du coup, merci pour ce sujet qui a fais plus jouer des contacts que du modding x] (et la parenthèse sur le cast)
Edit:
D’ailleurs pour savoir si j’ai bien compris, cast sans faire l’instanceof c’est comme scier la branche sur laquelle on est assis?
(Ouais je m’imagine l’arborescence des classes comme étant un arbre, on fait comme on peut pour associer les concepts) -
Pas forcement. Dans certaines situations on est sûr que le cast fonctionnera à chaque fois.
Justement avec les blocs et les tile entity. Si ton bloc à un tile entity associer, en général le tile entity qui se trouve aux coordonnées de ton bloc sera toujours celui-ci. Or la fonction getTileEntity de world renvoie un TileEntity et non TileEntityQuelqueChose qui correspond au tile entity de ton bloc. Donc cast sans check l’instance est utile et normalement sans risque.
Le cas ici présent est plus délicat car decocraft semble get les tile entity voisin (x + 1 ou - 1, z + 1 ou - 1).
Enfin, même dans le cas où on get le tile entity qui se trouve sur le bloc, j’ai déjà vu des ClassCastException alors que ce n’est pas sensé arriver (sûrement car le tile entity ne s’était pas retiré quand le bloc a été cassé et l’ajout d’un autre bloc à la place a causé l’erreur). Donc dans cette situation on n’est pas à l’abri d’un problème, c’est bien pour ça que dans les tutoriels j’utilise toujours un instanceof.
Mais il existe réellement des situations où on peut cast sans instanceof.