Jump to content

RANKSHANK

Members
  • Posts

    305
  • Joined

  • Last visited

Everything posted by RANKSHANK

  1. Unlocalized names are just persistent String values. Localizing is the translating that string into a readable string, so that translation tables can be built using consistent key strings
  2. You're opening your container instead of your GUI in the handler
  3. Read his license. That will tell you pretty clearly how he feels about source copying If he's fine with it there's not too much of an issue.
  4. Sounds like it's an attempt at an 'aim bot'
  5. In addition, not replacing the existing textures. Hence the need to get crafty.
  6. Oh boy if there wasn't enough help needed before, there will be soon Field fireField=Entity.class.getField("fire"); Fire is a private field and therefore is only accessible with Class.getDeclaredField(String) Also note that when the code is recompiled it'll stop working since the field names are reverted to their obfuscated variants. Secondly you need an object to grab local variables from. You need an entity and then you need to invoke the set(Object targetInstance, Object newValue) method with your now accessible field. And that's about it. I'm not following why you need to change the burntime on entities struck by lightning though
  7. Well for you do have 2 @EventHandler methods with FMLInitializationEvent so I'm guessing one of those won't get invoked
  8. So most space & process efficient is: List<MyTileEntity> found = Lists.<MyTileEntity>newArrayList(); TileEntity t; for(Enumfacing e : EnumFacing.values()) if((t = World.getTileEntity(BlockPos.offset(e , 1))) instanceof MyTileEntity) found.add((MyTileEntity)t); If you don't need to hold onto the list you may as well remove it and directly invoke whatever methods you need where the add is.
  9. Also why are you using an array when you clearly want a list? PowerConnectable[] machines = new PowerConnectable[]{null}; machines[machines.length] = (PowerConnectable)worldObj.getTileEntity(pos.west()); You're going to crash since the max index of that array is 0 and then length is always going to be 1
  10. Create a resource pack based off the folder, add it to the default texture pack lists, parse your target folder for file names so you can convert them to resource locations and feed them to the resource manager. I'd suggest creating an IResourcePack that uses unique key for the domain so that there aren't any conflicts pulling textures from your original assets. That is unless you want the capability to overwrite the original textures you or a resource pack has supplied
  11. Well BlockPos.offset(EnumFacing e) can be used Parse through EnumFacing.values() to create the array and then parse through the positions, this way you're not instantiating up to 3 new BlockPos per step
  12. Make an array of the blockpos and iterate through it
  13. You'll have to make a custom IResourcePack if you can't get ResourcePackFolder to suit your needs
  14. You can check if a particular mod is loaded with its id string.
  15. Actually the resource packs do all of the manual lifting, ResourceManager just queires the loaded resource pack instances. My issue with getting a directory is that the IResourcePacks will only return files to the ResourceManager, directories churn out null values aplenty. Got it 100% working with the dynamic texture loading. Basic premise is: /* boolean code at play */ List<IResourcePack> packs = Minecraft.getMinecraft().getResourceManager().domainResourceManagers.get(MyMod.ID).resourcePacks; for(IResourcePack pack: packs) // Invert the list parsing. FallbackResourceManager#resourcePacks is kept in reverse order if(pack instanceof AbstractResourcePack){ List<String> locations = parseDirectory(pack.resourcePackFile); if(locations.size() > 0) for(String s: locations) TextureMap.registerSprite(new ResourceLocation(MyMod.ID, s)); else continue; break; //So we don't load more textures once we've picked up the first resource pack that contains them. } Quite a few bits of reflection in the non boolean code but it works perfectly. Probably a bit of lag during texture loading added since I have to compare against all of the entries in a zipped texture pack. If anyone wants to read through my actual code for this just let me know.
  16. You need to post the code for your EntityConstructingEvent handler, your PlayerRespawnEvent handler, and your IEEP class
  17. Thanks for the response! I've read through the IResourcePack handling and it's not what I'm looking for unfortunately... IResourcePack is used to add a new Resource Locale, such as a new type of compressed file or a fed byte stream for a given domain, but that won't provide any existing resource packs' (selected/server/default) file list... I actually need to handle the IResourcePack so I can look through the files inside of it At this point it's looking like I'm going to need to use some reflection to grab the fallback resource manager for my domain at SimpleReloadableResourceManager#domainResourceManagers, reflect into that fallback resource manager to get FallbackResourceManager#resourcePacks to iterate through so I can run a switch by the type of IResourcePack in it to access the files in the location. i.e. AbstractResourcePack#resourcePackFile && DefaultResourcePack#mapAssets Thankfully it appears that the FallbackResourceManager has the resource packs listed in the order of importance. Once I have my list of files I'll be able to split their paths so I can create their correlating resource locations and feed them back into the game.
  18. Well your update() is run on clientside only.... Also you don't appear to be sending a description packet, so the itemstack will be null on the client where it is checked
  19. Hey guys, I was wondering if anyone knows of a way grab ResourceLocation as a directory, or even just get a list of files in a given folder of the loaded resource packs. At the moment I'm just reading from a txt file with file names listed in it since I have set locations I need to parse through. It works but I was hoping for something a little cleaner and more end user friendly Also since this doesn't deserve its own thread; is there a call for binding custom IMetadata instances? I've resorted to using reflection and being lazy with some parsing Once again works perfectly, just wondering if there's anything cleaner that I've missed
  20. Use a custom IExtendedEntityProperties if you need a per player dim id Also use PlayerEvent.PlayerRespawnEvent To send them. should work pretty cleanly
  21. Is there a way to parse through the loaded worlds? Something like public void foo(WorldEvent.Unload e){ if(Server.listWorlds.size() == 1) myShit.flush(); }
  22. Yes and no So basically you hold your own map with ChunkCoordsPair as the key and your atmosphere as a value per chunk, like how normal chunks work. Scheduling updates is adding chunk coords to a 'to update next tick' list so that only chunk's that need updating get updated (basically a mark dirty method). Throttling just means optimizing the update methods so they don't continually spam more update entries.
  23. Schedule updates: use a tickhandler and feed them into a list and update it's entries to try to prevent update locks. You'll have to throttle the maximum number of entries run through per tick
  24. Well one possibility is storing the gas in a per chunk array (like the light maps) and updating when necessary. Since the spread will hit a point that it's inert updating shouldn't be too computationally heavy. Edit: to do it you'd want a Map of chunk coords containing the gas data. Listening for chunks unloading and being loaded to read and write respectively The real issue is memory: either your doing a has gas_Argon flags in a bitset style set up which will utilize the least memory, or you'll have larger concentration values in nibble arrays like block meta which will chew that RAM up with 20 values per coordinate...
  25. What exactly are you using it for? It sounds like a resource hog in the making. How many gases? Will they be homogenized or pure block states?
×
×
  • Create New...

Important Information

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