-
Posts
884 -
Joined
-
Last visited
-
Days Won
9
Everything posted by Jay Avery
-
Thanks, I think I'll try the debug mode idea and see if I get anything useful.
-
I have no idea about profiling - do you have any advice on where to begin or learn? But also, wouldn't that suggest it was a general lag issue? There doesn't seem to be significant lag generally, only when this crash happens (things stop responding for a few seconds before the server shuts down, which is presumably while the game is trying to run the tick that ends up taking a minute). So even if I do look at how long things are taking, it might not give me any useful information unless I am watching when the crash happens, which is currently completely unpredictable and very intermittent.
-
The things I want to change are aspects of the main methods in EntityFallingBlock. If I extended it, I'd end up with pretty much the same result - I'd have to recreate most of the methods anyway in order to add my tweaks.
-
I have a server running my mod, and I've had this crash about three times over several days of playing. The crash completely shuts down the server when it happens. I can't figure out what's causing it or what it means. The full crash report: I've figured out a deobfuscated version of that stack trace to save the trouble: java.lang.Error at net.minecraft.world.chunk.Chunk.getEntitiesWithinAABBForEntity(Chunk.java:904) at net.minecraft.world.World.getEntitiesInAABBexcluding(World.java:2971) at net.minecraft.world.World.getEntitiesWithinAABBExcludingEntity(World.java:2954) at net.minecraft.world.World.getCollisionBoxes(World.java:1356) at net.minecraft.entity.Entity.move(Entity.java:706) at com.jayavery.jjmod.entities.FallingTreeBlock.onUpdate(FallingTreeBlock.java:112) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1961) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:840) at net.minecraft.world.World.updateEntity(World.java:1931) at net.minecraft.world.World.updateEntities(World.java:1747) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:621) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:720) at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:384) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) at java.lang.Thread.run(Unknown Source) My FallingTreeBlock entity class is on github: https://github.com/JayAvery/jjmod/blob/develop/src/java/com/jayavery/jjmod/entities/FallingTreeBlock.java The crash report seems to be about the most useless crash I've ever seen?? Just 'Error'? I have made some changes to the way collision boxes are calculated for my custom entity, so I'm sure that the problem is something to do with that. But I have no idea how to find out exactly what. The crash is extremely intermittent (it certainly doesn't happen every time my custom entity is spawned or moved). And the stack trace doesn't explicitly refer to any of the places where I've messed with collision boxes - it just happens in the collision box checks of the general Entity#move method. Does anyone have any ideas?
-
[deleted because I can't read properly *sigh*]
-
Removing a Vanilla Smelting Recipe [1.10]
Jay Avery replied to minecraftbigfoot's topic in Modder Support
I think all you should need to do is make a cobblestone ItemStack (instead of the stone stack you used in your initial code), and call remove using that. (I haven't specifically done this with furnace recipes, but from what I know about Maps I don't see a reason for it not to work!). -
Removing a Vanilla Smelting Recipe [1.10]
Jay Avery replied to minecraftbigfoot's topic in Modder Support
Furnace recipes are a map of input->output. The remove method removes an entry with the given key, that is, input. So if you want to remove the cobblestone->stone recipe, you need to call remove with cobblestone. -
You have unnecessary spaces in the strings defining your recipe. For it to fit in a 2x2 square, define it using 2 strings of 2 characters each, rather than 3 of 3.
- 1 reply
-
- 1
-
If you expect the list to always contain elements, step through the code where you populate the list using your debugger, to find out why it isn't being filled like you expect. If you just want to prevent a crash for cases where the list has no elements, use ArrayList#isEmpty() to check.
-
The crash is caused by calling get, a null check won't help because it happens after the method is called.
-
Well, the crash report says the ArrayList is size one, which means it did have a 0 index. But if it doesn't, that means you're trying to call it on an empty ArrayList. Post the code where you create and use the list.
-
Reading crash reports is not that much of a mystery. In line 20 of your TreeArea class, you are trying to get the 1 index of an ArrayList which only contains one element (and therefore no 1 index).
-
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
I make the blocks actually fall - I made a custom falling block entity that moves sideways as it falls, so that the blocks end up going roughly diagonally like a real tree. Here is my entity class - I've got slightly different behaviour for logs and leaves, to make sure that logs are prioritised as much as possible and fall through leaves that are in the way. -
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
A set won't give first-in-first-out order though, which is needed in this situation. It looks like there's no existing collection that has these exact properties (e.g. this conversation) - a LinkedHashSet might nearly work except the iterator can't be added to. -
You just need to replace this: Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register, with this: ModelLoader.setCustomModelResourceLocation. The method parameters are the same so the part inside the brackets doesn't need to change (except for diesieben07's point about using registry name and not unlocalised name). This line from your console log shows another problem: It's looking for a file inside an assets folder called collision, but your assets folder is called fuff. Which one is your modid? Everything should use the same ID so that assets are in the logical place.
-
This line is completely unnecessary. You create a stack with a size of 1, and then check in case it's not 1..?
-
Yous set one of the textures to an empty String. I'm not certain, but since the error is a StringIndexOutOfBoundsException at index 0, it seems likely that an empty String is the problem.
-
What is at line 330 of the mcreator_anatomy class?
-
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
Ohh, I remember now - I found out you could add elements to an iterator but I was unhappy about the cursor positioning problem which is why I went with a queue. That way, the elements which are added later are always searched later, so that guarantees that the leaves closest to the trunk will be selected first if the search gets stopped by the maximum count (rather than by reaching the edge of all leaves). I did a test with printing out my results list before using it and there don't seem to be any duplicates - I can't think of a reason that would be happening for you! You can post code! The eye icon is a spoiler, and the <> icon is for a block of code. And the monospace font is the tt button. Thanks! It backfired at first because I made the list of offsets manually and ended up missing some, so then I gave in and wrote code to print a list of all offsets so that I could copy that back into the code. -
Why? Is there a recommended approach to developing multiple mods other than installing multiple identical copies of forge?
-
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
Start by stepping through the code using the debugger to find out which variable is null at that line. Once you know that, you can work backwards to find out why it is null and then fix it. -
This tutorial explains how to set up Forge in its own workspace so that more than one mod can be linked to it.
-
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
Do you set the registry name in your block's constructor? -
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
It's a NullPointerException at line 45 of the main class - presumably that's the line with the model registration method. Post your ModBlocks class (please use code tags (the <> icon) and a spoiler (eye icon), it makes it much easier to read). Also, what are you trying to do here? this method does nothing. private static Block registerBlock(Block block) { return block; } -
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
Post your full updated code and the console log.