Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi Colour change underwater is in EntityRenderer.updateFogColor I think. -TGG
  2. Hi Just to expand a bit on what Draco said :-) There is only one blockGift ever created, regardless of how many you place in the world. And on top of that, you've declared the variables static, so even if there were many blockGifts, you would still only have one of each variable for all of those blockGifts (that's what static means). http://greyminecraftcoder.blogspot.com.au/2013/10/the-most-important-minecraft-classes_9.html http://greyminecraftcoder.blogspot.com.au/2013/07/blocks.html If you want to store information about each gift that you have put in the world, you need to use TileEntity instead. That's a little bit more complicated, but there are a few tutorials out there which can get you started, google should bring them up pretty quick. -TGG
  3. Ha well I've been modding for a few months now so I've stumbled over a few tricks by now. For the real gurus just watch DieSieben or GotoLink plus a couple of others in action sometime. When I use gist, I use Ctrl-C to copy and Ctrl-V to paste. Never tried dragging actually. -TGG
  4. I live in Australia and I'm off work sick today :-)
  5. Hi do you mean you want the existing chest to render as 2D? or the chest item to always render as 2D? Might be tricky to overwrite that for existing vanilla chest. Perhaps you could create your own chest? Some info on block and item rendering here: http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
  6. Hi There are a few links on this site that might help you with the background information. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html especially - Important classes continued, and the section on Blocks and Items. You have a few choices on how you can have a picture that you hang on the wall - you could make a transparent block with just one wall showing the object, you could have it in a picture frame like you can frame items, or you could use an entity like EntityPainting. EntityPainting is rendered in RenderPainting. The trick is that func_77010_a is turning each pixel of the texture into a little cube. The texture comes from field_110807_a which is a single file containing all the pictures. I think that's probably not what you want. ItemHangingEntity is the item used by a painting. What would I recommend? Copy ItemHangingEntity to your own class, similarly for EntityPainting. Adapt the methods to your new classes and the textures you want. Create an EntityRenderer class for your EntityPainting and add custom render methods. Register all your new classes. It's fairly complicated, this tutorial might help http://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-6-entity-part-1-registry/ and part2 as well. -TGG
  7. Hi GitHub is a way to manage all of your code for a particular project. If you just want to post a bit of code for others to look at, use a gist ("Java" is fine). Version control is a tool for you to manage changes to your code. You can keep several different "branches" of your code to try different ideas, you can roll back changes if they don't work, you can keep "release" versions of your code (eg version 1.1, version 1.2, etc) while you work on adding changes for the next version. There are a lot of version control tools around, GIT is just one of them. http://www.git-scm.com/book/en/Getting-Started-About-Version-Control The advantage of GitHub is that your project gets stored on the web, not just on your own local machine. If your hard drive dies, no problem. If you have a desktop and a laptop and swap between them, no problem. You can also have other people work on the same project as you and merge the changes later. Here's an example of a GitHub project. https://github.com/TheGreyGhost/ItemRendering It is synchronised with the code on my local machine. Anyone who is interested can download it as a zip and compile on their own machine. Re blocks not placing - yeah it's going to be a challenge. Off the top of my head I don't know what exactly is happening (someone else on this forum might...). canPlaceBlockAt should probably return true instead of you commenting it out entirely. If you post your code we can give it a crack ourselves. -TGG
  8. Hi Sounds like you've made an ambitious place to start :-) For posting code, github.com is very useful (create a "gist"). In fact, even better is to host your entire project on GitHub, if you are willing to put in a bit of time to set up git version control for your project. https://gist.github.com/ eg https://gist.github.com/TheGreyGhost/7613416 For the answers to your questions... best place is to look through BlockRedstoneWire and see which methods it is overriding. You can usually guess from the name or the comments what it does. in particular getCollisionBoundingBoxFromPool canPlaceBlockAt If your new block is supposed to interact with redstone, you should probably inherit it from one of the Redstone Blocks. You're probably in for a fair bit more frustration and trial & error before it works right... good luck :-) -TGG
  9. Hi This link might help with some of the background understanding.. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html In particular the first four topics, plus Minecraft Game Loop, plus "How Forge starts up your code", plus "Client <--> Server communication" -TGG
  10. Hi I would suggest using a Server ITickHandler to deplete the thirst at a rate depending on what the player is doing. For example - each tick check the isSprinting flag, count the number of jumps (perhaps StatList? see EntityPlayer.jump()), or alternatively you could look at EntityPlayerSP.movementInput to see what keys the player is pressing / is jumping. Should be plenty of options... -TGG
  11. Hi Yeah it's always easy once you know the answer! :-) I pulled that from some of my own code, not sure where I got it from originally. Forge is a bit like that sometimes. Half the problem is finding the stuff that you don't even know should be there. -TGG
  12. Hi Is there any particular reason that your writeEntityToNBT doesn't add most of your member variables to the NBT (compared with readEntityFromNBT)? Perhaps part of the problem is that you are creating your entity on the server side, but the client side copy is not getting all your extra information because it's not being transmitted in the spawn packet. That's where GotoLink's suggestion comes in, because Forge transmits extra information about your entities from server to client if you use IEntityAdditionalSpawnData. public class EntityBanker extends EntityAnimal implements IEntityAdditionalSpawnData Never used it myself. Entity already has a flag called Entity.invulnerable which might be what you are looking for. -TGG
  13. Hi Is this what you mean? http://www.minecraftforge.net/wiki/Forge_Development_in_IntelliJ_IDEA (see "Set up run & debug configurations") -TGG
  14. Hi You need to add this method to your TickHandler to tell it that you want SERVER ticks public EnumSet<TickType> ticks() { return EnumSet.of(TickType.SERVER); } It's probably a good idea to add a check of the type to your tickStart as well, in case you want to add other ticks later', eg tickStart: if (!type.contains(TickType.SERVER)) return; -TGG
  15. Hi Thanks EP :-) // Im not quite sure why you only would want this to get done on the server side // Since we need the visual as well? I think the vanilla code does that because changing the block and dropping the item on the server automatically syncs with the clients, so it's not necessary to do it on the client as well. Sometimes it is important to do something on the server only, otherwise you get "ghost" items on the client, but in this case I think the setBlock and Drop methods check for that. So I reckon it would probably work fine either way. -TGG
  16. No worries, glad I could help :-)
  17. Hi 51 MB is not so much. But maybe your algorithm can be more efficient and not need so many anyway. What are you trying to do? -TGG
  18. Hi The arrow hits yourself when you try to shoot it? In EntityWoodArrow.onUpdate, this code should prevent that List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); // ..etc .. for (l = 0; l < list.size(); ++l) { Entity entity1 = (Entity)list.get(l); if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) i.e. entity1 != this.ShootingEntity when entity1 is your player, and it matches the ShootingEntity (which is your player). Your player should be immune from being hit for 5 ticks. Set a breakpoint just after that line, and see which part is not matching properly? -TGG
  19. Hi Stopping the animation while the game is paused is a bit trickier. You would need to run your own "clock" to replace the System.currentTimeMillis(), by subscribing to onPreClientTick, checking Minecraft.isGamePaused, and updating your clock (20 times per second), then reading the value of this clock in your renderer. To be honest that's moderately advanced stuff and probably not worth the effort? Does it really matter if the animation keeps going while the game is paused? Re the smooth animation- if you post what you tried we can give you some more guidance. -TGG
  20. Hi Indeed they do. I don't use Eclipse myself, but if the breakpoint is not working I'd suspect either one of your project settings is wrong or you're not running the code in debug mode. But that's a pure guess. With any luck, one of the gurus on this forum will be able to help.... -TGG
  21. Hi Hmmm you're starting to get into areas that I don't know much about. The only clue I might give is that Forge has a couple of events related to World saving and loading that might let you access the world object at the right time, if you subscribe to them, perhaps you can store your "immune to hardcore" variable somewhere else other than the WorldInfo (say - in your own config file), and copy it to/from the WorldInfo in the appropriate events. Might also make your mod more compatible with other mods. eg see WorldEvent.Load I don't really understand which of the WorldInfo constructors does what, sorry! -TGG
  22. Hi Aieeee no breakpoints!!! That will be very annoying. You could first confirm the problem: public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { IntCache.resetIntCache(); if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { par1ArrayOfFloat = new float[par4 * par5]; } System.out.println("this.myBiomeIndexLayer is null :" + (this.myBiomeIndexLayer == null)); int[] aint = this.myBiomeIndexLayer.getInts(par2, par3, par4, par5); and public WorldChunkManagerEnder(long seed, WorldType worldtype) { this(); GenLayer[] agenlayer = GenLayerEnder.makeTheWorld(seed); agenlayer = getModdedBiomeGenerators(worldtype, seed, agenlayer); this.myGenBiomes = agenlayer[0]; this.myBiomeIndexLayer = agenlayer[1]; System.out.println("this.myBiomeIndexLayer is null :" +( this.myBiomeIndexLayer == null)); } If those are both null, then you'll need to work your way back up the chain one piece at a time until you find out why. eg why does getModdedBiomeGenerators return null for the second agenlayer? etc. Without breakpoints it will probably get tedious. -TGG
  23. Hi It's not difficult. BlockLeaves does something similar if the leaves are unsupported. in updateTick: if (!par1World.isRemote) --> this.removeLeaves this.removeLeaves: this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockToAir(par2, par3, par4); And also need to set this.setTickRandomly(true); in the constructor, so that updateTick gets called occasionally. -TGG
  24. Hi Here is the basic idea of an AABB in two dimensions. http://www.gamefromscratch.com/post/2012/11/26/GameDev-math-recipes-Collision-detection-using-an-axis-aligned-bounding-box.aspx Minecraft AABB is in three dimensions of course. You can create one of your own using myAABB = AxisAlignedBB.getAABBPool().getAABB(minX, minY, minZ, maxX, maxY, maxZ); It only lasts a short time (until the next tick) but for collision checking that's all you need. Alternatively if you want the AABB for a particular block, you can use myAABB = BLock.getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) and you can move it or make is bigger using eg myAABB.offset(dx, dy, dz) or myAABB.expand(dx, dy, dz) -TGG
  25. Hi looks like myBiomeIndexLayer is probably null. GenLayer[] agenlayer = GenLayerEnder.makeTheWorld(seed); agenlayer = getModdedBiomeGenerators(worldtype, seed, agenlayer); this.myGenBiomes = agenlayer[0]; this.myBiomeIndexLayer = agenlayer[1]; Have you checked that this code is returning what you expect? -TGG
×
×
  • Create New...

Important Information

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