Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/23/17 in all areas

  1. Somehow the InventoryCraftResult#stackResult NonNullList has an instance of Arrays.ArrayList as its delegate list but null as its default element. This shouldn't be possible unless the protected NonNullList(List<E>, E) constructor was called directly rather than being called through NonNullList#create or NonNullList#withSize. Does ContainerHunterBench use the vanilla InventoryCraftResult class? Post the ContainerHunterBench, TileEntityHunterBench and InventoryCraftResult (if it's your own) classes.
    1 point
  2. o_0 So... which one? WorldSavedData is not a correct place to store per chunk data. You have access to chunk NBT in both chunk load a save events for a reason ;). Did you know, that vanilla already has a ChunkPos class? Also, hash maps won't work if you don't implement hashCode and equals (use your IDE to generate them).
    1 point
  3. You still have a null ItemStack somewhere in the inventory used by the Container. To narrow it down, set a breakpoint inside the for loop Container#getInventory with the condition inventorySlots.get(i).getStack() == null (i.e. the Slot's ItemStack is null). When the breakpoint is hit, look at the Slot's inventory (Slot#inventory or SlotItemHandler#itemHandler) and index (Slot#slotIndex) to see which inventory slot contains the null ItemStack. Once you know where the null ItemStack is, you can figure out where that slot is set from and why it's being set to null. To help avoid errors like this, annotate any ItemStack return value or parameter with @Nonnull. Your IDE will warn you when you return a nullable value from a @Nonnull method or pass a nullable value to a @Nonnull parameter. If you copy the package-info.java file from a vanilla package into your own packages, the @MethodsReturnNonnullByDefault and @ParametersAreNonnullByDefault annotations will tell your IDE that the methods and parameters in that package are @Nonnull by default. Use @Nullable if a method can return or accept null values.
    1 point
  4. MHFCCraftingManager#findMatchingRecipe is returning null (presumably because there's no matching recipe), which is no longer a valid value for an ItemStack. Instead of returning null, return ItemStack.EMPTY.
    1 point
  5. You're calling IInventory#setInventorySlotContents with a null value (returned by MHFCCraftingManager#findMatchingRecipe), which is invalid. ItemStacks can no longer be null in 1.11.x, the default value is now the empty ItemStack (i.e. any ItemStack that returns true from ItemStack#isEmpty). The ItemStack.EMPTY field contains an ItemStack that's always empty.
    1 point
  6. Minecraft couldn't find your item model or blockstates file. Are you sure they're at src/main/resources/assets/lbm/models/item/blockbeef.json and src/main/resources/assets/lbm/blockstates/blockbeef.json respectively? Post a screenshot of one of these folders in File Explorer with the address bar visible. You should't be registering your models from a common class like ModBlocks or by calling ItemModelMesher#register. Instead, register them from a client-only class called from your client proxy by calling ModelLoader.setCustomModelResourceLocation/setCustomMeshDefinition (these take the same arguments as the two overloads of ItemModelMesher#register). Do this in preInit (if you register your Blocks and Items in preInit) or in ModelRegistryEvent (if you register your Blocks and Items in RegistryEvent.Register [this is the recommended way to register them]). You can read more about the registry events here.
    1 point
×
×
  • Create New...

Important Information

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