Jump to content

uiytt

Members
  • Posts

    67
  • Joined

  • Last visited

Posts posted by uiytt

  1. Well I tried :

    Minecraft.getInstance().runImmediately(new Runnable() {
    	@Override
    	public void run() {
    		MultiPlayerGui.this.minecraft.displayGuiScreen(new ConnectingScreen(MultiPlayerGui.this, MultiPlayerGui.this.minecraft, server));
    	}
    });

    And it's really weird...

    In my console, I receive everything from the server chat. But on my game, it's stuck on loading the terrain infinitely !!!

    MultiPlayerGui is my custome class but the rest is not..

    I don't undersant why O_o

  2. So,

    I have two thread : The first one is the one of minecraft, the second one is async thread that I created to do something on the web.

    I would like that when the second thread is done, the first thread execute a method ( and not the second thread because minecraft really doesn't like when you use method using another thread).

    Before the second thread ended, the first thread must continue working.

    Does anyone have any idea of how to do that please ?

     

  3. Hello, I'm looking for a way to change some things in the server list (like add a button and other things)

    My idea was to create a new class which extends "MultiplayerScreen"

    And then use the InitGuiEvent and override the GUI with mine.

    But I can't find a way in the event to override the GUI (we only have access to the getter)

    Does someone know how to solve that ?

    Thanks ^^

  4. 10 hours ago, TheGreyGhost said:

    You can register either the class or an instance, but it affects which methods get checked for events!

     

    If you register the class: static methods are checked for events

    If you register an instance of the class, non-static methods are checked for events.

     

    In this case I think you've registered it correctly.

    I suggest you troubleshoot it by putting a breakpoint in the forge code, at the point that it posts the DifficultyChangeEvent.

    That will tell you if your registration has failed.

    (Search project and library for usages of DifficultyChangeEvent)

     

    -TGG

    AH

    it seems that the problem only comes from DifficultyChangeEvent.
    I don't care about this event, I only used it as a test, it works fine with another event...

    So yeah my events work :D

  5. Hi, I really don't understand why my even is never fired...

    package fr.uiytt.test;
    import net.minecraftforge.event.DifficultyChangeEvent;
    import net.minecraftforge.eventbus.api.SubscribeEvent;
    
    public class Events {
    
    	
    	@SubscribeEvent
    	public void test(final DifficultyChangeEvent event) {
    		System.out.println("test1 " + event.getDifficulty().getTranslationKey());
    	}
    	
    	
    }

     

    I have declared it in my mod main class with :

    MinecraftForge.EVENT_BUS.register(new Events());

    Thanks for your help

  6. 1 hour ago, ChampionAsh5357 said:

    I would recommend going into net.minecraftforge.common.ForgeModConfig and the net.minecraftforge.fml.config package in the source and looking at how they setup and register it. Then all you need to do is register the config in your main mod file's constructor using ModLoadingContext#registerConfig. The best I can do for a visual example is my classes for the Config and Main Mod File.

    Thanks, I have another question. If I didn't register a config,

    How can I get in my Init event the config folder (where every config are store in).

    I would like to use another storage system way more enjoyable to use and thus I need to know where is the folder where it's supposed to go ^^

  7. 1 hour ago, ChampionAsh5357 said:

    If you have registered your configuration file, it should be in run/config/whatyounamedit.toml The default name would be modid-side.toml If you do not know where your run folder is, it should be in the same directory as your src folder that you are currently working on. Note you do have to run the game once to generate the configuration file.

    Oh wait, I don't know how the config file work after 1.11, can you link me to any tuto there is on this subject (I didn't found any)

  8. So I'm trying to detect on the server side when a player take an item from any container,

    Someone said that he think that was possible using container listener.

    I guess I need to do something like that :

    event.getContainer().addListener(); 

    But I've absolute no idea of how listener work or even what listener exist ?

    Can anyone help me  ? (even if it's not possible to detect when an item is taken, I still think it might be a useful information to know how listeners work ^^)

  9. 10 minutes ago, diesieben07 said:

    Why not? I do not see anything you've said that cannot be done.

     

    When using a combination of the two event, one of them (PlayerEvent.RightClickBlock) will also be called at the same time as BlockEvent.PlaceEvent,

    I want to do an action only if a player rightclick on another block without placing a block, and you said there is no way to do what I want :(

  10. 1 minute ago, diesieben07 said:

    There.

    Is.
    None.

    Well I hope that someone have already encounter the same problem and with a bit chance he founds a solution (and you're not aware),

    So I will let this open in a hope that someone has a solution that work because using a combination  of the two event won't work for what I want to do :/

     

    And is there any events that is triggered when a item is picked up from an inventory (chest, furnace ?)

  11. 1 minute ago, diesieben07 said:

    PlayerEvent.RightClickBlock. 

    I am not sure how often I have to say this for you to start reading it.

    PlayerEvent.RightClickBlock.  won't work because it's also triggered when a block is placed :/

     

    If I use both PlayerEvent.RightClickBlock  and BlockEvent.PlaceEvent, PlayerEvent.RightClickBlock  is also called when BlockEvent.PlaceEvent is triggered and my goal is to find a way around this...

  12. 51 minutes ago, diesieben07 said:

    Correct. There is no way to know before the block is placed if a block is going to be placed. You have to use BlockEvent.PlaceEvent.

    So there is no way when right clicking to know if it's placing a block or not ? :'c ?

    So with even it's impossible to send "a" in the chat when a player place a block, and "b" in the chat when a player open a container ?

×
×
  • Create New...

Important Information

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