NEW API PLANET

Discussion in 'General' started by Nuclear, Aug 5, 2013.

  1. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    know the language of java
     
  2. Dunewolfz

    Dunewolfz He-who-has-no-morals-or-sense-of-logic.
    Staff Member

    Joined:
    Feb 23, 2013
    Messages:
    794
    Likes Received:
    155
    Because that would lag like crazy.
    Every time the world is generated further, the bubble would have to expand.
     
  3. heavyminecraftgamer

    Joined:
    Jul 8, 2013
    Messages:
    89
    Likes Received:
    4
    Temporary just until micdoodle8 adds the option for air.
     
  4. Dunewolfz

    Dunewolfz He-who-has-no-morals-or-sense-of-logic.
    Staff Member

    Joined:
    Feb 23, 2013
    Messages:
    794
    Likes Received:
    155
    The older builds had an Oxygen block, idk why Mic removed it.
    Granted, you had to spawn it in with TMI/NEI, but it worked just fine.
     
  5. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    // Hide certain items from NEI
    GCCoreBlocks.hiddenBlocks.add(GCCoreBlocks.airLockSeal.blockID);

    He is, he is simply hidden.
     
  6. jasonB221

    jasonB221 Member

    Joined:
    Jul 27, 2013
    Messages:
    124
    Likes Received:
    9
    Guys, the way MC works when travelling to a new dimension is it creates a new entity in the new dimension, copies all the data, and then deletes the old entity. Now, there is an interface in the api to allow entities to breathe without oxygen. If you extended the player class from a new entity, and implemented that interface, you could watch for an entity spawn event and if that entity is a player, copy the data to the new type of entity, delete the old one, and you would be good to go. Is it complex? Absolutely. Is it over the top? Definitely. Will it work? Maybe. I didn't bother to try it.
     
  7. jasonB221

    jasonB221 Member

    Joined:
    Jul 27, 2013
    Messages:
    124
    Likes Received:
    9
    The way I learned java was through some classes and mostly looking at other people's code. I still do that when trying to make my addon. Mic's code is great for learning off of, and if you want to make an addon, you need to take a look at it.
     
  8. 19abaranet

    19abaranet Member

    Joined:
    Aug 7, 2013
    Messages:
    102
    Likes Received:
    5
  9. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    I've already seen it, but I still do not understand how to make the air on their planet. He may be added to Use API but not explained.
     
  10. jasonB221

    jasonB221 Member

    Joined:
    Jul 27, 2013
    Messages:
    124
    Likes Received:
    9
    If you know basic forge, then he added an event. When that even is called, you would check to see if the dimension the entity being damaged is the dimension you want to have air in. If so, cancel the event.
    Simple.
     
  11. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    I for some reason it does not work, you can give an example?
     
  12. jasonB221

    jasonB221 Member

    Joined:
    Jul 27, 2013
    Messages:
    124
    Likes Received:
    9
    http://pastebin.com/f1JiYh7q
    Thats the basics of it.
    You may also want to review forge event handling if none of this makes sense to you.
     
    denis likes this.
  13. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    I can not figure out what to put on the provider ... Can you help?
     
  14. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    Code:
    public class GCPrometheusEvents
    {
        WorldProvider provider;
       
        @ForgeSubscribe
        public void cancelDamage(Pre event)
        {
               
                try
                {
                    if(provider.dimensionId == GCPrometheusConfigManager.dimensionIDPrometheus)
                    {
                        event.setCanceled(true);
                    }
                    else
                    {
                        event.setCanceled(false);
                    }
    
                }
                catch (Exception e)
                {
                    GCLog.info("Problem with air.");
                    e.printStackTrace();
                }
           
               
        }
    }
    
    What is wrong here?
     
  15. jasonB221

    jasonB221 Member

    Joined:
    Jul 27, 2013
    Messages:
    124
    Likes Received:
    9
    What's wrong is that you did not initialize the provider variable. Your problem is a basic java one. If you don't know java, there isn't much I can help you with. However, to initialize it, use provider = event.provider;
    That is the line of code you are missing.
     
  16. denis

    denis Member

    Joined:
    Apr 22, 2013
    Messages:
    40
    Likes Received:
    0
    on a new planet with oxygen does not work:
    1. the light and all that emits light
    2. torches do not burn
    3. constant message Oxygen Setup is Invalid!
    4. blank background
     
  17. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    Already fixed a it.
     
  18. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    Thank you very much for your help!
     
  19. fadi

    fadi Member

    Joined:
    Aug 7, 2013
    Messages:
    85
    Likes Received:
    1
    How to Make a planet Like Mars please Help Me!!!!
     
  20. Nuclear

    Nuclear Member

    Joined:
    Jun 24, 2013
    Messages:
    27
    Likes Received:
    0
    This requires at least a basic knowledge of Java.
     

Share This Page