
TheMoleTractor
Members-
Posts
53 -
Joined
-
Last visited
Everything posted by TheMoleTractor
-
[1.6.4] Crash when spawning in Custom Biome
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I am fairly certain they are but I will link a pastebin to my Base class (where I register everything). Base File: http://pastebin.com/GJr0jrM1 A sort of long file that houses all registration and what-not. Around line 700 the block registration starts (if there are line numbers in that link that is...) and after blocks I register my biome. I tried moving my registrations to my Pre Init, but had no different in my error (it seems to be giving different tracebacks each time though). -
[1.6.4] Crash when spawning in Custom Biome
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
So I figured out what is causing the issue but why is it causing it is beyond me. If I comment out this.topBlock = (byte)Base.blockInfectedGrass.blockID; this.fillerBlock = (byte)Base.blockInfectedDirt.blockID; I get rid of the problem and the biome spawns without any problems. If the two lines above are incorrect slightly, it's because I manually wrote them as my laptop running eclipse is low on battery (that's what I get for not charging it) The block ids are 250 (BlockInfectedGrass) and 251 (BlockInfectedDirt) so their ids are not the issue here. Somewhere while generating the world and biome with these two blocks as the top/filler blocks I am getting a null pointer. Why? I'd prefer stubbing my toe over dealing with a null pointer exception. Any ideas anybody? -
[1.6.4] Crash when spawning in Custom Biome
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I knew that biome top/filler blocks were not allowed above 255, I believe it is 255 and lower because Java starts the counting at 0, 0-255 is that range of 256 ids still though. I haven't had my trees gen regularly in the overworld regularly yet (I need to do some digging because I am pretty sure they should NOT be generating in the first place lol), maybe that is what is crashing. I'll test a bit and see what I can come up with. -
[1.6.4] Crash when spawning in Custom Biome
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
Alright, I checked everything and I am positive all the blocks are initialized and I tried to run it again (having made no changes) and I get a different report. Report: http://pastebin.com/KA3vBuz8 Exception getting block type in world. I am not sure what exactly that points to considering I have declared a type and have had no problem with bonemealing my saplings into full trees with wondrous results. Something with my WorldGenInfectedTree file has the world gen angry but I don't know what. -
Hello! I have been working on a custom biome. I edited the WorldChunkManager.java (a vanilla MC file) temporarily so find my biome easier (not sure if this was relevant to my issue or not so I decided to mention it anyways) public static ArrayList<BiomeGenBase> allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(Base.blight)); I have no errors starting up but am getting a crash when I make a new world (link to full report below). It's a NullPointerException and none of the traceback passes through any of my files so I do not even know where to begin.. Any help is greatly appreciated! Full Crash Report: http://pastebin.com/qGPA80Lr
-
Hello fellow modders! I am trying to make a mob jump when I hit the space bar, somewhat like how horses jump when the space bar is held, but I just wanted a simple "If I hit the space bar! I jump up one block!" I've scoured the EntityHorse code to see where the game detects you trying to jump while mounted but have had no luck. Can anyone point me to where I may find such code?
-
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
NOTE: Sorry, I am new to the forums. I'll be a little more sparse with quoting. Ok so I got it partially working, I had the staff check for the TileEntitySapphireCrop, if found, it calls a setStaffFound() inside the TileEntity and sends true. On the other end, the BlockSapphireCrop, in the updateTick() I have a call to a getStaffFound() function where the "if staff is found" boolean variable is stored. The BlockStaff has updateTick() with this in it: public void updateTick(World world, int x, int y, int z, Random rand) { //Checks for grow-able crops in the area for(int j = -5; j <= 5; j++) { for(int k = -5; k <= 5; k++) { TileEntity te = world.getBlockTileEntity(x + j, y, z + k); if(te != null) { if(te instanceof TileEntitySapphireCrop) { ((TileEntitySapphireCrop)te).setStaffFound(true); } } } } } It seemed to work some but not others. I know it is checking the correct area (I did a world.setBlock with the same for loops to be sure) but I have a check in the updateTick() of my BlockSapphireCrop that prints a message if the staff is not found and it appears to be not seeing some of the crops. EDIT: So what I think is happening (after a bit more testing) is that the crop is ticking before the staff has ticked and found the crop to notify the tile entity that it should grow. Not a huge problem because it just slows down the initial growth process which is ok. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I do want other crops to work with this as well, but I should be able to use an or operator within the onBlockAdded. This would also require a call to the BlockCropStaff class from my updateTick() method in BlockSapphireCrop , correct? -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
Sorry, I'm tired and have not had my coffee yet. Essentially I have a plant that I want to grow if there is a certain block in a certain radius. And only grow if that criteria is met. My specific example is I want to check around my BlockSapphireCrop for a BlockCropStaff in a radius anywhere from 1-5 blocks away. Is onNeighborBlockChange() called when the block is placed? Or only when a neighboring block changes. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
Yea I knew it seemed unnecessary. Does onNeighborBlockChange() check often? Say if the block/tile entity I am looking for it already there? I'll toss in a while(!staffFound) around it and hope that helps. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
So as it turns out...I am not sure if this the best way to do but it seems to have worked. I did some enticing research into Packets (I still have some understanding to do...but I'm well on my way) but ultimately found a forge tut (http://www.minecraftforge.net/wiki/Synchronizing_tile_entities for this interested) that mentioned a certain line of code: world.markBlockForUpdate(x, y, z); Putting this at the end of my updateTick() for growing updates the texture. No need for packets? Humph. Any thoughts? EDIT: Also, on an end note...I am have horrid lag issues (Java space heaps) in the updateTick() method when I try to search for a certain block in a given radius. for(int i = 0; i <= 5; i++) { for(int j = 0; j <= 5; i++) { if(world.getBlockId(x + i, y, z + j) == Base.blockPhotoStick.blockID) staffFound = true; if(world.getBlockId(x + i, y, z - j) == Base.blockPhotoStick.blockID) staffFound = true; if(world.getBlockId(x - i, y, z + j) == Base.blockPhotoStick.blockID) staffFound = true; if(world.getBlockId(x - i, y, z - j) == Base.blockPhotoStick.blockID) staffFound = true; } } if(!staffFound) return; I am sure this entirely inefficient... -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
Yea I am doing this with a buddy (he is texturing and modeling) and he wants to get it up and running before we update to 1.7... So for now we are 1.6.4... I shall scour the internet for tutorials. I'm not worried about finding some good ones. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I'll work on a packet tomorrow and see if that works. I took a look at the SimpleNetworkWrapper in the tutorials and tried making a class that implemented IMessage and another that implemented IMessageHandler, neither of which were classed that existed and I could use. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
So I have it where the server is incrementing when it "grows" but the visuals are not updating. Is there any viable way to sync it in the updateTick method in the Block class? -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I actually got it to sync on start-up. In my TileEntity class I have added these two methods: public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) { NBTTagCompound tag = pkt.data; readFromNBT(tag); } public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); return new Packet132TileEntityData(xCoord, yCoord, zCoord, blockMetadata, tag); } While I am sure there are better ways to do this, this seemed to work. One unfortunate thing (I seem to be hitting every possible snag trying to finish this crop up) is that now when the crop grows in game (using the blocks updateTick) the texture again doesn't update right away. Again an issue with syncing. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I'll check them out now, thanks for the nod in the right direction. Packets here I come! @MoxEmerald: Yes, the client side with onBlockActivated was giving the incorrect number while the server call was correct. I'll post in a bit once I get some work done. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
So with that, my onBlockActivated method calls both client and server. The render class only calls client. I am thinking now that the client and server and not syncing, unfortunately that is untreaded water for me so I don't know how to sync the two. The second before I posted this Kwibble kindly pointed out it was obviously a syncing issue. Time to look into packets! I'll keep this open and post when I figure it out. Thanks again everyone for the help! Wish me luck on figuring out packets. If anybody has any suggestions they would be greatly appreciated. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
A System.out.println(bAmt); right before the switch spams the console (quite a bit haha) with the amount showing visually (of course) but if the game has, say...3 berries, and I log out and back in, the println before the switch still spams the amount of berries showing up but when I use my other println (called from the Block class on blockActivated) it shows the amount that is held rather than the amount shown. This leads me to believe my call to the TileEntitySapphireCrop.getBerryAmount(); method is not calling correctly. I can add and take away berries which makes the texture change, changing what output I have inside the Render class. This also changes the amount of berries actually held (but not shown correctly). These amounts don't beyond 0-7 for either of the rendering or block classes. -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
Render class: http://pastebin.com/kZJw9WLM This is my render class. Is calling the same method my block class calls the issue? Would calling the bAmt from the block be any different? The berry amount can go from 0-7 -
[1.6.4] Tile Entity NBT not saving on exit
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I tossed a println in there for the bAmt and it printed out the correct number in the console. I restarted the client and it seems to be saving the amount but not updating the texture when the world is re-loaded. EDIT: Forgot to mention that the println was inside an if(!world.isRemote) -
Title says most of it...to expand on it: I have a block that sets down a bush with berries on it (it is a TESR) that can be sheared to drop berries. I put read/write to NBT in the TileEntity class (linked below) but it isn't working. Any ideas? Tile Entity class: http://pastebin.com/3fWdLqLf Thanks!
-
[SOLVED] TESR's Acting as One instead of Individually
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I'll keep that in mind in case it ever comes up again in my modding ventures. Thanks again! Topic Solved! -
[SOLVED] TESR's Acting as One instead of Individually
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I changed it all and it works perfectly! Thanks so much! I'm linking the code just...because. I still have to write the NBT reading/writing because upon exiting the game and returning, all the crops go back to fully grown, but I am sure I can figure that out myself. One quick question: A weird problem I had before (not an issue anymore due to the change in code) was when I sheared it or placed a berry onto the crop (calling the onBlockActivated method), my bAmt++; seemed to be called two times which is why I had the 14 (now 7 again, thank goodness...such a smaller switch in my render class). Is there any reason it acted twice? Working classes (minus the NBT reading + writing): Block class: http://pastebin.com/Y663XY27 Render class: http://pastebin.com/kUvEUUYe TileEntity class: http://pastebin.com/X8rWKtsH (didn't change from before) -
[SOLVED] TESR's Acting as One instead of Individually
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
Whoops, sorry. There are a couple syntax errors now, I'm trying to figure out how to call the TileEntity methods to get and set the berry amount while they do not have static modifiers. Block class: http://pastebin.com/cufSaHqk Render class: http://pastebin.com/f2F7LFXd TileEntity class: http://pastebin.com/zavQkdQj I am not sure what to do with the TileEntity class. -
[SOLVED] TESR's Acting as One instead of Individually
TheMoleTractor replied to TheMoleTractor's topic in Modder Support
I put the declaration and the get/set functions in the TileEntitySapphireCrop.class, have no problem finding it with the "world.getBlockTileEntity(x, y, z);", but am a tad bit perplexed on how to call my get function, as it requests a static operator to call it.