Jump to content

draganz

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by draganz

  1. Don't know much on your situation, so excuse the perhaps insolent remarks. Most modders discriminate the API portions of their mod into a separate folder, where another can easily just take the code, and then copy into a separate portion of their development environment, to use. Thus, as long as the forge hooks for an API are there, then you are good to go. You could also separately compile the API, but I don't know how, no would I. As a side not, what I am referring to for the forge hooks for an API (in case you don't know) I am referring to the package-info.java files, containing @API(owner = [yourDiscriminatorName], apiVersion = [API version], provides = [your API, should probably be like the core API class name, like "MyModAPI"]) Beyond that, I don't know much more of what you are looking for beyond letting the world know you have a mod, and that it has an API, if other modders wish to make hook into it.
  2. bump, edited the contained information cause I'm bad at english.
  3. [EDITED] Question about my "favorite" subject in minecraft, rendering. I wish to use a custom shader on a generated texture that is displayed by a TESR. public class RenderTileInscription extends TileEntitySpecialRenderer<TileInscription>{ @Override public void renderTileEntityAt(TileInscription te, double x, double y, double z, float partialTicks, int destroyStage) { final MagicCircle circle = HandlerModel.getInstance().tester;//this gets an instance of a object that holdes a holds a TextureAtlasSprite if(circle != null){ bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); GlStateManager.pushMatrix(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.disableAlpha(); GlStateManager.translate(x, y+0.0001f, z); GlStateManager.rotate(90f, 1f, 0f, 0f); GlStateManager.scale(0.3625f, 0.3625f, 0.3625f); UtilRender.renderStandQuadTexture(circle.getTextureSprite());//renderQuadTexture metho GlStateManager.enableAlpha(); GlStateManager.disableBlend(); GlStateManager.enableCull(); GlStateManager.popMatrix(); } } } ////methods from UtilRender////// public static void renderQuadTexture(TextureAtlasSprite texture, int par1, int par2, int par3, int par4, int brightness){ Tessellator tes = Tessellator.getInstance(); tes.getBuffer().begin(GL11.GL_QUADS, ClientProxy.POSITION_TEX_S_COMP); tes.getBuffer().pos(par1, par2 + par4, 0).tex(texture.getMinU(), texture.getMaxV()).lightmap(brightness, brightness).endVertex(); tes.getBuffer().pos(par1 + par3, par2 + par4, 0).tex(texture.getMaxU(), texture.getMaxV()).lightmap(brightness, brightness).endVertex(); tes.getBuffer().pos(par1 + par3, par2, 0).tex(texture.getMaxU(), texture.getMinV()).lightmap(brightness, brightness).endVertex(); tes.getBuffer().pos(par1, par2, 0).tex(texture.getMinU(), texture.getMinV()).lightmap(brightness, brightness).endVertex(); tes.draw(); } public static void renderStandQuadTexture(TextureAtlasSprite texture, int brightness){ renderQuadTexture(texture, 0, 0, 16, 16, brightness); } public static void renderStandQuadTexture(TextureAtlasSprite texture){ renderQuadTexture(texture, 0, 0, 16, 16, 240); } The above code will display the correct drawn texture (made larger than a standard block for ease of sight), now the question is how to implement custom shaders. The specific shading effect I am looking to make is where an EntityPlayer instance will activate (right click) the block, that will send the information of the specified held item and the exact position relative to the bounding box where the player clicked. This will then be used by the TESR so as to display the predefined texture (the circle.getTextureSprite() part) with a "light" source of a specific color, with source position (starting point) being at the point where the player originally right clicked the block. This color will then gradually fade (like a light) over a specific area. To summarize, I wish to use a shader to create a gradual light fate effect, with passed in vars of a color (vec3 or 4), and a position relative to the texture (vec2) (these variables being provided via uniforms to a fragment shader). This should look (of better quality) like the transition (from the attached pictures) of pic1 -> pic2. Needless to say, compatible for multiple "light" sources. Now from what I understand, I don't believe I need to use a vertex shader, and only a fragment shader. More so, I really don't think I need anything overly fancy, and while in non-minecraft opengl, I would use a normal mapping, for this, I would prefer to not, as the base picture should be uniform color (more or less), and I am only looking for a simple lighting overlay, not any ultra-realism. Thus, thats more or less my question: how do I do this form of effect within minecraft, preferably in a relatively simple fashion. pic1 pic2 pic3
  4. Simple Question, how might one register a custom font. Do I have to create a custom FontRenderer? So far all I have conformed is that when I create a client only gui and create an identical instance of the Minecraft standardGalacticFontRenderer, then the text does not display as anything, and that I cannot register the custom font instance like minecraft does. What am I missing?
  5. No, its not your fault, this is just a tricky subject, for the desired result. I would like to avoid using reflection, but the only way I seem to be able to do this is by either gaining access of some form to player inventory, or through itemStack, not the later, since itemstack is used everywhere and it is final. Just more searching in the forge and minecraft jars for me, is all
  6. Was making a basic blueprint for the capability, and the end result is that i am no where. I do not see a way to go anywhere with the capability.
  7. could you post the console message, there should be one if your texture isn't working. Also, it would be nice if we say how you were registering the item model.
  8. Then my current question is of the most important, how should I do this. I say this in the respect of what is the best way. Is there a good hook I can use, or should I just put some if statements in the player tick event? Would prefer not to, but if that is the way, then so be it.
  9. Looked into this a bit, but to specify, I am talking about for the player's inventory. How to detect if a specific ItemStack is clicked on another specific ItemStack in the player's inventory.
  10. My question is how can one detect when an itemStack is being clicked on another specific item. for instance, if item1 = 1 and item2 = 2, (in the inventory, such the normal behavior is to have the ItemStacks switch places), if ItemStack 1 is being clicked on ItemStack 2, then do something. I have looked into various events and the potential of capabilities for the setItem method in ItemStack, yet i do not see a 'good' way of doing this function. How might I be able to implement such a function. NOTE: Unless it is made in a way to guarantee that it will not cause any 'excessive' processing, if if it is the ONLY way, I do not care for some player event where the player inventory is checked every tick. Also, I do not care if it is a suggestion or the 'asnwer,' I mearly wish to know of what my potentials here are, what might work, what does, or just give up suggestions are all appreciated. EDIT: Or how might I find a way to detect changes in the ContainerPlayer class, for instance, is their an event for that? EDIT: Due to issues in finding a potential answer to this, I shall specify further: I would like to add in a unique, custom way of 'crafting' recipes, where if item A is clicked on item B in slot, then both (ignoring specifics such as stack size) would be deleted from slot and replaced with item C. This would simply search from potential recipes to find matches. At this point, I am giving up on finding any reasonable solution.
  11. Solved the Issue, was a issue in loading NBT data, somehow i did not notice and error warning that said how it could not load NBT data due to the tile entity trying to get the world time before it could access the world time, causing the needed NBT data to not be read.
  12. I have a TESR that works perfectly (though needs some clean up); it will render when you place the block, but when one logs out and logs back in, the TESR will not render, though if broken and replaced, will render once again. I have tried various vanilla ways if updating the tile entity and also tried a simple network message to be sent, nothing is working. Thank you to anyone who can help. NOTE: to simplify, the issue is that on logging in, an existing block does not recognize that there is a TESR class at all. TESR class Tile Entity class TEBase Common Proxy Client Proxy Main class
  13. I'm afraid i have been working on this a bit and also looking at others and how they might have solved this, but there doesn't seem to be a good answer that i can give. The only thing I can advise now is to try using an update tick, like from the block class or a tile entity (though a tile entity would be a waste), or just bump this question till someone with an answer can help you, sorry.
  14. From what I am reading, i looks like an issue in a Json file, like it is trying to call a parent file, I am guessing, called builtin/missing in the Minecraft assets folder. Try looking through your Json files and seeing if any parents are weird.
  15. Okey so I am trying to understand your question, but the only issue i can see from what you are asking is that you haven't: public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face){ return net.minecraft.init.Blocks.FIRE.getFlammability(this); } used this method in your TNT class, correct me if i'm wrong, but this is a forge hook that, does the job of what the init() method in the fire class does. Looking into 1.10.2 code shows that the TNT should just run the proper code on block deletion, thus the only issue I see in your TNT block is that it is not TNT, thus you must register it so that it can burn just like the regular TNT block, check the forge hooks like the above stated one in the Block class. Also, for future reference, it is much appreciated if you would post your code, though I think i grasped your question, if not, tell me.
  16. Just so you know, the method GameRegistry.registerItem(Item item, String name), if you look at the GameRegistry.class, tells you strait up that in your item class, you are setting the registry name, yet you reset it again when you use that particular method. Just use GameRegistry.registerItem(Item item). that should work just fine, so in your case GameRegistry.registerItem(fireskill); You were just registering the name twice, so forge through the error.
  17. This is a bit off-topic, but also for your proxy classes, you use the System.out.println() to output into the console where you add in the [info] tags to your sysout statement. You (simply for syntax) should remove them and replace them with FMLLog.log() statements. These have better functionality as well as do various formatting to the out statements to the console. Look up pahimar letsmodreboot for more information on this, or just look at the FMLLog class.
  18. Okay, so I have a question about how to access through forge if eclipse is in debug mode. I have already tried if(FMLRelaunchLog.log.getLogger().isDebugEnabled()){ System.out.println("slfjs"); } yet it always seems to be true, whether in debug or not. I noticed that the apache Logger class has debug set to true, yet /** * Checks whether this Logger is enabled for the {@link Level#DEBUG DEBUG} Level. * * @return boolean - {@code true} if this Logger is enabled for level * DEBUG, {@code false} otherwise. */ if the info also provided for the isDebugEnabled. So my question is how do i find the correct way to see if forge has set the debug level to be false, so that i can use the the stated method above. Also, currently using forge 12.18.1.2011. - thanks in advance for any who respond - draganz
×
×
  • Create New...

Important Information

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