1.13 I got white blocks.

Discussion in 'Spigot Plugin Development' started by Citywars, Aug 18, 2018.

  1. I am working to supporting my plugin for 1.13.
    In 1.12 stained clay is red and in 1.13 is it white.
    How to fix?

    Code:
    Code (Text):
    Material material = Material.getMaterial(Main.plugin.getConfig().getString("Tornado-Block"));

    Main.spawnTornado(Main.plugin, p.getLocation(), material, (byte) Main.plugin.getConfig().getInt("Tornado-DataValue"), new Vector(2, 0, 2), 0.1, 100, (long) 30*20, false, false);
     
  2. My config:
    Code (Text):
    #                                                                                                           - O X #
    #   RealisticMC Command Tutorial                                                                                  #
    #   /rmcadd <effect-name> <world> | You have added this world with the effect name to the enabled-worlds!         #
    #   /rmcremove <effect-name> <world> | You have removed this world with the effect name from the enabled-worlds!  #
    #                                                                                                                 #
    #   Effects:                                                                                                      #
    #   TNT-Explosions                                                                                                #
    #   Falling-Blocks                                                                                                #
    #   RealisticTrees                                                                                                #
    #   Blood-Effects                                                                                                 #
    #   Tornado                                                                                                       #
    #   Fall-Effect                                                                                                   #
    #   Small-ArmorStand/Armed-ArmorStand                                                                             #
    #   Dead-Trees                                                                                                    #
    #   Balloons                                                                                                      #
    #   Eat-Effect                                                                                                    #
    #   Realistic-Grow                                                                                                #
    #                                                                                                                 #
    #   Minecraft Sounds: https://www.spigotmc.org/wiki/cc-sounds-list/                                               #
    # ------------------------------------------------ Configuration -------------------------------------------------#                        
    TNT-Explosions-Worlds:                        
    - world                                  
    Falling-Blocks-Worlds:                        
    - world                                      
    RealisticTrees-Worlds:                        
    - world
    Blood-Effects-Worlds:                        
    - world  
    Tornado-Worlds:
    - world
    Dead-Trees-Worlds:
    - world
    Fall-Effect-Worlds:
    - world
    Armed-ArmorStand-Worlds:
    - world
    Small-ArmorStand-Worlds:
    - world
    Balloons-Worlds:
    - world  
    Eat-Effect-Worlds:
    - world        
    Realistic-Grow-Worlds:
    - world
    TNT-Explosions: true
    Falling-Blocks: false
    RealisticTrees: true
    Blood-Effects: true
    Tornado-Effect: true
    Small-Tornado: true
    Dead-Trees: true
    Fall-Effect: true
    Balloons: true
    Small-Armorstand: false
    Armed-Armorstand: true
    Eat-Effect: true
    Realistic-Grow: true
    TNT-Explosions-WorldGuard: false
    Fall-Effect-Sound: true
    Tornado-Block: RED_STAINED_CLAY
    command-prefix: '&7[&eRealisticMC&7]'
    reload-command: '%prefix% &aYou have reloaded the configuration file!'
    add-world: '%prefix% &aYou have added world %world% to enabled-worlds!'
    remove-world: '%prefix% &cYou have removed %world% from enabled-worlds!'
    error-remove-world: '%prefix% &cThe world %world% does not exist in the enabled worlds'
    no-permission: '%prefix% &cYou don''t have the permission for this command!'
    already-added-world: '%prefix% &cYou have already added this world to the enabled-worlds!'
    need-effect-name: '%prefix% &cYou need to enter a effect name to this command!'
    need-world-name: '%prefix% &cYou need to enter a world name to this command!'
    spawned-tornado: '%prefix% &aYou have spawned a tornado to your location!'
    no-location-tornado: '%prefix% &cYou need to enter x, y, z to execute.'
    balloon-despawned: '%prefix% &cYou have unequipped your current balloon!'
    configuration-updated: '%prefix% &aYou have succesful updated the value!'
    Help-List:
    - '&e&l&m---------------------------------------------'
    - '&7'
    - '&e&lRealisticMC'
    - '&7Version: 4.5r'
    - '&7'
    - '&e&l* &7/rmcadd | &8To add the world to the enabled-worlds.'
    - '&e&l* &7/rmcremove | &8To remove the world from enabled-worlds.'
    - '&e&l* &7/rmctornado <spawn> [x, y, z] | &8To spawn a tornado.'
    - '&e&l* &7/rmcballoon [Red, Green, Blue, Yellow, Purple] | &8Equip a balloon.'
    - '&e&l* &7/rmcballoon stop | &8To despawn your selected balloon.'
    - '&e&l* &7/rmcopen [BalloonGUI] | &8To open the Balloon Selector.'
    - '&e&l* &7/rmcconfig | &8To configure the plugin with a GUI.'
    - '&e&l* &7/rmcreload | &8To reload the configuration file.'
    - '&e&l* &7/rmchelp | &8To show the help list with all the commands.'
    - '&7'
    - '&c[] Required &7| &8<> Optional'
    - '&7'
    - '&e&l&m---------------------------------------------'
    open-gui-error: '%prefix% &cThis GUI cannot opened because its doesn''t exist.'
    BalloonGUI-Name: 'Balloons Selector'
    balloon-spawned: '%prefix% &aYou have spawned a %type% balloon to your location!'
    balloon-name: '%prefix% &cYou need to enter a balloon name to this command!'
    balloon-type-red: 'Red'
    balloon-type-blue: 'Blue'
    balloon-type-yellow: 'Yellow'
    balloon-type-green: 'Green'
    balloon-type-purple: 'Purple'
    balloon-type-unequip: 'Unequip'
    BalloonGUI-Lore:
    - '&8Balloon Selector'
    - ''
    - '&7In this menu you can select'
    - '&7your own balloons. Click on a'
    - '&7balloon to equip!'
    - ''
    - '&eClick to equip!'
    BalloonGUI-Unequip-Lore:
    - '&8Balloon Selector'
    - ''
    - '&7In this menu you can select'
    - '&7your own balloons. Click on this'
    - '&7item to unequip!'
    - ''
    - '&eClick to unequip!'
    Spawn-Tornado-Sounds-1: ENTITY_WITHER_DEATH
    Spawn-Tornado-Sounds-2: ENTITY_WITHER_HURT
    Dead-Trees-Sounds: ENTITY_CHICKEN_EGG
    Balloon-Update-Time: 20
    Eat-Effect-Particles:
    LARGE-CLOUDS: 1
    SPELL-PARTICLES: true
     
  3. 1.13 no longer has data values, use Material.RED_CLAY or something like that.
     
  4. Doesn't work. :\
     
  5. ? I mean like Stained Clay
     
  6. Choco

    Moderator

    Stained clay was renamed to terracotta. RED_TERRACOTTA is the material you're looking for.
     
    • Like Like x 1
    • Informative Informative x 1
  7. Material cannot be null. I also don't see it as material in Java Eclipse?
     

    Attached Files:

  8. Choco

    Moderator

    Either you're depending on the 1.12 API only or you have the 1.12 API as a higher priority than that of 1.13. Supporting 1.12 - 1.13 is near impossible, especially if you're using the Material constant. It's recommended that you drop anything that is not the latest, or build and maintain two separate versions.
     
    • Agree Agree x 1
  9. So what to change?
    Code (Text):
        @SuppressWarnings("unused")
        @Override
          public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
          {
              if (cmd.getName().equalsIgnoreCase("rmctornado")) {
                  Player p = (Player) sender;
                  if (args.length == 0) {
                      if (p.hasPermission("realisticmc.tornado"))  {
                            if (config.getBoolean("Tornado-Effect")) {

                                if (Main.plugin.getConfig().getStringList("Tornado-Worlds").contains(p.getLocation().getWorld().getName())) {
                                    Material material = Material.getMaterial(Main.plugin.getConfig().getString("Tornado-Block"));
                                    Location location = p.getLocation();
                                    p.playSound(location, Sound.valueOf(configsound), 1, 0);
                                    p.playSound(location, Sound.valueOf(configsound1), 1, 0);
                                    location.getWorld().playEffect(location, Effect.MOBSPAWNER_FLAMES, 2004);
                               sender.sendMessage(Main.plugin.getConfig().getString("spawned-tornado").replaceAll("&", "§").replaceAll("%prefix%", Main.plugin.getConfig().getString("command-prefix").replaceAll("&", "§")));
                            Vector vec = new Vector(2, 2, 2);
                            Main.spawnTornado(Main.plugin, p.getLocation(), material, (byte) Main.plugin.getConfig().getInt("Tornado-DataValue"), new Vector(2, 0, 2), 0.1, 100, (long) 30*20, false, false);
                            } }}else { sender.sendMessage(Main.plugin.getConfig().getString("no-permission").replaceAll("&", "§").replaceAll("%prefix%", Main.plugin.getConfig().getString("command-prefix").replaceAll("&", "§")));
                     
                     
                            }
                     
                      }
     
  10. He literally told you the anwser.
     
  11. Perhaps you should change 'api-version' in plugin.yml to '1.13'.
    Code (Text):
    api-version: 1.13
     
  12. Please I there NO way that I can fix it in ONE plugin.
    Because If I need to make a whole 1.13 version of my plugin, then I'm dying.
    OMG.png
     
    • Funny Funny x 1
  13. 1.13 is completely different from 1.12. The best thing that you can do is to use the compatibility mode (not writing api-version) and using one of the libraries mad by Spiogot users to convert old Material values into new ones.
     
  14. How to do that?
     
  15. I think my eyes are bleeding
    [​IMG]

    EDIT: Please, please, please, learn how to use loops.
     
    • Winner Winner x 1
  16. Wow, this is literally the example from your Let's Talk IDEs thread.
     
    • Funny Funny x 1
  17. Choco

    Moderator

    I didn't... mention... IDEs? I'm confused... I said quite literally what was already stated on the main announcement thread for Bukkit 1.13
    Or are you referring to the fact that it was a Material-based question much like in my thread? :p
     
  18. [​IMG]
     
    • Funny Funny x 1