at ForgottenNature.Items.ItemNetherLogs.func_77667_c(ItemNetherLogs.java:31)
at net.minecraft.item.Item.func_77657_g(Item.java:547)
at net.minecraft.item.Item.func_77653_i(Item.java:636)
at net.minecraft.item.ItemStack.func_82833_r(ItemStack.java:427)
at net.minecraftforge.client.GuiIngameForge.renderToolHightlight(GuiIngameForge.java:583)
at net.minecraftforge.client.GuiIngameForge.func_73830_a(GuiIngameForge.java:154)
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1038)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001)
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 ForgottenNature.Items.ItemNetherLogs.func_77667_c(ItemNetherLogs.java:31)
at net.minecraft.item.Item.func_77657_g(Item.java:547)
at net.minecraft.item.Item.func_77653_i(Item.java:636)
at net.minecraft.item.ItemStack.func_82833_r(ItemStack.java:427)
at net.minecraftforge.client.GuiIngameForge.renderToolHightlight(GuiIngameForge.java:583)
at net.minecraftforge.client.GuiIngameForge.func_73830_a(GuiIngameForge.java:154)
Also, Nightshade, I can only deduce this to be on your end. Logs that are rotated out of their normal orientation are dropping as "Oak Log" with their orientation intact in item form. These logs cannot be used for crafting, and have to be replaced in upright orientation to be usable.
I know that maybe sounds a bit weird, but do you still have versions of LCTrees for MC 1.2.5 somewhere on your HDD? The mod topic sadly just has the 1.3.2 version. Or didn't I remember correctly and there never was a 1.2.5 version? Also the dropbox link to the 1.4.7 version (ForgottenNature 1.2.2) is broken. I am currently reassembling old server worlds and try to get the mods. ForgottenNature is the last on my list, so it would be awesome if you can help out
Sorry Jhary,
I only have one version which is the only one linked on the LCTrees OP.
Nightshade is back? Where have I been? Will be nice having the mod back, since the EBXL Team said they were going to integrate it back in 1.4 but that never happened.
I would've shown up sooner but i only saw it in the patch notes of RTG
reading over this error again i wonder if it had to do with a hungry node spawning in that specific biome and it makes me wonder if sinster nodes from thaumcraft are incompatable with something in FN. -shrug- this is beyond me and i have no idea why thaumcraft nodes would cause a crash from conflicting with FN's drop events.
i would report this to the owner of thaumcraft as well if anyone else has this issue too.
Have you used the latest version of FN? It's been updated. If so, is it the same crash report error?
BTW, I found that it wasn't a drop event bug. It's a bug with a log block breaking with no player nearby. It shouldn't be doing that any longer.
Hmmm. Well I want it to generate exclusively in my biome. With my code now Its not generating anywhere at all. I feel like an idiot...
It will generate exclusively in your biome. You only need to use something like if(biomeID == mybiome) then call your generator. Here's an example from my mod (note that I changed my generator calls to your generator):
package ForgottenNature.WorldGen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
import ForgottenNature.ForgottenNature;
import cpw.mods.fml.common.IWorldGenerator;
public class FNWorldGenerator implements IWorldGenerator
{
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
int i = chunkX*16;
int j = chunkZ*16;
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, j);
if ((biome.biomeID == 1))//plains biome has ID of 1. You would want to put your biome ID here
{
if (random.nextInt(7) == 0)//Changing the random value will change how common the bushes are in game.
{
WorldGenerator bushes= new YummyWorldGeneratorStrawberryBushes(yourbushblock);
bushes.generate(world, random, 0, 0, 0);
}
}
}
}
In this case, I would register FNWorldGenerator: GameRegistry.registerWorldGenerator(new FNWorldGenerator(), 3); And I would not call .generate in the biome class. As your world generates, Mincraft will call this WorldGenerator and will only call your bush generator if the biome ID matches whatever ID you place in the 'if' statement.
This would be a new class for you to make. Just register this class. Minecraft will generate your biome, then call this generator, then call your bush generator from this WorldGenerator class.
---I forgot to correct one of my earlier posts:
int i1 = random.nextInt(8) - random.nextInt(8);
int k1 = world.getHeightValue(i1, j1); random.nextInt(4); //k1 is not your height variable
int j1 = random.nextInt(4) world.getHeightValue(i1, k1); //j1 is your height variable
I did that initially (except for the NBT bit, I need to do more research on that) however the metadata also controls the rotation of the block. For instance, when the block is facing east, the metadata is say 3. I always believed you can only use the metadata for one thing at a time such as defining a texture, sub-block, or a rotation. Correct me if I'm wrong about this I still have a lot to learn.
Cheers!
Yes, each metadata value can only represent one state. And that state can represent any one combination of sub-states - including texture, rotation and whatever other state you can think of.
Essentially, each combination of data you store inside a tile entity has its own metadata value. It just depends on what you call it (or them). Also, it's not limited to 16 states. It's more like 32,768 states, so if you just want to go off an integer value, you can define your metadata for all your standard states (not powered), then define the same number of metadata for all the powered states. You can use getBlockPowerInput like Ferdz said to do this. Just make sure you save the metadata in your TE class correctly:
public void writeToNBT(NBTTagCompound NBTTC)
{
super.writeToNBT(NBTTC);
NBTTC.setInteger("Data", this.blockMetadata);
}
public void readFromNBT(NBTTagCompound NBTTC)
{
super.readFromNBT(NBTTC);
this.blockMetadata = NBTTC.getInteger("Data");
}
.blockMetadata is build into Mincraft, so there's no variable declaration needed to save metadata. The reason why you need to save it is becuase Minecraft truncates block states down to 4 bits (aka 16 states / bit combinations) when you exit the game unless you save it using what we're all talking about.
Also, keep in mind that whenever you want to get the metadata of your block, don't use world.getBlockMetadata because that is truncated as well. Use the tile entity: world.getTileEntity(i, j, k).blockMetadata;
As far as setting the metadata is concerned, it's still safe to use the same method(s): world.setBlock(i, j, k, block, metadata, 3);
The reason why metadata isn't used like this by some modders is because it's not as elegant and it may require some extra lines of code.
The 3 is the weight I decided to put on my world generator. Higher weights lower the priority of execution. Note that a registered world generator doesn't need to be called by your code, i.e. registering it causes minecraft to call it upon world generation.
--Just as food for thought, you can create a main world generator class that calls all your individual generators (trees, bushes, flower placement, etc...). That way, you'll only need to register one generator AND you wouldn't have to call any generators from your biome class. I'm not sure if I've ever got it to work the way you're trying to do it (calling the world generator from your biome class).
Anyway, why not just use one of the 0-15 metadata values as both a state and an indicator of your state?
Unless there's something I don't know, you should be able to just set the metadata of the block to 1 when there's a powered block/entity next to it, then just use that metadata for your changing textures as well.
If you want to use a boatload of textures or states, just save the "extended metadata" using readtonbt and writetonbt.
---Of course this is assuming I know what you all are talking about.
Just find out what metadata value indicates the final growth stage, then detect that value. As of now, there is no method I know of that can search metadata values for blocks such that you could find the last viable value for any particular block (or crop in your case).
I'm getting a cannot be resolved to a variable error on temp x y and z.
@Override
public void decorate(World world, Random rand, int chunkX, int chunkZ)
{
super.decorate(world, rand, chunkX, chunkZ);
WorldGenerator strawberryBushGen = new YummyWorldGeneratorStrawberryBushes(topBlock);
for (int l = 0; l < 64; ++l)
{
strawberryBushGen.generate(world, rand, tempX, tempY, tempZ);
}
}
Looks like you didn't declare a tempX, tempY or tempZ. All your inputs into .generate() needs to be declared somewhere. You're using 'world' and 'rand' from the parent function, but your coordinate integers have not been declared.
You have two options:
1) Declare each one like you did inside your bush generator class:
int i1 = x + random.nextInt(8) - random.nextInt(8);
int j1 = y + random.nextInt(4) - random.nextInt(4);
int k1 = z + random.nextInt(8) - random.nextInt(8);
2) Don't declare them at all... you are already using random numbers to place your bushes, so you can just pass 0s into your .generate() function:
strawberryBushGen.generate(world, rand, 0, 0, 0);
But if you do that, you might as well change your constructor to omit the coordinates all together:
public class YummyWorldGeneratorStrawberryBushes extends WorldGenerator
{
private Block StrawberryBush;
private int field_150551_b;
public YummyWorldGeneratorStrawberryBushes(Block block)
{
this.StrawberryBush = YummyBlocks.StrawberryBush;
}
public void func_150550_a(Block block, int meta)
{
this.StrawberryBush = block;
this.field_150551_b = meta;
}
public boolean generate(World world, Random random, int x, int y, int z)
{
for (int l = 0; l < 64; ++l)
{
int i1 = x + random.nextInt(8) - random.nextInt(8);
int j1 = y + random.nextInt(4) - random.nextInt(4); int k1 = z + random.nextInt(8) - random.nextInt(8)//This is the height that your bush will generate at. Don't make this a random number, instead use the height of the top (surface) block on the (i1,j1) location:
int k1 = world.getHeightValue(i1, j1);
@Override
public void decorate(World world, Random rand, int chunkX, int chunkZ)
{
super.decorate(world, rand, chunkX, chunkZ);
WorldGenerator strawberryBushGen = new YummyWorldGeneratorStrawberryBushes(topBlock);
for (int l = 0; l < 64; ++l)
{
java.lang.NullPointerException: Ticking block entity
at ForgottenNature.Handlers.BreakBlockHandler.harvestBlock(BreakBlockHandler.java:70)
at ForgottenNature.Handlers.BreakBlockHandler.onEvent(BreakBlockHandler.java:58)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_970_BreakBlockHandler_onEvent_HarvestDropsEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:155)
at net.minecraft.block.Block.func_149690_a(Block.java:656)
at net.minecraft.block.Block.func_149697_b(Block.java:648)
at net.minecraft.world.World.func_147480_a(World.java:591)
at thaumcraft.common.tiles.TileNode.handleHungryNodeSecond(TileNode.java:933)
at thaumcraft.common.tiles.TileNode.func_145845_h(TileNode.java:123)
at net.minecraft.world.World.func_72939_s(World.java:1939)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:489)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:186)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at ForgottenNature.Handlers.BreakBlockHandler.harvestBlock(BreakBlockHandler.java:70)
at ForgottenNature.Handlers.BreakBlockHandler.onEvent(BreakBlockHandler.java:58)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_970_BreakBlockHandler_onEvent_HarvestDropsEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:155)
at net.minecraft.block.Block.func_149690_a(Block.java:656)
at net.minecraft.block.Block.func_149697_b(Block.java:648)
at net.minecraft.world.World.func_147480_a(World.java:591)
at thaumcraft.common.tiles.TileNode.handleHungryNodeSecond(TileNode.java:933)
at thaumcraft.common.tiles.TileNode.func_145845_h(TileNode.java:123)
-- Block entity being ticked --
Details:
Name: TileNode // thaumcraft.common.tiles.TileNode
Block type: ID #482 (tile.blockAiry // thaumcraft.common.blocks.BlockAiry)
Block data value: 0 / 0x0 / 0b0000
Block location: World: (-986,93,-744), Chunk: (at 6,5,8 in -62,-47; contains blocks -992,0,-752 to -977,255,-737), Region: (-2,-2; contains chunks -64,-64 to -33,-33, blocks -1024,0,-1024 to -513,255,-513)
Actual block type: ID #482 (tile.blockAiry // thaumcraft.common.blocks.BlockAiry)
Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
at net.minecraft.world.World.func_72939_s(World.java:1939)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:489)
-- Affected level --
Details:
Level name: ;kjasdrghk;adfhdgkjwrf
All players: 1 total; [GCEntityPlayerMP['TheLordofNyrin'/291, l=';kjasdrghk;adfhdgkjwrf', x=-1122.81, y=90.52, z=-846.83]]
Chunk stats: ServerChunkCache: 887 Drop: 0
Level seed: -4957618522713692298
Level generator: ID 00 - default, ver 1. Features enabled: true
Level generator options:
Level spawn location: World: (-90,64,116), Chunk: (at 6,4,4 in -6,7; contains blocks -96,0,112 to -81,255,127), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 13359 game time, 13359 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 127775 (now: false), thunder time: 74933 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:186)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
No idea whats causing it but from the error it sounded like an issue with either FN or thaumcraft or both. no idea how to fix this. This happened twice in a cherry blossom biome, both at random times.
FN modifies the drop events of stone and sandstone. If Thaum craft does this as well, that may be a problem. Shouldn't be localized to a specific biome though... I'll take a look later this evening.
0
uh oh, that's game-breaking x_x
Ok, working on it.
0
Not that I know of.
0
oh.... derp. Yea, I'll have to fix that one.
1
Sorry Jhary,
I only have one version which is the only one linked on the LCTrees OP.
0
Oh... I assumed they implemented it. O_o
0
Have you used the latest version of FN? It's been updated. If so, is it the same crash report error?
BTW, I found that it wasn't a drop event bug. It's a bug with a log block breaking with no player nearby. It shouldn't be doing that any longer.
0
Are you registering the WorldGenerator somewhere? --like in your main mod class?
0
It will generate exclusively in your biome. You only need to use something like if(biomeID == mybiome) then call your generator. Here's an example from my mod (note that I changed my generator calls to your generator):
In this case, I would register FNWorldGenerator: GameRegistry.registerWorldGenerator(new FNWorldGenerator(), 3); And I would not call .generate in the biome class. As your world generates, Mincraft will call this WorldGenerator and will only call your bush generator if the biome ID matches whatever ID you place in the 'if' statement.
This would be a new class for you to make. Just register this class. Minecraft will generate your biome, then call this generator, then call your bush generator from this WorldGenerator class.
---I forgot to correct one of my earlier posts:
0
Yes, each metadata value can only represent one state. And that state can represent any one combination of sub-states - including texture, rotation and whatever other state you can think of.
Essentially, each combination of data you store inside a tile entity has its own metadata value. It just depends on what you call it (or them). Also, it's not limited to 16 states. It's more like 32,768 states, so if you just want to go off an integer value, you can define your metadata for all your standard states (not powered), then define the same number of metadata for all the powered states. You can use getBlockPowerInput like Ferdz said to do this. Just make sure you save the metadata in your TE class correctly:
.blockMetadata is build into Mincraft, so there's no variable declaration needed to save metadata. The reason why you need to save it is becuase Minecraft truncates block states down to 4 bits (aka 16 states / bit combinations) when you exit the game unless you save it using what we're all talking about.
Also, keep in mind that whenever you want to get the metadata of your block, don't use world.getBlockMetadata because that is truncated as well. Use the tile entity: world.getTileEntity(i, j, k).blockMetadata;
As far as setting the metadata is concerned, it's still safe to use the same method(s): world.setBlock(i, j, k, block, metadata, 3);
The reason why metadata isn't used like this by some modders is because it's not as elegant and it may require some extra lines of code.
0
use this:
GameRegistry.registerWorldGenerator(new yourWorldGenerator(), 3);
The 3 is the weight I decided to put on my world generator. Higher weights lower the priority of execution. Note that a registered world generator doesn't need to be called by your code, i.e. registering it causes minecraft to call it upon world generation.
--Just as food for thought, you can create a main world generator class that calls all your individual generators (trees, bushes, flower placement, etc...). That way, you'll only need to register one generator AND you wouldn't have to call any generators from your biome class. I'm not sure if I've ever got it to work the way you're trying to do it (calling the world generator from your biome class).
0
Odd...
Anyway, why not just use one of the 0-15 metadata values as both a state and an indicator of your state?
Unless there's something I don't know, you should be able to just set the metadata of the block to 1 when there's a powered block/entity next to it, then just use that metadata for your changing textures as well.
If you want to use a boatload of textures or states, just save the "extended metadata" using readtonbt and writetonbt.
---Of course this is assuming I know what you all are talking about.
0
Just find out what metadata value indicates the final growth stage, then detect that value. As of now, there is no method I know of that can search metadata values for blocks such that you could find the last viable value for any particular block (or crop in your case).
0
Looks like you didn't declare a tempX, tempY or tempZ. All your inputs into .generate() needs to be declared somewhere. You're using 'world' and 'rand' from the parent function, but your coordinate integers have not been declared.
You have two options:
1) Declare each one like you did inside your bush generator class:
2) Don't declare them at all... you are already using random numbers to place your bushes, so you can just pass 0s into your .generate() function:
But if you do that, you might as well change your constructor to omit the coordinates all together:
public boolean generate(World world, Random random,
int x, int y, int z){
for (int l = 0; l < 64; ++l)
{
int i1 =
x +random.nextInt(8) - random.nextInt(8);int j1 =
y +random.nextInt(4) - random.nextInt(4);int k1 = z + random.nextInt(8) - random.nextInt(8)//This is the height that your bush will generate at. Don't make this a random number, instead use the height of the top (surface) block on the (i1,j1) location:int k1 = world.getHeightValue(i1, j1);
strawberryBushGen.generate(world, rand
, tempX, tempY, tempZ);If that doesn't work, just stick with passing 0s to .generate().
-Can be challenging to edit posts sometimes...
______________________________________________________________________________________________
0
Updated.
Added a couple things, but also fixed the last few bugs that were mentioned.
Check the change log for details.
-Edit: Forgot to mention that I fixed the link to the 64x64 textures. Didn't notice that until today...
0
FN modifies the drop events of stone and sandstone. If Thaum craft does this as well, that may be a problem. Shouldn't be localized to a specific biome though... I'll take a look later this evening.