Jump to content

Is there a way to remove the block sections from the model location in blockstates


Discult

Recommended Posts

in my blockstate for rendering my model i want to redirect it from models/block/ to models/item/  but i dont know how i would do it.

 

what is shows in log:

saomod:block/item/weapon/starter/sword/starter_sword.obj

 

what i have in json:

saomod:item/weapon/starter/sword/starter_sword.obj

 

Link to comment
Share on other sites

Where is your OBJ file located?

 

and what does your code for the item look like?

 

Edited by Animus_Surge

Forge 1.8.9 and below are not supported in the forums anymore. Please upgrade to a later version.

 

My experimental mod: new GitHub page to be created... (Add your favorite TCGs in MC! [WIP])

 

When asking for assistance with modding or making mods, paste the log (located in .minecraft/logs folder for mod users or in the console for mod makers).

Link to comment
Share on other sites

1 hour ago, Animus_Surge said:

Where is your OBJ file located?

 

and what does your code for the item look like?

 

It is located in models/item/weapon/starter/sword/starter_sword.obj but with the blockstate setup it forces me to use block instead of item

i am wondering if there is a way to fix this

 

Link to comment
Share on other sites

1 hour ago, Discult said:

models/item/weapon/starter/sword/starter_sword.obj

ok I would try to instead of having the package like:

*.models.item.weapon.starter.sword

I would have it like:

*.models.item.weapon

for right now.

1 hour ago, Discult said:

with the blockstate setup it forces me to use block instead of item

That is common. It makes you use 'block' instead of 'item' unless you're not using a 3D model. Then it has you using 'block'. Can you paste your code and JSON setup for the weapon's class

Forge 1.8.9 and below are not supported in the forums anymore. Please upgrade to a later version.

 

My experimental mod: new GitHub page to be created... (Add your favorite TCGs in MC! [WIP])

 

When asking for assistance with modding or making mods, paste the log (located in .minecraft/logs folder for mod users or in the console for mod makers).

Link to comment
Share on other sites

2 minutes ago, Animus_Surge said:

ok I would try to instead of having the package like:

*.models.item.weapon.starter.sword

I would have it like:

*.models.item.weapon

for right now.

That is common. It makes you use 'block' instead of 'item' unless you're not using a 3D model. Then it has you using 'block'. Can you paste your code and JSON setup for the weapon's class

i have the model loading i am just wondering if i can change it to ask for the item folder instead of the block folder in the blockstate cause i am loading a obj model for the items so i have to do it in blockstate

 

Link to comment
Share on other sites

7 minutes ago, Animus_Surge said:

Can you paste your code and JSON setup for the weapon's class

 

Forge 1.8.9 and below are not supported in the forums anymore. Please upgrade to a later version.

 

My experimental mod: new GitHub page to be created... (Add your favorite TCGs in MC! [WIP])

 

When asking for assistance with modding or making mods, paste the log (located in .minecraft/logs folder for mod users or in the console for mod makers).

Link to comment
Share on other sites

1 minute ago, Animus_Surge said:

 

 

Json:

{
    "forge_marker": 1,
    "defaults": {
        "mod   el": "saomod:item/weapon/starter/sword/starter_sword.obj"
    },
    "variants": {
    "inventory": [{
      "transform": "forge:default-item"
    }]
    }
}
 

Sword:

Spoiler

public class SAOSword extends SAOWeapon
{
    public SAOSword(String name, SAOToolMaterial material)
    {
        super(name, 3, 4, material);
    }
    
}
 

Weapon:

Spoiler

public class SAOWeapon extends Item
{
    protected int attackSpeed;
    
    protected int attackDamage;
    
    protected SAOToolMaterial material;

    public SAOWeapon(String name, int attackDamage, int attackSpeed, SAOToolMaterial material)
    {
        //if this goes south adda (int) infromt of attackDamage and speed this.attackDamage = (int)attackDamage + material.attackDamage;
        this.attackDamage = attackDamage + material.attackDamage;
        this.attackSpeed = attackSpeed + material.attackSpeed;
        this.material = material;
        this.setMaxStackSize(1);
        //this.setCreativeTab(SAOTabs.SAOWEAPONS);

       this.setUnlocalizedName(name);
       this.setRegistryName(name);
        
    }
    
    /**
     * Returns the amount of damage the weapon can do.
     */
    public float getAttackDamage()
    {
        return material.attackDamage;
    }
    
    /**
     * Returns the speed of which you can attack
     */
    public float getAttackSpeed()
    {
        return material.attackSpeed;
    }

    @SideOnly(Side.CLIENT)
    @Override
    public boolean isFull3D()
    {
        return true;
    }
    
    
    public static final IAttribute ATTACK_DAMAGE = new RangedAttribute((IAttribute)null, "generic.attackDamage", 0D, 0.0D, 2048.0D);
    public static final IAttribute ATTACK_SPEED = (new RangedAttribute((IAttribute)null, "generic.attackSpeed", 0D, 0.0D, 1024.0D)).setShouldWatch(true);
    
