Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Abastro

Abastro

Forge Modder
 View Profile  See their activity
  • Content Count

    1075
  • Joined

    July 13, 2013
  • Last visited

    August 21, 2018
  • Days Won

    2

 Content Type 

  • All Activity

Profiles

  • Status Updates
  • Status Replies

Forums

  • Topics
  • Posts

Calendar

  • Events

Posts posted by Abastro

  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • Page 1 of 43  
  1. [1.12.1]TileEntity how do I sync data between server and client

    in Modder Support

    Posted June 7, 2018


    25 minutes ago, Ice2670 said:

    Hello, I have similar problem with client server synchronization, it's just I want to update energy in my TE to client every tick, but I do not find there code can update custom data in TE.

    Don't bump an over-half-year-old thread. Just make your own issue thread with what you've tried.

  2. [1.12.2] setRenderViewEntity issue

    in Modder Support

    Posted June 7, 2018


    3 hours ago, qazqazqaz said:

    Thanks for the suggestion. However, my interpretation of zoom here is translating the camera further away from the player rather than adjusting the FOV.

    Oh, you meant zooming in/out from the player.

    IDK about this issue, setting the render view entity should work well.

  3. [1.12.2] setRenderViewEntity issue

    in Modder Support

    Posted June 6, 2018


    A bit unrelated note, you don't need a coremod for zoom. There's  FOVUpdateEvent for that.

  4. Server sided localized messages

    in Modder Support

    Posted January 14, 2018


    As Draco said, you can use %s for that. (I didn't know whether '{}' works or not - I always use %s)

    In my experience, anything beyond %s doesn't work.

     

    And as far as I know it's hard to change lang file on the fly(during runtime). You'll need reflection hackery. Why do you need it?

  5. Configuration sync with server

    in Modder Support

    Posted January 14, 2018


    5 hours ago, SirWindfield said:

    Ye but the only way to do the syncing is by making the fields non static so each instance has actually other values, am I right? But that would conflict with the configuration annotation api. Because that api actually expects values to be static. 

    Quite upset that those two APIs can't work together. But creating a GUI for a simple Configuration is not hard at all. So I will probably just make the fields non static and use instances then. Thanks.

    Ah, I didn't read your code carefully. As Choonster said, you don't have to make every fields static. Just the field holding the whole configuration need to be static. You can create a new class containing all the configuration fields.

    You can do as what Choonster said. You can store the client configuration fields in any class/instance you want if you use it properly. I prefer to put it in either the mod instance or the network instance which can be accessed from the mod instance.

  6. Server sided localized messages

    in Modder Support

    Posted January 14, 2018


    1 hour ago, SirWindfield said:

    Is there some way to load the lang files server side

    No, the only way you can use will be using server resourcepacks(the one which is only applied when the user allows it). Languages are considered as resources, so you can't modify it with the server-only mod. Also you can't get the server locale.

    1 hour ago, SirWindfield said:

    Another question that is similar to this one. I tried formatting the text and making it dynamic by including placeholders: "Some string needs {} argument". But that doesn't work. I couldn't find any information on placeholders within the localization framework.

    Would someone tell me the right placeholder syntax to make the following call possible? 

    
    new TextComponentTranslation("key", argumentOfTypeString);

     

    You need to specify details like {} on lang file.

    For the translation component "key", you set something like 'key=the string is {}'.

  7. Configuration sync with server

    in Modder Support

    Posted January 14, 2018


    13 hours ago, SirWindfield said:

    Making a new instance of RPConfiguration is not possible if you use the @Config annotations since your fields have to be static. 

    At least for me, the annotation system has no way to actually set the fields manually since you have not access to the underlying Configuration instance.

    @diesieben07 did post solutions, but those did not involve the new annotation system introduced in 1.12.

    Well, why can't you get and set the fields when it's not final?

    Also you can create instance of RPConfiguration since it's not final. You need separate instance than the static one anyway, considering the combined client. Just send sync packet based on the static configuration and setup separate client config with the packet. 

    Anyway, forge does not have any tool for this. You have to do it yourself.

  8. @LangKey for @Comment

    in Modder Support

    Posted January 13, 2018


    You mean the tooltip? Because there's no way to translate comments...

    Then 

    config.modid.common.enabled.name.tooltip

    will work. Just put the appropriate tooltip for the key in the lang file.

  9. Configuration sync with server

    in Modder Support

    Posted January 13, 2018


    How to implement it is just a matter of choice.

    You can make a new instance of the RPConfiguration class on client and manually sync the fields. Forge won't do any server-client syncing for you.

     

    Or, you could just wait till 1.13 like me, it introduces synchronized data packs.

  10. [1.10.2] ForgeRegistries.ITEMS.register or GameRegistry.register(item)?

    in Modder Support

    Posted January 5, 2018


    5 minutes ago, mooL said:

    what do you mean by private and internal? as in only minecraft itself uses it, and not modders?

    Minecraft Forge uses it internally, if I recall correctly.

    It's recommended to use register events: https://mcforge.readthedocs.io/en/latest/concepts/registries/

  11. [Render] [Tessellator] Efficiently drawing lines

    in Modder Support

    Posted January 5, 2018


    2 hours ago, uranophane said:

    By directly making openGL calls, perhaps?

    It's prohibited due to performance, so...

     

    Why do you need thousands of wireframe cubes in the first place? I guess that's the part where many optimizations can take in place.

    Also it's better not to update thousands of vertices every frame. Store them in a VBO and only update it when it's needed. (AFAIK this is also done with chunk rendering. There should be tools for that)

    Don't call draw many times, it should be one main source of lag. Speedup of 2x is really a BIG improvement, actually. Instead, varying width lines can be done better with quads. Just play with some trigs and coordinates to find the orientation.

  12. Detect another mod's entity

    in Modder Support

    Posted September 29, 2017


    2 hours ago, Insane96MCP said:

    And if I don't have access to source code? So I don't know the Entity class?

    Well. @ObjectHolder requires Entity ID, not class.

    If you took a glance on EntityEntry, you must've found that it holds the class you need...

    So check for entity with the class.

  13. Detect another mod's entity

    in Modder Support

    Posted September 24, 2017 · Edited September 24, 2017 by Abastro


    If you are on the latest version, afaik it's better to check with EntityEntry registry. Use @ObjectHolder to get the entry and check if the class is the same with the class from the entry.

  14. [1.12.1]TileEntity how do I sync data between server and client

    in Modder Support

    Posted September 23, 2017


    AFAIK notifyBlockUpdate is sufficient.

    It works both on TEs and Blocks, GiantNuker.

  15. [1.12.1]TileEntity how do I sync data between server and client

    in Modder Support

    Posted September 23, 2017 · Edited September 23, 2017 by Abastro


    12 minutes ago, GiantNuker said:

    Do I need to notify every client when a portal activates/deactivates?

    Yes, you should notify it every time something client-related changes.

    Call World::notifyBlockUpdate with the current blockstate for both old and new for that.

  16. 1.12.1 Advancements using Universal Bucket

    in Modder Support

    Posted September 22, 2017 · Edited September 22, 2017 by Abastro


    Probably OredictItemPredicate class and this:

    https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/test/resources/assets/oredict_predicate/advancements/recipes/wood_unlock_tnt.json

    And this is rather fully-fledged with criterion, but could be help.

    https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/test/java/net/minecraftforge/debug/OredictItemPredicateTest.java

  17. 1.12.1 Advancements using Universal Bucket

    in Modder Support

    Posted September 22, 2017


    The factory is for recipes, you need to register ItemPredicate to ItemPredicates.

  18. [1.10.2+] Item for each entity

    in Modder Support

    Posted September 21, 2017


    First, you'll need an item with the DNA capability. I guess it should contain the id of the entity type, but it could vary per what you want.

    Now I think you don't need DNA caps on entity side. Just iterate through the entity registry to check existing entity types, and do what you want with it. Just don't register items based on entity types. 

    And again, actual implementation varies per what you need - like, how would you use the DNA item? Should it be extracted from the entity? Does dna information vary per each entity-in this case you need entity caps-?

  19. [1.12.1]TileEntity Freeze-Up

    in Modder Support

    Posted September 21, 2017


    4 hours ago, GiantNuker said:
    
    if (!pylon.canDrawFrom(user)) {
    					pylons.remove(pylon);
    					continue;
    				}

    canDrawFrom has this line

    
    if (this.getCurrentMana() <= 0) return false;

    getCurrenMana & hasPool

    
    public boolean hasPool() {
    		return world.getTileEntity(pos.down()) instanceof IManaPool;
    	}
    	
    	public int getCurrentMana() {
    		if (!hasPool()) return 0;
    		return ((IManaPool)world.getTileEntity(pos.down())).getCurrentMana();
    	}

     

    What do you want to say by that? Still the takeMana method can return unchanged value, e.g. when the pylon is off.

    I guess there could be more bugs causing strange effects. So you should know how to debug, which is basic java skill as well.

    So. Do you know basic java?

  20. Not Minecraft-related objects as a mod (Cars, etc.) - MC 1.12.1

    in Modder Support

    Posted September 21, 2017


    You can do what @jabelar said, or afaik you can perform collision checks yourself by having big AABB collision bound containing all the possible bounds and check the real bounds later in the collision method.

  21. [1.10.2] Capabilities unsynced when opening Creative inventory

    in Modder Support

    Posted September 21, 2017 · Edited September 21, 2017 by Abastro


    Maybe this could help with your issue.

  22. [1.12.1]TileEntity Freeze-Up

    in Modder Support

    Posted September 21, 2017


    You should eliminate the case where nothing changes during the loop which calls for the infinite loop.

    Here, takeMana can return mana unchanged in the loop. It shouldn't be doing that.

  23. [1.10.2+] Item for each entity

    in Modder Support

    Posted September 20, 2017


    I'd recommend to have one item to represent all DNAs, as existence of item shouldn't be variable.

    Then you can use capabilities to store anf expose the DNA.

  24. [Solved][1.12.1] Proper way to contribute pull requests to Forge

    in Modder Support

    Posted September 20, 2017 · Edited September 20, 2017 by Abastro


    https://github.com/MinecraftForge/MinecraftForge/wiki/If-you-want-to-contribute-to-Forge

    + I think it's better to create a new branch for the case when you make multiple PRs at once. Also, afaik it should be on new workspace.

  25. Not Minecraft-related objects as a mod (Cars, etc.) - MC 1.12.1

    in Modder Support

    Posted September 19, 2017


    In case of cars, I think it can be classified as an entity because it's in the world and can move with some restrictions. There are several mods implementing that - the only problem here I could see is the collision issues.

     

    On the other hand, do you have genuine custom objects which is close to nonexistent in MC, like stars?

    • Like 1
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • Page 1 of 43  
  • All Activity
  • Home
  • Abastro
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community