Jump to content

kaiser_

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by kaiser_

  1. Hello everyone! I'm working on a tree model visualizer object, that can draw a tree dynamically to the screen regardless of how many nodes or subtrees there are. The user can move the display with dragging, and here comes the problem I have. I need every object that is outside of the object to be hidden, like on the advancement screen in vanilla, however, no matter how hard I looked at the vanilla code, I wasn't being able to figure out a way to do this. Right now, my objects are visible outside of the object. That is what I don't want to happen How would I be able to make this happen? Any help is appreciated!
  2. And the PacketDistributor can stay with TRACKING_CHUNK, or it has to change as well?
  3. Sorry if I was not clear about my intentions! Yes, the capability is attached to a player.
  4. Thanks for the help! I wanted to ask one last question: will PacketDistributor.TRACKING_CHUNK send the packet to the client with the actual player, who's data is being sent?
  5. Hello. I want to sync a player capability to every client that tracks a specific chunk, and I probably know the way to do it. However I'm worried about the other clients that did not receive the packet, as they might need this information later. Here is the problem: I don't know how to send this information to every new player who loads the chunk. As far as I know, the packet will only be sent when there is a change, but what about the players who did not even receive the first packet? Will they only receive the information when the change occur? eg.: if a player has 2 mana, and someone loads the chunk where this player is standing, will the client only receive this information after this capability changes to 3(change occur, so the packet will be sent), or there is a way to continuously sync this value to new clients?
  6. Hello! I want to render a text above each PlayerEntity. This text contains data that can and will change for each individual player, but I'm not sure how to properly override the renderer. I know that I have to use forge events to achieve this, but I don't know anything else. I'm also curious if that data is synced to other clients. I've tried to look up the way minecraft syncs player names but no luck. Any idea?
  7. I actually tried this. I don't think it's how it's should be done as the texture does not render. What am I doing wrong? bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); bufferbuilder.pos(-i - 1, -15 + verticalShift - 10, 0.0D).color(0.0f, 0.0f, 0.0f, f).endVertex(); bufferbuilder.pos(-i - 1, 8 + verticalShift - 10, 0.0D).color(0.0f, 0.0f, 0.0f, f).endVertex(); bufferbuilder.pos(i + 1, 8 + verticalShift - 10, 0.0D).color(0.0f, 0.0f, 0.0f, f).endVertex(); bufferbuilder.pos(i + 1, -15 + verticalShift - 10, 0.0D).color(0.0f, 0.0f, 0.0f, f).endVertex(); this.mc.getTextureManager().bindTexture(location); tessellator.draw();
  8. Yes, I managed to make my quad, I only need the image to be rendered, that's where I got stuck.
  9. Thanks for the help! However I still have problems with the image render part of the solution. Anywhere to go?
  10. Hello! I'm trying to render an image above my entity just as the label that displays the player's name. I've searched through the entity's render class, but I did not find anything related. When searched for this, I found a few examples but they most likely outdated, as they are from 2013. Can anyone help me out?
  11. Oh thank you! works just as I expected now with Minecraft's ResourceManager.
  12. I actually looked at the FontResourceManager class to get some ideas on what to pass in, then when I tried it myself I did not get anything at all. I was expecting to get a few json files from the vanilla font directory, but seems it works differently. Anyway that is the exact code I tried last time: public static void test(){ FallbackResourceManager r = new FallbackResourceManager(ResourcePackType.CLIENT_RESOURCES); Collection<ResourceLocation> res = r.getAllResourceLocations("font", (t) -> {return t.toLowerCase().endsWith(".json");}); Logger.getLogger("Log").info(String.valueOf(res.size())); for(ResourceLocation resource : res) { Logger.getLogger("Log").info(resource.getPath()); } } In the meantime I'm also trying to figure out the implementation.
  13. Thank you! I found it, however, I have problems with what to pass in to the pathIn parameter as most of the times it won't return anything for me. I've looked at some vanilla usages but after some tries, I came up empty handed.. Can you explain it for me, if you don't mind?
  14. Hello! I'm trying to get all files from one asset. For example I have a asset like this: "textures/gui/.." and I want to have all files from this asset in a List. I don't know if it's enough to describe what I need, but I hope You can get the point.
  15. Hello! I was wondering if anyone has any idea or advice on how to create a button that renders with a look of an arrow like this: Thanks a lot for anyone who has any info!
  16. Hello! I'm trying to begin learning how containers work, but the vanilla files are no help for me to understand them. I've been trying to find some guides but they are mostly outdated or useless. My questions are the following about them: how to use containers? A simple guide or a link would do. when to use them? how to use them correctly? and how to use containers without a TileEntity? Just like the MerchantContainer in vanilla. I appreciate any answer!
  17. I would be glad if someone who had this problem and solved it would answer. This thing is on my head for a few days now, and I can't really proceed with my code without this part. If You know some similar statement like this, I would be happy as well. however, I'll keep trying.
  18. The problem is with the statement asking if the "killer" of the entity is a player or not. It supposed to return false in the code below, if the player was the source, Sadly it returns true in every way public static void onMobKill(LivingDeathEvent e) { if(!(e.getSource().getTrueSource() instanceof PlayerEntity)) { return; } // do something here } I've also tried to reverse the statement like below, but the problem still remains public static void onMobKill(LivingDeathEvent e) { if(e.getSource().getTrueSource() instanceof PlayerEntity) { // do something here } } Any ideas?
  19. I meant this: Just to explain it a bit further: this statement returns true even if the player landed the last hit, and it pretty much worked for a few more tests, then it somehow changed. That was my main problem.
  20. Thank You! I wonder if You would have an answer to my first problem in the topic as well, as if that problem remains, I can't even experiment anything that You've said. It was pretty late when I wrote this topic, so if it needs more explanation, let me know!
  21. Thanks for Your answer! Let me explain a bit further: so let's say I have a friend online on one of my modded servers, my friend kills a pig for example, and in my capability this was the requirement for my capability to be changed. I meant if this is possible to have this event be called on my client as well even when I am not the killer of the pig, and if it does how would I be able to fix this?
  22. Hello! I am working with a LivingDeathEvent where I check if the causer of the kill is a player. This code actually worked before, but somehow after a few more testing it just "glitched". I'm already trying for a day now to figure this out. I've worked with IItemHandler when this happened, if it helps anything. What am I missing? I've read other topics as well, but no luck. Here is the code for this: public static void onMobKill(LivingDeathEvent e) { if(!(e.getSource().getTrueSource() instanceof PlayerEntity)) { return; } // do something here } Also another question with this: Will this work on servers as well? As far as I know, this event gets called each time someone kills an entity, and I'm changing player attached capability when this happens. I really don't want this to cause problems on servers. If I'm wrong somewhere, let me know!
  23. Sorry for the late reply, I was trying to find a way to figure out my problem. So for example I want to save a list of objects, the object has two properties, one string and one int, but You can imagine any type of properties as well from strings to items or blocks. I've tried to store a list of objects like this, but this is not working. Am I missing something? Is this possible with the capability system? I would really be happy about anyone's answer. If this is a bad approach, let me know as well.
  24. Hello. I want to save different kinds of information for each player, but I don't really know where to start. I need a flexible solution, so I can save objects as well. It should be possible as far as I know.
×
×
  • Create New...

Important Information

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