Jump to content

Recommended Posts

Posted

I decided to create a new thread for this because its a different problem.

 

I am making a mob grinder that uses a fake player to do the killing and for the most part it works fine but but i am having problems when other mods try to do certain things to it (in this case the other mod is Infernal Mobs). At first i had a problem when an infernal mob tried to affect the fake player with a potion effect but i have since fixed that now i am having trouble when a mob tries sent a data packet to the fake player.

 

I have tracked the problem to playerNetServerHandler in my fake player is null which is giving a null pointer exception in FMLOutboundHandler.

 

Crash log

 

Description: Ticking block entity

java.lang.NullPointerException: Ticking block entity
at cpw.mods.fml.common.network.FMLOutboundHandler$OutboundTarget$4.selectNetworks(FMLOutboundHandler.java:109)
at cpw.mods.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:273)
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637)
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:115)
at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116)
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:626)
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:878)
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:229)
at io.netty.channel.embedded.EmbeddedChannel.writeOutbound(EmbeddedChannel.java:195)
at atomicstryker.infernalmobs.common.network.NetworkHelper.sendPacketToPlayer(NetworkHelper.java:111)
at atomicstryker.infernalmobs.common.InfernalMobsCore.sendVelocityPacket(InfernalMobsCore.java:745)
at atomicstryker.infernalmobs.common.mods.MM_Blastoff.tryAbility(MM_Blastoff.java:69)
at atomicstryker.infernalmobs.common.mods.MM_Blastoff.onHurt(MM_Blastoff.java:44)
at atomicstryker.infernalmobs.common.MobModifier.onHurt(MobModifier.java:213)
at atomicstryker.infernalmobs.common.mods.MM_Ender.onHurt(MM_Ender.java:37)
at atomicstryker.infernalmobs.common.MobModifier.onHurt(MobModifier.java:213)
at atomicstryker.infernalmobs.common.mods.MM_Webber.onHurt(MM_Webber.java:47)
at atomicstryker.infernalmobs.common.EntityEventHandler.onEntityLivingHurt(EntityEventHandler.java:126)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_118_EntityEventHandler_onEntityLivingHurt_LivingHurtEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:288)
at net.minecraft.entity.EntityLivingBase.damageEntity(EntityLivingBase.java:1271)
at net.minecraft.entity.EntityLivingBase.attackEntityFrom(EntityLivingBase.java:880)
at net.minecraft.entity.monster.EntityMob.attackEntityFrom(EntityMob.java:84)
at com.brandon3055.draconicevolution.common.tileentities.TileGrinder.killNextEntity(TileGrinder.java:152)
at com.brandon3055.draconicevolution.common.tileentities.TileGrinder.updateEntity(TileGrinder.java:103)
at net.minecraft.world.World.updateEntities(World.java:2115)
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:517)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:713)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at cpw.mods.fml.common.network.FMLOutboundHandler$OutboundTarget$4.selectNetworks(FMLOutboundHandler.java:109)
at cpw.mods.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:273)
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637)
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:115)
at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116)
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:626)
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:878)
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:229)
at io.netty.channel.embedded.EmbeddedChannel.writeOutbound(EmbeddedChannel.java:195)
at atomicstryker.infernalmobs.common.network.NetworkHelper.sendPacketToPlayer(NetworkHelper.java:111)
at atomicstryker.infernalmobs.common.InfernalMobsCore.sendVelocityPacket(InfernalMobsCore.java:745)
at atomicstryker.infernalmobs.common.mods.MM_Blastoff.tryAbility(MM_Blastoff.java:69)
at atomicstryker.infernalmobs.common.mods.MM_Blastoff.onHurt(MM_Blastoff.java:44)
at atomicstryker.infernalmobs.common.MobModifier.onHurt(MobModifier.java:213)
at atomicstryker.infernalmobs.common.mods.MM_Ender.onHurt(MM_Ender.java:37)
at atomicstryker.infernalmobs.common.MobModifier.onHurt(MobModifier.java:213)
at atomicstryker.infernalmobs.common.mods.MM_Webber.onHurt(MM_Webber.java:47)
at atomicstryker.infernalmobs.common.EntityEventHandler.onEntityLivingHurt(EntityEventHandler.java:126)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_118_EntityEventHandler_onEntityLivingHurt_LivingHurtEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:288)
at net.minecraft.entity.EntityLivingBase.damageEntity(EntityLivingBase.java:1271)
at net.minecraft.entity.EntityLivingBase.attackEntityFrom(EntityLivingBase.java:880)
at net.minecraft.entity.monster.EntityMob.attackEntityFrom(EntityMob.java:84)
at com.brandon3055.draconicevolution.common.tileentities.TileGrinder.killNextEntity(TileGrinder.java:152)
at com.brandon3055.draconicevolution.common.tileentities.TileGrinder.updateEntity(TileGrinder.java:103)

