Doggy Talents

Doggy Talents

27M Downloads

Incompatibility with Shrink. mod 1.16

deadspidervenom opened this issue ยท 4 comments

commented

Environment And Mod Information:

  • Minecraft Version: 1.16.4
  • Forge Version: 35.1.36
  • Doggy Talents Version: 2.0.1.2
  • Java Version: 1.8.0_51
  • Operating System (OS): windows 10

Logs

Error executing task on Server
java.lang.NullPointerException
	at doggytalents.common.entity.DogEntity.getCapability(DogEntity.java:1051)
	at net.minecraftforge.common.capabilities.ICapabilityProvider.getCapability(ICapabilityProvider.java:48)
	at net.gigabit101.shrink.events.PlayerEvents.changeSize(PlayerEvents.java:119)
	at net.minecraftforge.eventbus.ASMEventHandler_30_PlayerEvents_changeSize_Size.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297)
	at net.minecraftforge.event.ForgeEventFactory.getEntitySizeForge(ForgeEventFactory.java:751)
	at net.minecraft.entity.Entity.<init>(Entity.java:217)
	at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:205)
	at net.minecraft.entity.MobEntity.<init>(MobEntity.java:136)
	at net.minecraft.entity.CreatureEntity.<init>(SourceFile:12)
	at net.minecraft.entity.AgeableEntity.<init>(SourceFile:28)
	at net.minecraft.entity.passive.AnimalEntity.<init>(AnimalEntity.java:37)
	at net.minecraft.entity.passive.TameableEntity.<init>(SourceFile:31)
	at doggytalents.api.inferface.AbstractDogEntity.<init>(AbstractDogEntity.java:26)
	at doggytalents.common.entity.DogEntity.<init>(DogEntity.java:194)
	at doggytalents.DoggyEntityTypes$$Lambda$7698/1368343950.create(Unknown Source)
	at net.minecraft.entity.EntityType.func_200721_a(EntityType.java:445)
	at doggytalents.common.event.EventHandler.rightClickEntity(EventHandler.java:48)
	at net.minecraftforge.eventbus.ASMEventHandler_983_EventHandler_rightClickEntity_EntityInteract.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297)
	at net.minecraftforge.common.ForgeHooks.onInteractEntity(ForgeHooks.java:774)
	at net.minecraft.entity.player.PlayerEntity.func_190775_a(PlayerEntity.java:936)
	at net.minecraft.network.play.ServerPlayNetHandler.func_147340_a(ServerPlayNetHandler.java:1194)
	at net.minecraft.network.play.client.CUseEntityPacket.func_148833_a(SourceFile:74)
	at net.minecraft.network.play.client.CUseEntityPacket.func_148833_a(SourceFile:13)
	at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:34)
	at net.minecraft.network.PacketThreadUtil$$Lambda$33219/1780517814.run(Unknown Source)
	at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(ThreadTaskExecutor.java:172)
	at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23)
	at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:733)
	at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:159)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(ThreadTaskExecutor.java:134)
	at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:716)
	at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServer.java:710)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(ThreadTaskExecutor.java:115)
	at net.minecraft.server.MinecraftServer.func_213202_o(MinecraftServer.java:695)
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:645)
	at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:232)
	at net.minecraft.server.MinecraftServer$$Lambda$31289/1573849266.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:745)

Issue Description:

Using a training treat on a vanilla dog does nothing and will throw that error in the active log without a crash or anything.

Steps to reproduce:

  1. Install dogg talent with shrink. mod
  2. Tame a dog
  3. Give dog a training treat

Additional Information:

  • More Details: I posted this info on a different issue, but the person closed it, so in order to make sure this gets tackled i made a new issue.
  • Screenshots: n/a
commented

Should be fixed in 41b16d7, I will hopefully release the fix today

commented

Should be fixed in 41b16d7, I will hopefully release the fix today

While i thank you for a.. fix? making the game crash instead of a silent error does not really fix it does it?

commented

The crash is caused due to how java loads the class, it calls the constructor and it's super method before init the class's fields but in the super constructor it tries to access the fields - and crashes because they are not initialised. The constructor just sets an inital state for the entity and shrink hooks into this constructor to do the same for it's stuff. Even if the field was defined there is no elements in the alterations lists because no NBT has been loaded. Once the NBT is loaded, the entities state is set and normal logic works. This is the best fix and only fix that can be done.

The silent error I was referring to was this bug

commented

Released in 2.0.1.3