Jump to content

SoundLogic

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

SoundLogic's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I am working on an IItemRenderer that basically acts as a proxy, rendering an itemstack in place of the actual itemstack with a red colored 'enchantment' shine. However, as I continue to try to get it to work the code continues to get more strange render issues. I was hoping that someone here could assist me. My existing code is here: http://pastebin.com/TXd61KUz The desired end result is that it will render the itemstack returned by the ItemHaunted with the desired red enchantment shine. Any assistance would be greatly appreciated, SoundLogic
  2. I currently am using an IItemRenderer, but my objection is that it requires rewriting the entire item rendering sequence, doesn't permit any good way to interact with any other custom item rendering behaviors, and on the whole seems a bit much for a single color parameter. I am also working on putting the enchantment glow code in an itemblock renderer, but this seems like something other people could take advantage of. As I said, I can try to make a forge pull request if I could be told how it would be recommended that the color be communicated
  3. I have two feature requests: 1) The ability to have an item return a custom color for the enchantment glow, taking the itemstack as a parameter 2) The ability to put the enchantment glow on blocks (for inventory and entity and held, not placed) I have some prototype code for this that I can work on making into a forge pull request, but I am unsure of how to make sure I follow all the conventions. If I should submit my code, then how should I let the item set the color? Should I have it call GL11.setColorf or should it return an int or somesuch? Thank you, Sound Logic
  4. I noticed a few things about the hooks for sleeping. 1) It asks mod hooks if you can sleep without giving the information of the results of the vanilla sleeping system. This would be a rather simple change, having a EnumStatus variable that is set instead of the return statements and moving the event posting till after the initial set of checks. This would be helpful, as I would like to be able to sometimes override the fact that you can only get into a bed at night, but not do anything about monsters around or anything else, and would prefer to avoid potential issues with trying to just copy the code, and having to worry about editing other vanilla behavior. 2) The section of code for deciding if the players actually start their sleep cycle has no forge hooks. This is problematic for me, because I want to sometimes add restrictions to the sleep cycle, so that even if all players on the server are sleeping it won't go through the fade out. It is also difficult as far as I can tell to actually detect when the sleep cycle actually occurs without duplicating the vanilla player tracking, which I would prefer to do as that would make compatibility a bit more of an issue. I hope that hooks to permit the behaviors I described are implemented, and thank you for all your wonderful work, Sound Logic
  5. I am trying to make a very basic item renderer to work off of, that simply duplicates the vanilla renderer behavior to give me a base to add my stuff to. However, I seem to be failing at even that. My current code is as such: package SoundLogic.materials.core; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import net.minecraft.client.Minecraft; import net.minecraft.src.ItemStack; import net.minecraft.src.RenderEngine; import net.minecraft.src.Tessellator; import net.minecraftforge.client.*; public class HauntedItemRenderer implements IItemRenderer { @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return type==type.INVENTORY; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { { Tessellator tes = Tessellator.instance; ForgeHooksClient.bindTexture(item.getItem().getTextureFile(), 0); int var9=item.getIconIndex(); double texX=var9 % 16 * 16; double texY=var9 / 16 * 16; tes.startDrawingQuads(); tes.addVertexWithUV(0, 0, 0, texX, texY); tes.addVertexWithUV(0, 16, 0, texX,texY+16); tes.addVertexWithUV(16,16,0,texX+16,texY+16); tes.addVertexWithUV(16,0,0,texX+16,texY); tes.draw(); } } } I seem to have registered it correctly, since the function is getting called, and I can confirm that the texture and sprite location are valid since it shows up just fine in my hand (which I have not yet implemented a custom renderer for) If anyone could help me with this I would greatly appreciate it. Thank you, Sound Logic
  6. I'm trying to learn how to use IItemRenderer, and was wondering if someone could give me some sample code for it that just acted like the regular renderer, or even simpler just drew the item like it is enchanted, or could give me some more direction on how to go about creating such code. Thank you, Sound Logic
  7. Well, I was hoping to transform it into another mob before the spawn check, and make it so that I could chain them properly, but I could include a chaining system seperate. I also suppose if I just kill it if a separate check doesn't work. Will LivingSpecialSpawnEvent trigger on mob spawners and such?
  8. I was hoping that during the natural mob spawning events, we could have a hook that we could use to change the mob. The hook would pass along the entity to anything registered to receive it to a function that returned the mob after anything you wanted done to it was done. I'm not sure how good that explanation was, so I am also going to try to explain it in code; basic code insert would be like this in SpawnerAnimals: EntityLiving var38; //existing code for reference try { var38 = (EntityLiving)var21.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par0WorldServer}); } catch (Exception var30) { var30.printStackTrace(); return var3; } //new code here for (IEntitySpawnTransformer transformer : spawnTransformers) { var38=transformer.transform(var38,par0WorldServer,var17,var18,var19) } //continues with old code This would help me with quite a few of the effects I am adding. Thank you, Sound Logic
×
×
  • Create New...

Important Information

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