Navigation

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SOLVED Essai de la resolution du register et du can't use a null-name for the registry

    1.12.x
    1.12.2
    1
    2
    29
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JustAnDev
      JustAnDev last edited by

      Bonjour pour un projet j’ai crée un mod(SAO2) et j’ai cherché un register et j’ai trouvé un code .Mais il faut un string sinon : can’t use a null-name for the registry .Et je sais pas comment le mettre
      Donc, HELP!

      l’init de la classe principale(oui je n’utilise pas d’autre classes)

       	    @EventHandler
      	    public void init(FMLInitializationEvent event)
      	    {
      	    	 proxy.init();
      	    	 laserSword = new SwordLaser(swordLaser).setUnlocalizedName("tutoriel");
      	    	 
      	    	 ModSwordArtOnlineII.registerItems(laserSword);
      	    	
      	    	 }
      	    public static void setItemName(Item item, String name)
      	    {
      	        // ici on va attribuer un nom à nos objets
      	        item.setRegistryName(ModSwordArtOnlineII.MODID, name).setUnlocalizedName(ModSwordArtOnlineII.MODID + "." + name);
      	    }
      	    private static void registerItems(Item item) {
      			// TODO Auto-generated method stub
      	    	ForgeRegistries.ITEMS.register(item);
      	    	ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
      	    }                                                                                      
      

      Merci!

      1 Reply Last reply Reply Quote 0
      • JustAnDev
        JustAnDev last edited by

        EDIT:Resolu vous pouvez close

        1 Reply Last reply Reply Quote 0
        • JustAnDev
          JustAnDev last edited by

          EDIT:Resolu vous pouvez close

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Design by Woryk
          Contact / Mentions Légales / Faire un don

          MINECRAFT FORGE FRANCE © 2018

          Powered by NodeBB