Jump to content

rich1051414

Forge Modder
  • Posts

    160
  • Joined

  • Last visited

Everything posted by rich1051414

  1. Would that change the colour of both the icon for the Armor and the armor itself or is it just one of them? Also wouldn't the custom renderer then have to override the base one? Yes it is easiest to extend the real renderer, and just override the specific call to applies to you, and insert your color set there. Also, I believe you get the chance to do your own custom inventory rendering as well, atleast you do with blocks.
  2. Use a custom item renderer for your items, and use the same texture file and icon index as the original, but call a GL11 color set before doing your vertex calls. look at: GL11.glColor4f(float,float,float,float) those stand for r,g,b,a. Decimals from 0-1. to go from 256 integer rgb to float, just divide by 255.
  3. Or if you don't need the player to be able to modify these values, just compress and export the map with the mappings directly. You can do this like this: Saving: File savedirectory = new File(world.getSaveHandler().getSaveDirectoryName().concat("/MySaveInfo.dat")); savedirectory.createNewFile(); ObjectOutputStream os = new ObjectOutputStream(new GZIPOutputStream(new FileOutputStream(savedirectory))); os.writeObject(MapContainingPlayerMappedVariables); Loading: File savedirectory = new File(world.getSaveHandler().getSaveDirectoryName().concat("/MySaveInfo.dat")); if(savedirectory.exists()){ ObjectInputStream os = new ObjectInputStream(new GZIPInputStream(new FileInputStream(savedirectory))); MapContainingPlayerMappedVariables.putAll((Map)os.readObject()); } Remember to encompass file saving/loading in a try catch block in case there are write errors.
  4. That is because only the client has access to the EntityPlayerClientMP object. Servers get EntityPlayerMP instead. Both of those extend EntityPlayer, so that is the safe choice for both sides.
  5. Depends on what you are talking about. Forge reads from jar's and zips the same(jar are actually zipped anyways). There is no difference if the mod is zipped or jarred, its all preference, however 'jar mod' usually refers to mods that go into the .mincraft/bin/minecraft.jar, instead of using a mod loader and loading the mods from the mods directory.
  6. what about shouldSideBeRendered? overload that and return true and see if it renders. If it does, you might need to write your own.
  7. Have you thought about making the server keep it's own map for what you want the tile entity to save? Set the key to something like String.valueOf(x) + "-" + String.valueOf(y) + "-" +String.valueOf(z) so you can get the information easily, then set up a simple client to server packet exchange to pass the information? Of course, this would be quite involved for a dirt block
  8. Have you tried just doing a: RenderingRegistry.registerEntityRenderingHandler(EntityFlameShot.class, new ModelRenderer(modelFShot)); Then in your EntityFlameShot class, extend EntitySnowball, and in your constructor, do a this.setThrowableHeading();? EntitySnowBall has all you need for built in arrow/throwable movement, and the generic ModelRenderer should do the drawing of your ModelBase for you.
  9. What kind of question is that? Are you going to ask me if my computer is plugged in? God, its tech support all over again. Btw, I figured it out, at least, what seems to work for me. If you make all your GL11 calls after you draw+startDrawingQuads(), then reset them after your final draw and before the final startDrawingQuads(), the color loss doesn't seem to happen, at least not for me. Maybe that can help another with a similar problem. Also it seems to help to do a GL11 color call AND a tesselator color call, in case colordisabled is set, setting one or the other doesn't seem to be 100%
  10. Ok, so I have particle effects that have their own texture file, and on top of that, the texture file is generated at startup and only the opengl reference ID is kept. So far, I haven't even found a way to hook a physical file, let alone simply an int id. This is what I am doing now: public void renderParticle(...) //...rendering variable initialization and calculations here par1Tessellator.draw(); //to flush the tessalator //Do all my GL11_ calls directly here, including color setting, using the tesselators api here usually doesnt work after a flush. GL11.glBindTexture(GL11.GL_TEXTURE_2D, MyIntGL11BoundTextureID); //to get the integer id with assembled BufferedImages, do a renderEngine.allocateAndSetupTexture(BufferedImage) par1Tessellator.startDrawingQuads(); par1Tessellator.addVertexWithUV(...); par1Tessellator.addVertexWithUV(...); par1Tessellator.addVertexWithUV(...); par1Tessellator.addVertexWithUV(...); //Now flush reset settings, and restart the quad drawing. par1Tessellator.draw(); //Reset all GL_ settings back to their originals GL11.glBindTexture(GL11.GL_TEXTURE_2D, renderEngine.getTexture("/gui/items.png")); par1Tessellator.startDrawingQuads(); That method works... mostly, except we are flushing the tesselators buffer that is not full, and it causes some really odd things to happen. Using layer 2 reduces this to a minimum, but it can still cause oddities, like missing colors/flickering colors. I could also choose not to flush before the tesselation, but this causes even worse issues, my texture leaking into other effects. Does anyone know of a better way to do this, or some calls I might be missing? I currently only set the basics, blendfunc, color4f and depthtest(requires a flush unless you are on acid). If anyone has any info let me know, right now I am just trying to keep the problems at a minimum by flushing before and after my rendering.
  11. Look into the forge proxy system, but the major rule is, classes that address server side need to go in Common package and can NOT reference classes from the client package. Packages in the client package are client side only and can reference classes from both packages. There are 2 threads that run through the mod, client and server, server needs to stay contained in the common package, and client can go wherever, but should not modify the server directly. There is a proxy system in place that allows you to call a class in the common package, that is extended in the client package, and depending on if the thread is server or client, that is the class that it will use. This is the heart of combining the two.
  12. Just an update, decided today to go ahead and tackle this, took about 5 minutes with your input. I'll post my src in case it might help another https://dl.dropbox.com/u/74770478/DI%20Plugin%20src.zip
  13. I worked it out, and yep, thats what I did I duped all the registration from one of my items and forgot to change that to getBlock I ended up just doing a manual get, then when looking at the config, I slapped myself when I saw my stairs block listed under items.
  14. What's going on with the BlockID assignment? It in no way takes my suggested block ID's into consideration, and 1 of which is determined to give my block an ID of 31743, obviously WAY out of bounds. I am acquiring this key when the properties gets the ID for the first time, but my default ID of 564 doesn't pursuade it away from giving a ridiculous ID. It only does it to me on a single block, and it extends BlockStair, if that matters. I am currently using a work around that manually saves a sane BlockID, then the config loads and uses that ID fine. Anyone know what is going on?
  15. Ok that's all i needed to hear. I couldn't find any info, and there is nothing worse than spending hours just to hit a brick wall you did not think about. This is good news, now I might be able to shut some people up, a little (Background: Users constantly screaming to make damage indicators fully client side that can work online, completely ignoring the fact it is impossible without the required packets ) I'll just make a bukkit plugin and them make them annoy their server admin instead...
  16. http://creativecommons.org/licenses/by-sa/3.0/ Yes you can, BUT, you must allow everyone to do the same with yours. 'If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.' So people are free to use your work in their own work. Modpacks however are a bit disrespectful for some people as they require little work to achieve and cause the mod authors to go unrecognized, losing them link clicks and donations. Just letting you know.
  17. Minecraft forge is universal. It works in a server too.
  18. Try this: int EntityID = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerModEntity(AC_EntityFrozenZombie.class, "FrozenZombie", EntityID, this, 64, 10, true); EntityRegistry.registerGlobalEntityID(AC_EntityFrozenZombie.class, "FrozenZombie",EntityID , zombieBackGround, zombieSpots); LanguageRegistry.instance().addStringLocalization("entity.FrozenZombie.name", "en_US", "Frozen Zombie");
  19. You also need to register your entity, before your entity renderer, look at EntityRegistry.registerModEntity(...)
  20. Yes, I didn't realize you didn't also register the Entity, atleast now we know the reason so many are reporting the invisible entities.
  21. Yeah I couldn't narrow down exactly what you were trying to do given just the snippets, but glad it helped.
  22. My mod, damage indicators, currently requires a packet to be sent to nearby players when an entity takes damage, and this is the only action my mod takes server side. My question is, it seems incredably easy to wrap a bukkit plugin to send the packet the client want, is there any limitations or problems I should be aware of? This is how the packet is structured in forge: ByteArrayOutputStream data = new ByteArrayOutputStream(); DataOutputStream datastrem = new DataOutputStream(data); try { datastrem.writeInt(evt.ammount); datastrem.writeInt(evt.entityLiving.entityId); Packet250CustomPayload packet = new Packet250CustomPayload("DIChannel", data.toByteArray()); ... In bukkit, would this work hooking an EntityDamageEvent? ByteArrayOutputStream data = new ByteArrayOutputStream(); DataOutputStream datastrem = new DataOutputStream(data); try { datastrem.writeInt(evt.getDamage()); datastrem.writeInt(evt.getEntity().getEntityId()); Packet250CustomPayload packet = new Packet250CustomPayload("DIChannel", data.toByteArray()); ... I guess mainly what I am asking is, since a forge client is connecting to a non-forge server, are all the necessary subsystems available to the mod for the packet to still register?
  23. couldn't you just do RenderingRegistry.registerEntityRenderingHandler(EntityFolk.class, new RenderFolk(new ModelBiped())); and then in your doRender do this? if(par1Entity instanceof EntityFolkM){ //doMaleModel rendering }else if(par1Entity instanceof EntityFolkF){ //doFemaleModel rendering }
  24. Try adding this to the @init in your mod, or your proxy render registration for multiplayer: RenderingRegistry.registerEntityRenderingHandler(EntityPhilosophickMercuryBottle.class, new RenderSnowball(Item.expBottle.getIconFromDamage(0));
  25. I think it is done like this: RenderingRegistry.registerEntityRenderingHandler(NonLivingEntity.class, new NonLivingEntityRenderer()); and NonLivingEntityRenderer is: public class NonLivingEntityRenderer extends Render{ public void doRender(blah b, blah b, blah b){ //Render your Entity }
×
×
  • Create New...

Important Information

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