Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Plugin development support for C++ and Java/JavaScript

Comments in 'Plugin Development' started by Tester_master, Feb 16, 2016.

  1. Tester_master
    Offline

    Tester_master Active Member

    Joined:
    Dec 10, 2015
    Posts:
    95
    Minecraft User:
    Tester_master
    There should be support for C++ Java and JavaScript for coding plugins with C++ it would be like this int getEconomyAPI and for Java and JavaScript it would be different and since MCPE was coded in C++ and other people are good with other coding languages except not php
  2. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Plugins can only be written in the language the software is written in. PocketMine is written in PHp, therefore plugins must be written in php. If you want to make Java plugins, use Nukkit, C# plugins for MiNET or whatever other software you desire.

    And why are you making Java snd Javascript sound like they are related in some way? They are are totally different languages used for different things.
    KubixQ, Vaivez66 and applqpak like this.
  3. Tester_master
    Offline

    Tester_master Active Member

    Joined:
    Dec 10, 2015
    Posts:
    95
    Minecraft User:
    Tester_master
    I never said they were the same
  4. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    He never said that you said that they're the same.

    You are sounding like they're the same. Java and JavaScript are completely different to each other.
    Hotshot_9930 and Vaivez66 like this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It is possible. My concept is like this (I am more familiar with Java within the other languages mentioned, so I will use Java as example):
    • PocketMine-end plugin loader (you can register new plugin loaders in PocketMine like DevTools) (I will call it PHP End in the future) starts a Java process (I call it Java End).
    • When a Java plugin should be loaded, the PHP End, through a stdin pipe, sends a signal to the Java End.
    • The Java End should expose API methods in Java prototypes. To implement these methods, use the stdout pipe to send a signal to the PHP End.
    • The PHP End can use the stdin pipe to send signals to the Java End to trigger certain methods, such as PluginBase::eek:nCommand(), event handlers, etc.
    But when I read again what I wrote, it seems like that you would simply make the server more laggy if you do it this way. All those signal sending processes may slightly to vigorously increase server load, unless it is done in a separate thread. But in this way, it won't be able to do un-delay-able things like cancelling events. Though, there is also a way to overcome them - say, if you want to cancel an EntityDamageEvent, it mightn't hurt to cancel it first then fire it again (and implement what would happen if it is not cancelled). Or would it? This greatly depends. Overall, it is not a good idea to create a Java bridge with this method.
    applqpak likes this.

Share This Page

Advertisement