-- Block entity being ticked --
Details:
Name: draconicevolution:TileGrinder // com.brandon3055.draconicevolution.common.tileentities.TileGrinder
Block type: ID #169 (tile.draconicevolution:grinder // com.brandon3055.draconicevolution.common.blocks.machine.Grinder)
Block data value: 0 / 0x0 / 0b0000
Block location: World: (26,71,25), Chunk: (at 10,4,9 in 1,1; contains blocks 16,0,16 to 31,255,31), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Actual block type: ID #169 (tile.draconicevolution:grinder // com.brandon3055.draconicevolution.common.blocks.machine.Grinder)
Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
at net.minecraft.world.World.updateEntities(World.java:2115)
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:517)

-- Affected level --
Details:
Level name: Minning Layers
All players: 1 total; [EntityPlayerMP['ForgeDevName'/393041, l='Minning Layers', x=26.66, y=75.84, z=18.06]]
Chunk stats: ServerChunkCache: 1089 Drop: 0
Level seed: 3446051860655676810
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 2;7,10x1,10x13,10x3,10x12,10x5,10x35:15,10x159:14;1;village
Level spawn location: World: (0,71,0), Chunk: (at 0,4,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 11019136 game time, 6000 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 27969 (now: false), thunder time: 33740 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:713)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 328606760 bytes (313 MB) / 1317826560 bytes (1256 MB) up to 2077753344 bytes (1981 MB)
JVM Flags: 3 total; -Xincgc -Xmx2048M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
FML: MCP v9.05 FML v7.10.25.1199 Minecraft Forge 10.13.0.1199 16 mods loaded, 16 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
FML{7.10.25.1199} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1199.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Forge{10.13.0.1199} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1199.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
CodeChickenCore{1.0.1.8} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
<CoFH ASM>{000} [CoFH ASM Data Initialization] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
NotEnoughItems{1.0.2.15} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.2.15-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
CoFHCore{1.7.10R3.0.0B3} [CoFH Core] (CoFHCore-[1.7.10]3.0.0B3-dev-26.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
DraconicEvolution{0.9.5-Beta} [Draconic Evolution] (Draconic-Evolution) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
ExtraUtilities{1.1.0e} [Extra Utilities] (extrautilities-1.1.0e.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
InfernalMobs{1.5.6} [infernal Mobs] (InfernalMobs-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Mantle{1.7.10-0.3.1.jenkins180} [Mantle] (Mantle-mc1.7.10-0.3.1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
ThermalFoundation{1.7.10R1.0.0B1} [Thermal Foundation] (ThermalFoundation-[1.7.10]1.0.0B1-dev-6.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
ThermalExpansion{1.7.10R4.0.0B3} [Thermal Expansion] (ThermalExpansion-[1.7.10]4.0.0B3-dev-11.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
RedstoneArsenal{1.7.10R1.1.0B3} [Redstone Arsenal] (RedstoneArsenal-[1.7.10]1.1.0B3-dev-8.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
TConstruct{1.7.10-1.6.0.build611} [Tinkers' Construct] (TConstruct_mc1.7.10_1.6.0d40.1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
TMechworks{1.7.10-67.34d1d9b} [Tinkers' Mechworks] (TMechworks_mc1.7.10_0.2.8.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Mantle Environment: Environment healthy.
TConstruct Environment: Environment healthy.
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['ForgeDevName'/393041, l='Minning Layers', x=26.66, y=75.84, z=18.06]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
#@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2014-10-21_21.48.49-server.txt
Disconnected from the target VM, address: '127.0.0.1:50064', transport: 'socket'
AL lib: (EE) alc_cleanup: 1 device not closed

Process finished with exit code -1

 

 

Unfortunately finding the problem was the easy part i have been working on this for over a day and havent even come close to finding a solution yet. Im hoping someone more experienced can help me with this problem.

I am the author of Draconic Evolution

Posted

Last I checked you don't need a fakeplayer to make mobs drop their rare-drops.  There is (was) an int field you can set in the entity that denotes a timer since it was last hit by a player.  If this timer>0 when it dies, it drops rare/player only loot.  Simply set the timer to 1, and do whatever to kill the entity (I generally call entity.attackEntityFrom(genericSource, entityHealth).

 

 

Upon further investigation, the field is still there, in EntityLivingBase.

 

protected int recentlyHit;

 

Use reflection / AT to set this to a value >0.  Viola, the mob now drops 'rare' loot.

 

 

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.