Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About Tavi007

  • Rank
    Creeper Killer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ah okay. I knew, it must be something simple, that I overlooked. Texture will be changed anyway. I just threw some stuff together, but thanks for the heads up anyway.
  2. Hello. I want to render a small texture for a HUD. I currently have this for testing prupose: @SubscribeEvent public static void displayData(RenderGameOverlayEvent.Post event) { if(event.getType().equals(RenderGameOverlayEvent.ElementType.ALL)) { Minecraft mc = Minecraft.getInstance(); MatrixStack matrixStack = event.getMatrixStack(); mc.getTextureManager().bindTexture(new ResourceLocation("elementalcombat", "textures/icons/fire.png")); matrixStack.push(); matrixStack.scale(0.1F, 0.1F, 0.1F); mc.ingameGUI.blit(matrixStack, 0, 0, 0, 0, 256, 256); matrix
  3. ah okay. I will see, what will work best for me.
  4. Now you lost me. Where am I supposed to lazily initialise the values? In AttackData, in AttackDataCapability or somewhere complelty different?
  5. Okay, got it. I think, I can use the AttackDataAPI and DefenseDataAPI classes for this, because I (and anyone else) should always use these to interact with my capabilities.Or would this be bad practice? Thank you for your help anyway
  6. https://github.com/Tavi007/ElementalCombat you have to look in api/attack or api/defense for the capability
  7. Ah, so whenever I craft an item, the values, that were set in attachCapability will be overriden by the desirialized cpability from the old stack (which was an air item). That explains the bug. I could change the constructor of my capabilities to use ItemStack and then read from my Map<ResourceLocation, DataFromJson> in there, but I don't see, how this will solve the bug.
  8. Hmm, I already thought, that it would work like this. I guess, that the itemstack in the result slot gets created as an air item. Therefor the attachCapability event gets triggered with an air item and the default default values will be used. So what happens with the result stack, when I place the last iron ingot for crafting an iron sword and the result slot gets updated? And how could I detect that exact moment?
  9. just two maps and two strings. I use json files, so anyone can override them with datapacks. Basically each item, that should have default values, also has a corresponding json file. (if an item does not have a corresponding json file, then it will get default default values.) The information in the files are loaded into a Map<ResourceLocation, DataFromJson> once when the server starts, so i can get them whenever i need them. When the attach event (or the item craft event) trigger i resolve the resourceLocation, get the DataFromJson and then set the itemstack capability. As l
  10. Hey, I stumbled across a bug in my mod, when using the workbench (and presumably any other sort of crafting station). I have an itemstack capability, that gets its default value through json files. So usually when the AttachCapabilityEvent<ItemStack> triggers, I can succesfully add these values to the item. However when the result slot in the workbench container updates to a new item, the attach event does not trigger and the capability stays empty. I added a hook using ItemCraftedEvent, so the values are being set, when the crafting results gets picked up, but I also added som
  11. Bump let me summarize my questions: 1. What do I need to do, so that my mod can be added to any project using build.gradle? 2. Why does my second mod crash, when I add the compiled jar from my first mod manually to the project?
  12. Hey! I don't know, if this is the right place to ask the questions, but I don't know any better. So please bear with me I recently split my mod into 2 parts, one of which is basically a library, that includes all the functionality and an API. The other mod is my personal playground, that uses the former mod. I want other people be able to use the API without necessarily have to include my other playground mod (cause it's not really balanced, nor does it look pretty currently...). I want to realese my API in the same way as other mods do it, so a dev can easily include the right ja
  13. Well TIL. Before I fix this problem, I would like to know, if my idea with the layer will even work. I've added this to my TextureLayer class: protected static <T extends LivingEntity> void renderCutoutModel(EntityModel<T> modelIn, ResourceLocation textureLocationIn, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, T entityIn, float red, float green, float blue) { IVertexBuilder ivertexbuilder = bufferIn.getBuffer(RenderType.getEntityCutoutNoCull(textureLocationIn)); modelIn.render(matrixStackIn, ivertexbuilder, packedLightIn, LivingRenderer.g
  14. I know that my question is a general java problem and that this forum should not be used as a java tutorial... I thought I would be fine, since T extends LivingEntity and M extends EntityModel<LivingEntity>. So if my renderer is an instance of LivingRenderer, shouldn't be the types T and M at least be LivingEntity and EntityModel ?
  15. LivingRenderer has the following definition: public abstract class LivingRenderer<T extends LivingEntity, M extends EntityModel<T>> extends EntityRenderer<T> implements IEntityRenderer<T, M> So I should be safe to cast it to LivingRenderer<LivingEntity, EntityModel<LivingEntity>> and will never crash, right? Also what about my other questions? To summarize my open questions: - Do semi-transparent texture work as a layer? - Will the layer be added to all LivingEntities (vanilla and modded) using the current method? If not, how can I get the Li
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.