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

Cadiboo

Members
  • Posts

    3624
  • Joined

  • Last visited

  • Days Won

    58

Posts posted by Cadiboo

  1. 15 minutes ago, Doodle173 said:

    Is it possible to use OpenGL to create a feature like what I want, without causing issues with the actual Minecraft game engine?

    OpenGL is a rendering engine. If you want to have buttons like Minecraft's ones you should be using Minecraft's system.

     

    In your Screen, you’re going to want to have a Widget. This widget should be one of the children of your Screen. The widget can then set its position to the position of the mouse after it’s clicked and then stop setting its position when it’s clicked again.

  2. 2 hours ago, cat ote said:

    but how should i do that? the fleegoal is located inside the original squid ai, and i cant edit the original squid ai.

    AIs used to work off a task list and that task list used to be public. If they still work off a task list, you can just edit that list. Anyway, you’re not modifying the original squids AI, you’re modifying your squids AI. Correct me if I’m wrong but you can just instantiate your own subclass of FleeGoal and add it to your task list (after removing the original flee goal if necessary)

  3. 7 hours ago, Blazer Nitrox said:

    Actually, looking back on it, I'm still treating the items as though they're singletons... where were you seeing behavior that indicates otherwise?

    I was in a hurry when I wrote that and I noticed your setting/getting item refs and thought it could be an issue. I’m not sure what the issue is, can you please post your code on GitHub?

    • Like 1
  4. 17 minutes ago, Blazer Nitrox said:

    I have no idea if that a safe assumption to make in the wild, so I intend to test that a big more unless someone can shoot it down right here.

    You can add a priority to your @SubscribeEvent annotation to ensure you run before/after other listeners.

     

    One thing you may have forgotten is that Items are Singletons. I.E. there is only one (the one you register) in the game.

     

    Other than that I don’t see any glaring issues, you’ve debugged and noticed that neither your renderer or the vanilla arrow renderer is being called for your entity?

    • Like 1
  5. Everything you want to do is possible, but I’m general it causes bad things to happen and is highly discouraged. If you want to do what you’ve mentioned right and compatibly it will require quite a bit of work to do right as you will need to deal with situations where objects haven’t been registered when a client connects to a sever. How are you planning on handling this?

     

    You’re also going to need to handle all assets (models, textures) and data (recipes) in a compatible way that allows them to be overriden by resource and data packs.

     

    If you’re trying to register objects only if another mod is present, there are other, more compatible ways of adding mod-specific content.

    9 hours ago, dagobertdu94 said:

    Well, since 1.7.10 I ever registered my things in the preinit using the findRegistry command in GameRegistry, and in 1.14.4 and 1.15.2 I was forced to use that registry events since the findRegistry command in the GameRegistry was removed.

    You’ve been meant to use the registry events since 1.7.10. If everybody used the registry events correctly, dynamic registration would be possible, but people don’t and therefore supporting universal dynamic registration becomes impossible.

     

    If you were a bit more clear about what you were doing and why you might find that people were more helpful. For example instead of saying “I want to do something that is discouraged because of how difficult it is to do right and incompatible with badly made mods it is” you could lay out why you want to do this, what you plan on doing in your mod and how you’re planning on handling edge cases (such as unregistered objects on connection) to ensure that everything continues to work properly.

    • Like 1
  6. 3 hours ago, Blazer Nitrox said:

    Yeah, I'm loving the changes you guys made so far. Now that I'm getting used to it again everything feels a lot... I dunno, cleaner? It just seems like a much nicer experience than it used to be

    It was both Mojang and Forge that made these changes but I quite agree about hot it’s cleaner.

  7. 4 hours ago, diesieben07 said:

    Don't. It's borderline unreadable.

    Ouch, yeah.

    For anyone else who thinks of downloading it, here it is

    i tried copypasting the squid ai to my custom squid, but it gave a lot of bugs. here is my entitylist class:
    <ItemList class copied from HarryTalks or similar, static initialisers for EntityTypes>
    my MutantSquid class:
    <Copy past of minecraft entity squid class (maybe with a couple tweaks?)>
    and the vanilla squid class, for convenience:
    <Copy past of minecraft entity squid class>
    if you were to help me, thank you. i can't figure this one out by myself.

     

    37 minutes ago, cat ote said:

    Thanks, but you've set it up a couple folders too low. Here's what a properly set up GitHub repository should look like.

    While we're at it, here's what a proper registration class looks like and here's what a simple entity looks like.

    As you can see, the better way of doing entities is extending a vanilla class and then overriding behaviour.

    16 hours ago, cat ote said:

    i want my squid to act like normal squid, but swim towards boats, if none in the area players, and if it can't find those it will swim towards other entities. any entity it comes in contact with is dealt damage.

    I would do this by extending the squid and adding an AI task that swims towards a "target". I would also override the update method and periodically recalculate that target. I have no experience with AIs, so I'm not sure if that's the tight approach, but that's what I would start off with. If you keep checking my example mod, I'm planning on adding an AI that charges at players to my Wild Boar as soon as I get some spare time.

  8. 11 hours ago, cat ote said:

    i have put the code in this file, with all of my classes in which my entity is referenced and the original squid ai.

    Please use a service like GitHub, GitHub Gist or Pastebin for sharing code. Also don’t share Mojang’s intellectual property (their copyrighted code) online.

     

    Other than that, great question and I’ll come back to answer it once I’m on a device that can open that file.

  9. Use World#addEntity. Make sure to use EntityType#create, not the class constructor. You can then use Entity#setPosition (or similar).

    In future please try looking at the vanilla code first, it’s very helpful (you are modding their game) and you could have answered this question yourself by looking at any vanilla code that spawns an entity.

×
×
  • Create New...

Important Information

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