Jump to content

oznecniV97

Members
  • Posts

    35
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

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

oznecniV97's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Ok, I've found a solution. boolean open = true; Socket socket = SocketFactory.getDefault().createSocket(); try { socket.setSoTimeout(5000); socket.connect(new InetSocketAddress("127.0.0.1", 25565)); socket.close(); } catch (ConnectException e) { open = false; System.err.println(e); } Using this code, if the soker.connection method throw a ConnectException it means that my server is offline (or is starting), else the server is up and running.
  2. Sorry guys, did you know if there's an event like the FMLServerStoppingEvent but for the start event? I need to notify a remote server when my server is ready. (For ready I means that I can access on it with a minecraft client)
  3. This isn't the same topic. The previous one is a topic about an action after the server stop. This one is for stop the server based on an event. Thanks @IceMetalPunk for this solution. I know, it's strange that I want to stop the server using this method, but I need it because I have a "remote" server and I need to control it without really interact with it. (I know that I didn't explain my idea, but without explain all the environment is too complex to explain just this part ).
  4. Hi All, I need to stop my server based on an external text file. E.g.: I have a file in a folder called "server_info.txt". Now, if this file begins with "stop" I need to stop the server. Actually I read this file using the TickHandler (TickEvent.ServerTickEvent) every x minutes but I don't know if there's a possibility to stop the server using a method like "server.stop();" (?) Thanks.
  5. Do you think that is better? I thought about a server side mod just to do all inside the single command "java -jar mc_server.jar nogui" but if I can't do it I'll write an external bat to run this script after the previous command. With the second method it will works, right?
  6. I want to zip my world and upload it on a cloud after server stop because I switch between 2 pc's and I do this manually everytime. (a real boring action )
  7. Hi guys, I want to make a mod that do some actions (like do a post call to a WebServer or other things) after the stop command is launched on server console. p.s.: I know that if I add a command in the ServerStart.cmd as last command I can run another java application that do this, but I don't want to change that file. Thanks.
  8. Hi all, I want to play my .mp3 file (I don't know if .mp3 file is good or I need to convert to another one) when the player break a certain block with any item (or with none). My needs is a things like change the vanilla diamond ore breaking sound with a custom sound. Is it possible?
  9. You can try with this: Minecraft.getMinecraft().player.getArmorInventoryList().contains(mymod.head) Remember that getArmorInventoryList return an Iterable of ItemStack, not Item.
  10. For this I think that you can start from your "main" block and use it's position to check the other blocks beside. E.g.: Elven portal in Botania have a main block in the lowest part and this need to have 1 block in left part and one in righ part (and other blocks, but is an example). You can get the BlockPos of this main block and check if on x+1 and x-1 or z+1 and z-1 if there's the right blocks. I think that you can do this check on a TickHandler (I think that the best in this case can be the Server TickHandler). I don't know if there's some other more simplest methods to do that... UPDATE: Here you can find the Botania source code: https://github.com/Vazkii/Botania/tree/1.12
  11. Yes, this issue is basically related to the open phase of a GUI. If I short press E I see the inventory opened but in the console I can't see nothing (Same problem with L key Advancements). In the others cases (even the E press to close the inventory) I see it.
  12. This code works fine for the first slot in player inventory: Minecraft mc = Minecraft.getMinecraft(); mc.playerController.windowClick(mc.player.inventoryContainer.windowId, 9, 0, ClickType.PICKUP, mc.player); mc.playerController.windowClick(mc.player.inventoryContainer.windowId, -999, 0, ClickType.PICKUP, mc.player); The first instruction is the left mouse click (3° param is mouse click, 0 for left, 1 for right) on the first slot in player inventory (2° param is inventory slot (0-4 for crafting, 5-8 for armor, 9-35 for inventory)). The second instruction is the left mouse click out of inventory GUI (to drop it down). This code works fine with the inventory closed.
×
×
  • Create New...

Important Information

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