Jump to content

Ernio

Forge Modder
  • Posts

    2638
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Ernio

  1. Latest Forge 1404. I have custom inventory with custom armour parts (like pauldrons or gauntlets). I need to make renderer for it - how do I do it for player and how do I do it for other ModelBiped - zombies/skeletons. Questions: - How to (best practice, what is needed and where to look)? - What do/should I use - what can be done using what (e.g - are .obj supported, are there helpers for them, loaders)? - What is supported? (exacly what models can I use) - What will be supported? (eventually) Any helpful info/links/repos would be nice. Other: - Can item be rendered using non-json model? E.g render breastplate in a way they are rendered on player? - Is it possible to do same as above, but in inventory slots?
  2. Are you sure the value is not set? Note that only server loads NBT, the client has to synchronized separately.
  3. Few things: 1. Why are you using IEEP when you have your own Entity class - there is ONLY ONE explanation that is good enough to do that and that is - compatibility between all entities on server. - Followin above - you can save fields inside entity, IEEP is mandatory and rather used for vanilla mobs. 2. When using IEEP - you sure you are registering it?
  4. http://www.minecraftforge.net/forum/index.php/topic,26267.0.html
  5. http://4.bp.blogspot.com/_D_Z-D2tzi14/S8TRIo4br3I/AAAAAAAACv4/Zh7_GcMlRKo/s1600/ALOT.png[/img] http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html Had to be done.
  6. http://minecraft.gamepedia.com/Models Maybe this?
  7. When exacly is this called? I've been making code overwiew and noticed this is never called. Structure: ExtendedInventory implements IInventory ExtendedInventoryContainer extends Container ExtendedInventorySlot extends Slot IInventory size is 11. Container has 11 slots (all use ExtendedInventorySlot) ExtendedInventorySlot has 2 methods: public boolean isItemValid(ItemStack stack) public boolean canTakeStack(EntityPlayer player) Both of these methods work, on server and on client, they check everything nicely. I can't find ANY situation in which IInventory#isItemValidForSlot is called. Tried to look at callback but that is not helpful. From what I am looking at: - I assume that IInventory#isItemValidForSlot should be used if you want to access IInventory slots without container and is not called anywhere directly by vanilla, but left for custom usage (by mod itself) - only Hopper (tileentity) seems to use it. Is that correct? EDIT If anyone's wondering - I am asking because normally when you put a method in an interface (IInventory) it is being used internally (by vanilla), in this case I am confused because it looks like it's not.
  8. Loading NBT happens after constructor, therefore if you are loading boolean and putting it into dataWatcher after initialization of entity, I don't really see posibility. Post code. I am out for today (~7 hours), so don't wait
  9. The mystery of your double-thank-you is bothering me till this day! (http://www.minecraftforge.net/forum/index.php/topic,30222.msg156872.html#msg156872)
  10. There are two sides (threads) running: Logical CLIENT and logical SERVER. On Client.jar there are both running (the client has an integrated server in background) therefore accessing it won't crash. On Server.jar (dedic) there is only SERVER logical side - classes like Minecraft or any other client class are simply not there - it will crash. You cannot have any client-class reference in class used by server. That is why you use Proxies. As to TickEvents: There are 5 tick events. SERVER, CLIENT, WORLD, PLAYER and RENDER. Server runs only on server thread, client and render on client. Player tick runs on both (that means that each side runs code once, unless you do world.isRemote - true=client, false=server; worldObj can be found also in any entity - e.g player from PlayerTickEvent). As to WorldTickEvent - it runs for EVERY loaded world once per tick and ONLY for SERVER. The client has always ONE world (the one the client's player "thePlayer" is in called "theWorld" - those are accessible from Minecraf.class for client purposes only). On forge build 1306 - WorldTickEvent will NOT be called on client world, BUT it might have changed, I am just outdated. More: Each TickEvent has 2 Phases - START and END. Whenever you use TickEvent - pick one phase (event.phase) - otherwise your code will run twice. START happens before all other updates like entity or tileentity updates, END happens last.
  11. Well, I noticed that Jamie is now dating Kate who just broke up with Steve, who turned out to be Gay after 5 years of relationship. You don't understand who those people are, do you? The point is - we don't know your code.
  12. There is this code in GuiOverlayDebug: BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ); (...) if (this.mc.theWorld != null && this.mc.theWorld.isBlockLoaded(blockpos)) { Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(blockpos); arraylist.add("Biome: " + chunk.getBiome(blockpos, this.mc.theWorld.getWorldChunkManager()).biomeName); You might wanna look into how it works as I don't know (never used) code you posted and why it doesn't work. Overall - BIG WTF! DON'T USE MINECRAFT CLASS IN WorldTickEvent - never ever! You might want to use PlayerTickEvent for per-player effect.
  13. Are you using EntityAnimal? There is: public boolean canMateWith(EntityAnimal otherAnimal) { return otherAnimal == this ? false : (otherAnimal.getClass() != this.getClass() ? false : this.isInLove() && otherAnimal.isInLove()); } You can use it to check whatever you want
  14. Setup ONE DataWatcher for this entity with BOOLEAN (true = male, false = female). In entityInit (or constructor): 1. You generate 1 or 0 value using Random (on how to use it - look vanilla or google it) -> setObject (DataWatcher of gender) to true or false depending on what you randomed. In readNBT do: 1. check if nbt has boolean "Gender" key. 2. If it has: setObject (DataWatcher of gender) to true or false (from vale of "Gender" key) -> DONE 3. If it doesn't have this key - it means it was never set! DONE (genders that were not set are alredy handled by constructor) 4. DONE In writeNBT: 1. you getObject from DataWatcher - you get boolean value of 1 or 0 and save it using nbt.setBoolean("Gender", gender);
  15. Well, obviously. DrawString is drawing method, you can't just call it anywhere. If you want to have message in Chat then you do: Minecraft.getMinecraft().thePlayer.addChatMessage(message); for client.
  16. Then I'm safe. I am not even Light Speed yet. #LolYourReferences
  17. Well, looking at it now, I am sad (adding to TODO list in future optimization updates). Since I'll be left with what vanilla gives me - when I should be concerned about ItemStack's NBT size? If I'd be about to put X number of Longs into NBT, how much (X) could become a problem? Consider that my Items might even fill full inventory, chests and basically are everywhere. (are common) Note: Yeah I know it might be dumb question
  18. Question in title. I want to save something quite big inside NBT of ItemStack. Since feature will be used extensively and data saved will be TOTALLY useless on client I thought I could cut NBT of ItemStacks which are instanceof my Item before sending them to clients. Where that happens? Loud thinking: This will probably break everything as CreativeInventory allows client to override server ItemStacks, ay? EDIT Goal is to save huge-ass amount of bandwidth.
  19. MC Version? Use RenderPlayerEvent - cancel rendering and render again on your own. You will need to rotate boxes.
  20. I always say this - in GUI stuff you will get no direct help without giving code of what you alredy got. How to start? Both Minecraft and Forge use what you want inside their classes. When you start coding GUI 1st thing you think about - "Is it alredy there?", and it is. Look at config GUI - "Controls...", use your IDE to find how it works - it's gonna take HELLA LOT of time (relatively) to understand it, but that's only way to start coding good stuff in future. If you want to implement it on your own, you can use GuiScrollingList and create element list that will have GuiButton inside that will be pulled from some data pool (number of buttons).
  21. There is Random class for a reason. Don't make new one. Use random field in either entity or world.
  22. Title says most of it. I want to know what part of model I hit with attack. Since feature is for pvp, I don't really (for now) consider any other models than ModelBiped. I'd like your opinion on how to do this without making core mod and/or manipulating too much vanilla. I for one was considering using rayTrace (even client side) and check from which side and on what height the rayTrace vector hit the hitBox of my model. Then compare rotation of hit entity and vector hitting it to check if e.g it was chest, shoulder or head. Is this the only way? (because it WILL be very tricky to actually compute all that). Before that (on 1.6.x) I was considering scaling players hitBox to minimum and spawning 6 other hitboxes that would be in arms/legs/chest/head place and would catch damage and transfer to player owner. Yet in this case - that would mean I need +6 entites which might be laggy - also, I would need to rotate shit out of them to fit player's model/rotation. Opinions? Helpful stuff (not even Java, maybe some article)? EDIT - Before someone points out: "I need +6 entites which might be laggy" - not "laggy", but the lag of movement - they might "wiggle" and not always fit model. Also in 2nd idea - how would I remove/scale players hitBox?
  23. GuiOverlayDebug#call() Look for line with getting biome (from chunk).
  24. I think you didn't understand what the topic is about. I don't save, I compute.
  25. I have extended inventory in which there are additional armour parts. Those parts are using models defined in their NBT (string). (Java model from techne). What is proper way of rendering part onto player (e.g shoulderpads). RenderPlayerEvent? Should I work with Layers? How it should look? Goal: Not miss something that is alredy implemented that I don't know of.
×
×
  • Create New...

Important Information

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