Jump to content

Ernio

Forge Modder
  • Posts

    2638
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Ernio

  1. In onUpdate(), I don't think you should cast Entity to EntityPlayer without instanceof (mob can be holding weapon too), unless onUpdate() works only for players (idk actually, you might wanna check). onItemRightClick's entity param is the player who rightclicked, to get the entity "hit" with rightclick you will need to raytrace him on your own. You can rayTrace on client and send packet to server that will validate "hit" (to save server's cpu) or do it directly on server. This is what you would need to know: http://jabelarminecraft.blogspot.com/p/minecraft-modding-extending-reach-of.html #getMouseOverExtended i belive.
  2. http://www.minecraftforge.net/forum/index.php/topic,26267.0.html
  3. setVelocity does NOT return EntityItem, its a void method. Learn java. 1st setVelocity, then in next line spawn entity.
  4. Construct and spawn 2 entities and simply offset one to right, one to left? What is the problem, show what you tried. More: EntityThrowable has constructor that takes player as shooter. After constructing entity with that construcor you need to get players look vector and move entity by vector orthogonal to players vector. One Entity to left, one to right.
  5. Vanilla or custom item? Vanilla: PlayerInteractEvent (might not be exact name) Custom: onItemRightClick Then - get block clicked, destroy it and blocs around it (get blocks around by manipulating position of the one clicked) and make them drop, all methods are in Block class, very self-explainatory, post what you tried for more help. Last one: what Mc version? - this is why I don't use exact naming.
  6. There are few ways to handle triggering, but you will have to make sure you won't run into infinite recursive block spawning. "starts spawning iron blocks out the side until 5 (or whatever) have been placed at which it is 'empty' and breaks into nothing" - Explain more (or is it me?). Best shot would be to make custom block which would be "base" of something (structure), then there is Block#onNeighborBlockChanged - this would allow you to detect when something is placed near block. Then you can trigger self build-up. Other way would be to use TileEntity which would build the structure in update() method in some time (in ticks). To avoid using TileEntity you can implement some system that would utilize ServerTickEvent and invoke structure building with given shape in given location over some ticks (imagine copy-pasting schematic into world). You can make block not-minable by simply setting material/harvest level. You can utilize metadata to make e.g meta = 0 - block is minable, meta = 1 - is not. I have no idea what you mean when saying this last stuff about recipes... What exacly are we talking about here?
  7. I am not the one to make 100% true statement, but I am almost sure that it's not possible without very hacky coding. Most likely ASM. I've read everything I could find about rendering blocks since 1.8 release, and never in past months stumbled upon anything that might allow to change vanilla rendering without hijacking whole system. But then again - it's just my speculations. #PostNotHelpfulAtAll
  8. It's been here for quite some time I love it (Draco was the one who introduced it right?) EDIT (posts below) Yes I know he didn't invent it, he just introduced it here
  9. See, I alredy "scanned" wiki pages for wikis that will allow me to make docs, but wiki is != web-docs. I mean - wiki would allow me to make docs, but still - on page you linked there is list about wikis, notice that there is nothing about for example Sphinx (using one example will soon make you all think that I should use it). What I am saying - that list is not really FULL list of what might help so I am asking here if anyone knows some COOL stuff to make docs
  10. This is perfect example of Sphinx https://docs.spongepowered.org/en/ I need to document mod, usage and API. As said - sphinx is out of reach since it has to be installed (python). Isn't Wikia private engine? Private = only allows you to make pages on some account? I want to HAVE website on MY hosting, not to put stuff on some virtual account.
  11. I would love to finally move all my docs to some web-docs. I am looking for some good looking web php-based free engine (you know, like there is Wordpress, and other engines that you drag-and drop to your hosting). I need something that is good and doesn't require installation (sphinx would be cool, but sadly is not an option for now). I really don't know what there is to say since I don't know yet what I am looking for - I want to place docs on my hosting. I know of or used: - MediaWiki - too much work with templates (compared to anything else - very time-consuming and requires a lot of learning to master) - GitHubWiki - I don't use git at all, I am on BitBucket (sadly or not) - Sphinx Docs - requires installation which is not an option Anyone knows of something?
  12. One question - why the heck do you need those constructors? Those 2 constructoors are internal ones that should NOT be touched. Only one you should be overriding is: /** * Creates a new world type, the ID is hidden and should not be referenced by modders. * It will automatically expand the underlying workdType array if there are no IDs left. * @param name */ public WorldType(String name) { this(getNextID(), name); } Edit: I didn't notice previous post ;o
  13. Just think dude. Entity has 2 Entity fields - riddenByEntity and riddingEntity. There is a method that is being called every tick. public void updateRiderPosition() { if (this.riddenByEntity != null) { this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); } } This is called somewhere around update methods. What you need is it inside your own MyEntity.class ass 3rd Entity field - "passenger" or something and every tick update his position. To make all smooth you will need to read some vanilla - there is a good deal going on there - don't forget NBTs, resetting states (nulling) and all that shit.
  14. What time do you have in mind? World time? - Around World, WorldServer Ticks? - Only thing you need is TickEvent
  15. Minecraft.getMinecraft().getFontRenderer() or getFontRendererObj() Or you know, if you are using some kind of GUI - 1st check if there is no ready-to-use fontRenderer or Minecraft instance reference.
  16. elix, what? You are wrong (about 1st thing) It is possible. I am assuming you are asking about loading .png file from anywhere. In that case you can implement IResourcePack that allows you to generate virtual resources with getInputStream. Once you generate resources you can put them into Minecraft#defaultResourcePacks using reflection (ReflectionObfuscationHelper). Note: getInputStream allows any input, you can probably use direct stream from Http, just make sure to use multi-threading when you are downloading files.
  17. Equipped item is NOT always an item - it can be hand, in which case the held ItemStack is == null. You need to check if getCurrentEquippedItem() is not null before getting Item. Also - not that the minecraft is supposed to be logical, but you know that pyrite and gold are two different things, unless that is a color, then "meh"? (ofc. that doesn't matter).
  18. Short: Yes Longer: Making Player move on server side only (since normally it's done also on client) might cause some laggy-movements on client, since server will be making your client player move.
  19. Well, there is not much to say about WorldTypes. You can make new class that extends WorldType and simply initialize it. public WorldType MYCUSTOM = new CustomWorldType(ID, "customName", versionInt); That is all. Note that Minecraft allows you to have 16 WorldTypes, from which few IDs are alredy taken.
  20. So dimension with everything from total base? http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571576-1-5-2-1-7-10-forge-dimension-tutorial-multi-biome There is GitHub with all code (for 1.7.10).
  21. I must say I haven't really read whole post, but I've looked at code. You are doing it wrong way. It' s better off to store direct link to entity objects and only when writing them (to NBT) to actually encode them into UUIDs. Goal: Make entity have owner, like the dog can have one. The design is quite simple: Inside your CustomEntity create field EntityPlayer owner. When player tames entity (which should happen server side), change owner to player. In some #setOwner(EntityPlayer owner) method make it send packet from server to client with entityId of entity whos owner has to be changed and entityId of player who will claim ownership. I alredy told you how to dynamically update stuff - you can do that here too. (I guess you can also use DataWatchers to update entity's owner - still using entityId of player) Now saving - NBT are only server side, same goes for UUID. UUIDs will only work and retrieve correct data on server side, and only when server is in online mode. When entity is unloaded you can get owner filed and player.getUUID(), save it to NBT as string or 2x longs (UUID.getMost/LeastSignificantBits()). Similar stuff happens in ThrownEntities, probably dogs and stuff like that. EDIT Oh and why is it better? - Never use direct player names, use UUIDs (always). - Sending one entityId is better than sending string (in both cases - nick or UUID) - I never liked DataWatchers and strongly suggest using them ONLY when value is updated a LOT, not stuff like owner.
  22. To make it more clear: When you register your renderer to MyEntity.class you have full power over rendering. You are passing entity arguments into render method - save some field inside entity (age) and use it insdie render method to e.g scale model down, or even use different model.
  23. http://www.minecraftforge.net/forum/index.php/topic,26267.0.html Check out block variants tutorial.
  24. 1st of all - you need to addPotion effect on !world.isRemote (server side). Second problem - in adding potion method you are feeding it time parameter == 1. There is this "bad design" thing there which causes potion to be automatically removed just after adding it if the time was == 1. To make effect actually happen you need to set time to 2 or more ticks. Setting it to 2+ should remove problems (also visual ones), but still - I personally don't like potion updating code. It should be feeded in for-next-tick-queue, not just randomly put there (effect might be added in different places in tick "lifespan" therefore it can be treated differently in different situations).
  25. This had to be done...
×
×
  • Create New...

Important Information

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