   @Override
   public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) 
   {
       Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
       
       if(equipmentSlot == EntityEquipmentSlot.MAINHAND)
       {
           multimap.put(ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", this.attackDamage - 1D, 0));
           multimap.put(ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.attackSpeed - 4D, 0));
       }
       
       return multimap;
       
   }
    
    
    
    
    
    
    
    
    
    public static enum SAOToolMaterial
    {
        
        STARTER(1, 2, 500),
        IRON(2, 1, 600),
        BRONZE(3, 0, 750),
        ROCK_GOLEM(3, 2, 620);
        
        private final int attackDamage;
        
        private final int attackSpeed;
        
        private SAOToolMaterial(int attackDamage, int attackSpeed, int durability)
        {
            this.attackDamage = attackDamage;
            this.attackSpeed = attackSpeed;
            
        }
    }

}

 

Link to comment
Share on other sites

12 minutes ago, Discult said:

"mod   el": "saomod:item/weapon/starter/sword/starter_sword.obj"

In the quoted line, what does '"mod   el"' in the tag part of the line mean?

 

also what imports are you using in the weapon class?

 

I know, lots of questions, but they are important.

Edited by Animus_Surge

Forge 1.8.9 and below are not supported in the forums anymore. Please upgrade to a later version.

 

My experimental mod: new GitHub page to be created... (Add your favorite TCGs in MC! [WIP])

 

When asking for assistance with modding or making mods, paste the log (located in .minecraft/logs folder for mod users or in the console for mod makers).

Link to comment
Share on other sites

2 minutes ago, Animus_Surge said:

In the quoted line, what does '"mod   el"' in the tag part of the line mean?

 

also what imports are you using in the weapon class?

 

I know, lots of questions, but they are important.

yea i already fixed the model thing and in the weapons it is 

Spoiler

package com.saoteam.swordartonline.item;

import com.google.common.collect.Multimap;

import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttribute;
import net.minecraft.entity.ai.attributes.RangedAttribute;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class SAOWeapon extends Item
{
    protected int attackSpeed;
    
    protected int attackDamage;
    
    protected SAOToolMaterial material;

    public SAOWeapon(String name, int attackDamage, int attackSpeed, SAOToolMaterial material)
    {
        //if this goes south adda (int) infromt of attackDamage and speed this.attackDamage = (int)attackDamage + material.attackDamage;
        this.attackDamage = attackDamage + material.attackDamage;
        this.attackSpeed = attackSpeed + material.attackSpeed;
        this.material = material;
        this.setMaxStackSize(1);
        //this.setCreativeTab(SAOTabs.SAOWEAPONS);

       this.setUnlocalizedName(name);
       this.setRegistryName(name);
        
    }
    
    /**
     * Returns the amount of damage the weapon can do.
     */
    public float getAttackDamage()
    {
        return material.attackDamage;
    }
    
    /**
     * Returns the speed of which you can attack
     */
    public float getAttackSpeed()
    {
        return material.attackSpeed;
    }

    @SideOnly(Side.CLIENT)
    @Override
    public boolean isFull3D()
    {
        return true;
    }
    
    
    public static final IAttribute ATTACK_DAMAGE = new RangedAttribute((IAttribute)null, "generic.attackDamage", 0D, 0.0D, 2048.0D);
    public static final IAttribute ATTACK_SPEED = (new RangedAttribute((IAttribute)null, "generic.attackSpeed", 0D, 0.0D, 1024.0D)).setShouldWatch(true);
    
   @Override
   public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) 
   {
       Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
       
       if(equipmentSlot == EntityEquipmentSlot.MAINHAND)
       {
           multimap.put(ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", this.attackDamage - 1D, 0));
           multimap.put(ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.attackSpeed - 4D, 0));
       }
       
       return multimap;
       
   }
    
    
    
    
    
    
    
    
    
    public static enum SAOToolMaterial
    {
        
        STARTER(1, 2, 500),
        IRON(2, 1, 600),
        BRONZE(3, 0, 750),
        ROCK_GOLEM(3, 2, 620);
        
        private final int attackDamage;
        
        private final int attackSpeed;
        
        private SAOToolMaterial(int attackDamage, int attackSpeed, int durability)
        {
            this.attackDamage = attackDamage;
            this.attackSpeed = attackSpeed;
            
        }
    }

}


 

 

Link to comment
Share on other sites

7 minutes ago, Discult said:

super.getItemAttributeModifiers(equipmentSlot);

In this line in your code, the 'getItemAttributeModifiers' attribute is depreciated. It should say so if you're using eclipse.

 

9 minutes ago, Discult said:

yea i already fixed the model thing and in the weapons it is

So you fixed the issue?

Forge 1.8.9 and below are not supported in the forums anymore. Please upgrade to a later version.

 

My experimental mod: new GitHub page to be created... (Add your favorite TCGs in MC! [WIP])

 

When asking for assistance with modding or making mods, paste the log (located in .minecraft/logs folder for mod users or in the console for mod makers).

Link to comment
Share on other sites

1 minute ago, Animus_Surge said:

So you fixed the issue?

i mean i fixed the mod el it is suppose to be model and it isnt really a problem that is why it is in general just wondering if i can change the model location from block to item cause by default blockstates have you put it in block

 

Link to comment
Share on other sites

To be honest, I have no clue. But I would try putting the OBJ file into the block models folder and change it so it matches and see what happens. 

Forge 1.8.9 and below are not supported in the forums anymore. Please upgrade to a later version.

 

My experimental mod: new GitHub page to be created... (Add your favorite TCGs in MC! [WIP])

 

When asking for assistance with modding or making mods, paste the log (located in .minecraft/logs folder for mod users or in the console for mod makers).

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

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