Jump to content

SanAndreaP

Forge Modder
  • Posts

    1689
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by SanAndreaP

  1. playerItemStack - what value do you define in here? fence.getItem() - is this your own fence? If so, why don't you use Item.getItemFromBlock(MyMod.blockInstance) ? (Block)Block.blockRegistry.getObject(TestModCore.MODID + ":fence_oak") - Why make it so complicated? Why not just MyMod.blockInstance ?
  2. SanAndreaP

    -

    so your custom lang file has those weird characters? If so, then your file encoding may be ANSI, but it must be UTF-8
  3. Should it grow like reed or like wheat?
  4. There are so many things wrong with your mod that I can't list them here, since I barely have time right now. I would suggest a major cleanup and refactoring...
  5. You need to add myFluidInstance#setBlock(myBlockInstance) after you've initialized your block and fluid.
  6. So you don't see the "updateAnimation" string in your console? I've tried the animation thingy for blocks now and it works for me. Here's the example code I've made up: https://gist.github.com/SanAndreasP/06fb4c4ecaa9e1e1e746 Maybe you can spot the difference...
  7. Light Level != Light Opacity! It's just a math problem. Just check if the saved light value is >= 14
  8. You also thought about when the player logs out / quits the game within the dimension and logs back in / load it up again and then they change the dimension? If you want overall less light, override generateLightBrightnessTable in your provider and use the vanilla calculation, whereas multiply the end result with 0.8F or so (like lightBrightnessTable[i] *= 0.8F ), which means 80% less overall light in your dimension (even block light).
  9. per game No seriously, it's like the old block IDs, if you register too much entities with registerGlobalEntityId(), then you can't register more. That's what registerModEntity is for, to not have this kind of limitations.
  10. You mean this tutorial, right? http://www.minecraftforge.net/wiki/Basic_GUI The only thing different from the tutorial and the current Forge is that there's an @NetworkMod annotation in the tut, which doesn't exist anymore, therefore you can just ignore it.
  11. Have some pseudocode: method onBlockActivated start if world#isRemote == false then ItemStack myItemStack = new ItemStack([myItemInstance], [count], [damage]) EntityItem myItemEntity = new EntityItem([world], [x], [y], [z], myItemStack) world#spawnEntityInWorld(myItemEntity) end if end method
  12. override onBlockActivated and spawn an EntityItem with your custom Item within that method. Also when you spawn entities, please check if you're on the server.
  13. You quoted your answer... It can't find AutoUtils, so go get it.
  14. Question here, does it now call the updateAnimation method?
  15. If you spawn an entity with an constructor like Entity(worldObj, x, y, z) on the server, the server sends a packet to the client and the client will also spawn it with the (entitys standard) constructor Entity(worldObj) in the client world. That's why you should always spawn an entity on the server, or you'll get duplicates on the client. How would the client know about the entity otherwise except excessive network transfer? This setup is there to prevent exactly that. So yes, it's intended.
  16. if (p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11 - this.getLightOpacity()) You set the light opacity to 15 in your constructor, I'll let you do the math.
  17. Although you can't change time directly per dimension, what you can do is overriding the calculateCelestialAngle method in your provider and return a value where it's midnight (idk the correct value for it right now)
  18. The question is how do you register entities? If you use registerGlobalEntityId(), then yes, there's a cap (AFAIK max 256 entities) If you just use registerModEntity(), then there shouldn't be a problem.
  19. I haven't worked with the Data Watchers much before, so I got lost a little bit. So I'll create the method, but how do I save and read from the watcher [in order to call from 1 of my 6 possible textures]. First, you need to register a field ("object") inside the DataWatcher with the DataWatcher#addObject(id, initialValue) method, preferably inside the entityInit() method in your entity. id is an unique object id which you need to reference the object. Please note that there are pre-occupied IDs already, so if it crashes with the ID, try another one. Also there's a cap of max. 32 objects within a DataWatcher. initialValue is pretty self-explanatory. Possible data types can be: ItemStack, String, Integer, Short, Byte, Float, ChunkCoordinates . Either use new DataType() (e.g. new ItemStack(...) ) or, for primitive datatypes, cast it (e.g. to have a short, use (short) 10 ) Second, to get an object from the DataWatcher, use DataWatcher#getWatchableObject[DataType](id) , where [DataType] is the datatype you've defined previously (e.g. for integer, use getWatchableObjectInt(id)). The only exceptions where you can't use this is ChunkCoordinates. Here's a list of datatypes and getters: ItemStack : getWatchableObjectItemStack String : getWatchableObjectString Float : getWatchableObjectFloat Integer : getWatchableObjectInt Short : getWatchableObjectShort Byte : getWatchableObjectByte Third, to write to the defined object, use DataWatcher#updateObject(id, newValue) , which follows the same rules as the in initialValue from the registration for the newValue. Also make sure to only update values on the server (worldObj.isRemote == false), or you get discrepancies with client and server.
  20. hm... Can you do a println() in your registerBlockIcons method and see if the VoidMod.texNullOre is null? EDIT: I just noticed that the registerBlockIcons method is called before the event and thus you assign null to your blockIcon (why it works for me, I have no clue). So instanciate your texture atlas whilst defining the field. Then use the reference in the event and the registerBlockIcons method (you just move the new TextureNullOre() from the event into the main mod, where you declare your field for it)
  21. What if there's a potion shown below (after) the modded one? I suspect it uses the new texture then...
  22. If you get the missing icon, there must be something mentioned in the log. Can you give it to us?
  23. How to get your TextureAtlas to work: First make a new instance of it and save it in a static class field, so that you can reference it anywhere. Use the TextureStitchPre event, instantiate the static field, and there, use the event to register your instance texture atlas. Example code here: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/client/event/IconRegistry.java Note: event.map.getTextureType() MUST be equal to 0 here instead of 1, since it's the texture sprite for blocks! If you've done that, go to your block and use the texture atlas instance in your blocks getIcon() methods, Example code can be found here, it's an item, but it should also be similar to the block: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/item/ItemAvisCompass.java#L62-L64 assign your blockIcon field inside your block with the texture atlas instance, preferably within the registerIcons() method (also DO NOT call the super method in this case! It will either complain about a missing/duplicate texture, or assign the same texture again!)
×
×
  • Create New...

Important Information

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