• 0

    posted a message on How do i make items add to EntityProperties?

    I created an ExtendedProperty called Lifesteal. I want certain items to add to said property so long as they're in the inventory.

    Right now, i have an event that checks if the item is in the player's inventory and adds a specified value to the property. This works for now, but will become cumbersome later on when more and more items are added with lifesteal. Is it possible to just create a method that can make me declare an item's lifesteal value in the item's class and add said lifesteal to the player's total lifesteal?

    Here are the current classes used to add lifesteal:

    Properties

    package com.ca.main;
    
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityList;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.server.MinecraftServer;
    import net.minecraft.util.ChunkCoordinates;
    import net.minecraft.world.World;
    import net.minecraft.world.WorldServer;
    import net.minecraftforge.common.IExtendedEntityProperties;
    
    public class ExtendedPlayer implements IExtendedEntityProperties
    {
    /*
    Here I create a constant EXT_PROP_NAME for this class of properties. You need a unique name for every instance of IExtendedEntityProperties you make, and doing it at the top of each class as a constant makes
    it very easy to organize and avoid typos. It's easiest to keep the same constant name in every class, as it will be distinguished by the class name: ExtendedPlayer.EXT_PROP_NAME vs. ExtendedEntity.EXT_PROP_NAME
    
    Note that a single entity can have multiple extended properties, so each property should have a unique name. Try to come up with something more unique than the tutorial example.
    */
    public final static String Attributes = "ExtendedPlayer";
    
    // I always include the entity to which the properties belong for easy access
    // It's final because we won't be changing which player it is
    private final EntityPlayer player;
    
    // Declare other variables you want to add here
    
    // We're adding mana to the player, so we'll need current and max mana
    private int currentMana, maxMana;
    private int currentSouls;
    private float RangedLifesteal;
    private float MaximumRangedLifesteal;
    private float MeleeLifesteal;
    private float MaximumMeleeLifesteal;
    private boolean haskali;
    private boolean hasIra;
    private boolean hasIrahand;
    private boolean hasJewel;
    private boolean gotbook;
    
    /*
    The default constructor takes no arguments, but I put in the Entity so I can initialize the above variable 'player'
    
    Also, it's best to initialize any other variables you may have added, just like in any constructor.
    */
    public static final int MANA_WATCHER = 20;
    public static final int SOUL_WATCHER = 21;
    public ExtendedPlayer(EntityPlayer player)
    {
    this.player = player;
    // Start with max mana. Every player starts with the same amount.
    this.currentMana = 0;
    this.currentSouls = 0;
    this.maxMana = 500;
    this.RangedLifesteal = 0;
    this.MaximumRangedLifesteal = .50F;
    this.MeleeLifesteal = 0;
    this.MaximumMeleeLifesteal = 1.0F;
    this.haskali = false;
    this.hasIra = false;
    this.hasIrahand = false;
    this.hasJewel = false;
    this.player.getDataWatcher().addObject(MANA_WATCHER, this.maxMana);
    this.player.getDataWatcher().addObject(SOUL_WATCHER, this.currentSouls);
    this.gotbook = false;
    }
    
    /**
    * Used to register these extended properties for the player during EntityConstructing event
    * This method is for convenience only; it will make your code look nicer
    */
    public static final void register(EntityPlayer player)
    {
    player.registerExtendedProperties(ExtendedPlayer.Attributes, new ExtendedPlayer(player));
    
    }
    
    /**
    * Returns ExtendedPlayer properties for player
    * This method is for convenience only; it will make your code look nicer
    */
    
    // Save any custom data that needs saving here
    @Override
    public void saveNBTData(NBTTagCompound compound)
    {
    // We need to create a new tag compound that will save everything for our Extended Properties
    NBTTagCompound properties = new NBTTagCompound();
    
    // We only have 2 variables currently; save them both to the new tag
    properties.setInteger("CurrentMana", this.currentMana);
    properties.setInteger("MaxMana", this.maxMana);
    properties.setInteger("CurrentSouls", this.currentSouls);
    properties.setFloat("RangedLifesteal", this.RangedLifesteal);
    properties.setFloat("MaximumRangedLifesteal", this.MaximumRangedLifesteal);
    properties.setFloat("MeleeLifesteal", this.MeleeLifesteal);
    properties.setFloat("MaximumMeleeLifesteal", this.MaximumMeleeLifesteal);
    properties.setBoolean("HasJewel", this.hasJewel);
    
    /*
    Now add our custom tag to the player's tag with a unique name (our property's name). This will allow you to save multiple types of properties and distinguish between them. If you only have one type, it isn't as important, but it will still avoid conflicts between your tag names and vanilla tag names. For instance, if you add some "Items" tag, that will conflict with vanilla. Not good. So just use a unique tag name.
    */
    compound.setTag(Attributes, properties);
    
    }
    
    // Load whatever data you saved
    @Override
    public void loadNBTData(NBTTagCompound compound)
    {
    // Here we fetch the unique tag compound we set for this class of Extended Properties
    NBTTagCompound properties = (NBTTagCompound) compound.getTag(Attributes);
    
    
    // Get our data from the custom tag compound
    this.currentMana = properties.getInteger("CurrentMana");
    this.maxMana = properties.getInteger("MaxMana");
    this.currentSouls = properties.getInteger("CurrentSouls");
    this.MeleeLifesteal = properties.getInteger("MeleeLifesteal");
    
    // Just so you know it's working, add this line:
    System.out.println("[TUT PROPS] Mana from NBT: " + this.currentMana + "/" + this.maxMana);
    }
    
    /*
    I personally have yet to find a use for this method. If you know of any,
    please let me know and I'll add it in!
    */
    @Override
    public void init(Entity entity, World world)
    {
    }
    
    /*
    That's it for the IExtendedEntityProperties methods, but we need to add a few of our own in order to interact with our new variables. For now, let's make one method to consume mana and one to replenish it.
    */
    
    /**
    * Returns true if the amount of mana was consumed or false
    * if the player's current mana was insufficient
    */
    public boolean consumeMana(int amount)
    {
    // Does the player have enough mana?
    	
    boolean sufficient = amount <= this.currentMana;
    // Consume the amount anyway; if it's more than the player's current mana,
    // mana will be set to 0
    
    this.currentMana -= (amount < this.currentMana ? amount : this.currentMana);
    // Return if the player had enough mana
    return sufficient;
    }
    
    /**
    * Simple method sets current mana to max mana
    */
    
    //Mana Stuff
    public void replenishMana()
    {
    this.currentMana = this.maxMana;
    }
    public static ExtendedPlayer get(EntityPlayer player)
    {
    return (ExtendedPlayer) player.getExtendedProperties(Attributes);
    }
    
    
    
    public int getCurrentMana() {
    	
    	 int currentmana = this.currentMana;
    	
    	return currentmana;
    }
    
    
    public void addMana(int amount)
    {
    
    this.currentMana = this.currentMana + amount;
    
    if (this.currentMana > this.maxMana) {
    	this.currentMana = this.maxMana;
    }
    // Return if the player had enough mana
    
    }
    
    //Soul Stuff
    
    public void addSoul(int amount)
    {
    
    this.currentSouls = this.currentSouls + amount;
    
    }
    
    public boolean ConsumeSouls(int amount) {
    	
    	boolean result = false;
    	if (amount > this.currentSouls) {
    		result = false; 
    		
    	}
    	else if (this.currentSouls > amount) {
    		this.currentSouls = this.currentSouls - amount;
    		result = true;
    	}
    	return result;
    }
    
    public int getCurrentSouls() {
    	
    	 int currentsouls = this.currentSouls;
    	
    	return currentsouls;
    }
    
    
    public float getMeleeLifesteal() {
    	
    	 float meleelifesteal = this.MeleeLifesteal;
    	
    	return meleelifesteal;
    }
    
    public void addMeleeLifesteal(float amount)
    {
    
    this.MeleeLifesteal = this.MeleeLifesteal + amount;
    
    if (this.MeleeLifesteal > this.MaximumMeleeLifesteal) {
    	this.MeleeLifesteal = this.MaximumMeleeLifesteal;
    }
    }
    public void subtractMeleeLifesteal(float amount)
    {
    
    this.MeleeLifesteal = this.MeleeLifesteal - amount;
    
    if (this.MeleeLifesteal < 0 ) {
    	this.MeleeLifesteal = 0;
    }
    }
    
    public boolean CallKali() {
    	
    	return this.haskali;
    }
    
    public void ChangeKali(boolean change) {
    	if (change == true) {
    		this.haskali = true;
    	}
    	else if (change == false) {
    		this.haskali = false;
    	}
    }
    
    public boolean CallIra() {
    	
    	return this.hasIra;
    }
    
    public void ChangeIra(boolean change) {
    	if (change == true) {
    		this.hasIra = true;
    	}
    	
    	else if (change == false) {
    	this.hasIra = false;
    	}
    }
    public boolean CallIrainhand() {
    	
    	return this.hasIrahand;
    }
    
    public void ChangeIraInHand(boolean change) {
    	if (change == true) {
    		this.hasIrahand = true;
    	}
    	else if (change == false) {
    		this.hasIrahand = false;
    	}
    }
    
    public void addsaturation(int h, int s) {
    	
     	player.getFoodStats().addStats(h, s);
    }
    public boolean CallJewel() {
    	
    	return this.hasJewel;
    }
    public void ChangeJewel(boolean change) {
    	if (change == true) {
    		this.hasJewel = true;
    	}
    	else if (change == false) {
    		this.hasJewel = false;
    	}
    
    }
    }


    Event Class:

    package com.jeshan.main;
    
    import java.util.Random;
    
    import com.jeshan.item.MainItemClass;
    
    import cpw.mods.fml.common.eventhandler.Cancelable;
    import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
    import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.boss.EntityDragon;
    import net.minecraft.entity.boss.EntityWither;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.EntityPlayerMP;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.ItemWritableBook;
    import net.minecraft.nbt.NBTTagByte;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.util.ChatComponentText;
    import net.minecraft.util.DamageSource;
    import net.minecraft.world.World;
    import net.minecraftforge.common.util.Constants.NBT;
    import net.minecraftforge.event.entity.EntityEvent.EntityConstructing;
    import net.minecraftforge.event.entity.living.LivingDeathEvent;
    import net.minecraftforge.event.entity.living.LivingDropsEvent;
    import net.minecraftforge.event.entity.living.LivingEvent;
    import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
    import net.minecraftforge.event.entity.living.LivingHurtEvent;
    import net.minecraftforge.event.entity.player.EntityInteractEvent;
    import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
    import net.minecraftforge.event.entity.player.PlayerEvent;
    import net.minecraftforge.event.entity.player.PlayerUseItemEvent;
    import scala.Console;
    
    public class EventHandlerCommon {
     
     
    
     
    //Lifesteal
     
     
     
     
     @SubscribeEvent
     public void ItemAddLifesteal(PlayerTickEvent event) {
     
     EntityPlayer player = (EntityPlayer) event.player;
     float percenthealth = (player.getHealth() / player.getMaxHealth()) * 100;
     ExtendedPlayer props = ExtendedPlayer.get(player);
     
     InventoryPlayer inventory = player.inventory;
     
     
     //Talisman of Kali
     
     if (inventory.hasItem(MainItemClass.TalismanofKali) && props.CallKali() == true) {
     
     
     
     }
     else if (!(inventory.hasItem(MainItemClass.TalismanofKali)) && props.CallKali() == false) {
     
     }
     
     else if (inventory.hasItem(MainItemClass.TalismanofKali) && props.CallKali() == false) {
     
     props.addMeleeLifesteal(0.25F);
     props.ChangeKali(true);
     Console.println("Kali Lifesteal Added");
     }
     
     
     
     else if (!(inventory.hasItem(MainItemClass.TalismanofKali)) && props.CallKali() == true) {
     
     props.subtractMeleeLifesteal(0.25F);
     props.ChangeKali(false);
     Console.println("Kali Lifesteal Subtracted");
     }
     
     //Sin-Sword Ira
     
     
     if (inventory.hasItem(MainItemClass.SinSwordIra) && props.CallIra() == true) {
     
     
     
     }
     else if (!(inventory.hasItem(MainItemClass.SinSwordIra)) && props.CallIra() == false) {
     
     }
     
     else if (inventory.hasItem(MainItemClass.SinSwordIra) && props.CallIra() == false) {
     
     props.addMeleeLifesteal(0.20F);
     props.ChangeIra(true);
     Console.println("Ira Lifesteal Added");
     }
     
     
     
     else if (!(inventory.hasItem(MainItemClass.SinSwordIra)) && props.CallIra() == true) {
     
     props.subtractMeleeLifesteal(0.20F);
     props.ChangeIra(false);
     Console.println("Ira Lifesteal Subtracted");
     }
     
    
     
     
     
     if (!(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordIra) && props.CallIrainhand() == false) {
     
     }
     
     else if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordIra && props.CallIrainhand() == false && percenthealth <= 40) {
     
     props.addMeleeLifesteal(0.15F);
     props.ChangeIraInHand(true);
     Console.println("Ira Lifesteal Added");
     }
     
     
     
     else if (!(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordIra) && props.CallIrainhand() == true) {
     
     props.subtractMeleeLifesteal(0.15F);
     props.ChangeIraInHand(false);
     Console.println("Ira Lifesteal Subtracted");
     
     }
     
     
     
     else if (!(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordIra) && props.CallIrainhand() == true && percenthealth > 40) {
     
     props.subtractMeleeLifesteal(0.15F);
     props.ChangeIraInHand(false);
     Console.println("Ira Lifesteal Subtracted");
     
     }
     
     else if ((player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordIra) && props.CallIrainhand() == true && percenthealth > 40) {
     
     props.subtractMeleeLifesteal(0.15F);
     props.ChangeIraInHand(false);
     Console.println("Ira Lifesteal Subtracted");
     
     }
    
     else if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordIra == true) {
     
     
     
     }
     //Sin-Sword Ira Passive
     
     }
     
     
     
     
     @SubscribeEvent
     public void Lifesteal(LivingHurtEvent event) {
     
     DamageSource source = event.source;
     float amount = event.ammount;
     float victimhealth = event.entityLiving.getMaxHealth();
     
     
     if (source.getSourceOfDamage() instanceof EntityPlayer){
     
     EntityPlayer sourcePlayer = (EntityPlayer) source.getEntity();
     
     ExtendedPlayer props = ExtendedPlayer.get(sourcePlayer);
     
     float lifesteal = props.getMeleeLifesteal();
     
     
     InventoryPlayer inventory = sourcePlayer.inventory;
     
     float healamount = 0;
     
    
     if (amount > victimhealth) {
     amount = victimhealth;
     }
     
     healamount = amount * lifesteal;
     
     sourcePlayer.heal(healamount); 
     
     
     
     Console.println("sourcePlayer should Lifesteal:" + healamount);
     }
     
     
     
     
     
     
     if (event.entity instanceof EntityPlayerMP) {
     
     }
     }
     
     @SubscribeEvent
     public void SoulScytheDamage(LivingHurtEvent event) {
     
     DamageSource source = event.source;
     float amount = event.ammount;
     float victimmaxhealth = event.entityLiving.getMaxHealth();
     EntityLivingBase victim = event.entityLiving;
     
     if (source.getSourceOfDamage() instanceof EntityPlayer){
     
     EntityPlayer sourcePlayer = (EntityPlayer) source.getEntity();
     
     InventoryPlayer inventory = sourcePlayer.inventory;
     
     if (sourcePlayer.getCurrentEquippedItem() != null && sourcePlayer.getCurrentEquippedItem().getItem() == MainItemClass.SoulScythe) {
     
     victim.attackEntityFrom(DamageSource.generic, (victimmaxhealth * .05F));
     
     
     }
     
     }
     
     
     if (event.entity instanceof EntityPlayerMP) {
     
     }
     }
     
     @SubscribeEvent
     public void Agniastraboonoffense(LivingHurtEvent event) {
     
     DamageSource source = event.source;
     float amount = event.ammount;
     float victimmaxhealth = event.entityLiving.getMaxHealth();
     EntityLivingBase victim = event.entityLiving;
     
     if (source.getSourceOfDamage() instanceof EntityPlayer){
     
     EntityPlayer sourcePlayer = (EntityPlayer) source.getEntity();
     
     InventoryPlayer inventory = sourcePlayer.inventory;
     
     if (inventory.hasItem(MainItemClass.Agniastra)) {
     
     victim.setFire(3);
     
     }
     
     }
     
     
     if (event.entity instanceof EntityPlayerMP) {
     
     }
     }
     
     @SubscribeEvent
     public void onEntityConstructing(EntityConstructing event)
     {
     
     if (event.entity instanceof EntityPlayer && ExtendedPlayer.get((EntityPlayer) event.entity) == null)
    
     ExtendedPlayer.register((EntityPlayer) event.entity);
     
     if (event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(ExtendedPlayer.Attributes) == null)
     event.entity.registerExtendedProperties(ExtendedPlayer.Attributes, new ExtendedPlayer((EntityPlayer) event.entity));
     }
    
     //SinSwordLuxuria
     @SubscribeEvent
     public void SinBlessing(LivingHurtEvent event) {
     
     DamageSource source = event.source;
     float amount = event.ammount;
     float victimhealth = event.entityLiving.getMaxHealth();
     
     if (source.getSourceOfDamage() instanceof EntityPlayer){
     
     EntityPlayer sourcePlayer = (EntityPlayer) source.getEntity();
     ExtendedPlayer props = ExtendedPlayer.get(sourcePlayer);
     InventoryPlayer inventory = sourcePlayer.inventory;
     
     
     if (sourcePlayer.getCurrentEquippedItem() != null && sourcePlayer.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordLuxuria) {
     
     
     
     sourcePlayer.heal(1.0F); 
     sourcePlayer.addPotionEffect(new PotionEffect (1, 60 , 1));
     }
     else if (sourcePlayer.getCurrentEquippedItem() != null && sourcePlayer.getCurrentEquippedItem().getItem() == MainItemClass.SinSwordGula) {
     
     
     
     props.addsaturation(2, 2);
     sourcePlayer.addPotionEffect(new PotionEffect (23, 60 , 1));
     
     
     
     
     
     
     }
     
     
     }
     
     
     if (event.entity instanceof EntityPlayerMP) {
     
     }
     }
     @SubscribeEvent
     public void JewelBlessing(PlayerTickEvent event) {
     
     EntityPlayer player = event.player;
     
     InventoryPlayer inventory = player.inventory;
    
     ExtendedPlayer props = ExtendedPlayer.get(player);
    
     
     if ((!(inventory.hasItem(MainItemClass.JewelofQuetzalcoatl)) && (props.CallJewel() == true) )) {
     
     props.ChangeJewel(false);
     player.capabilities.allowFlying = false;
     player.capabilities.isFlying = false;
    
     }
     
     else if ((!(inventory.hasItem(MainItemClass.JewelofQuetzalcoatl)) && (props.CallJewel() == false) )) {
     
     }
     
     
     
     }
     
     
     
     
     
     
     
    }
     
    
    
     
     
    

    Posted in: Modification Development
  • 0

    posted a message on Setting item textures based on item damage values package

    How would i set textures based on damage values? Like 400 damage and above, 800, 900 etc.

    i have an item that i need to do this for, here's it's code. I want to set a different texture for each charge it has.

    package com.agni.item;
    
    import java.util.List;
    
    import com.agni.lib.RefStrings;
    
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.entity.projectile.EntityLargeFireball;
    import net.minecraft.entity.projectile.EntitySnowball;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.EnumRarity;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemAxe;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.util.Vec3;
    import net.minecraft.world.World;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    
    public class Agniastra extends Item{
    	
    	public  Agniastra() {
    	
    		this.setMaxDamage(1200);
           this.setMaxStackSize(1);
           this.setNoRepair();
     
        }  	 
    	
    	
    
    	
    	public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
    	{
    		if (par1ItemStack.getItemDamage() < par1ItemStack.getMaxDamage())
    		{
    			par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
    			
    		}
    		 if (par3Entity instanceof EntityPlayer)
        	 {
        		 
        	 EntityPlayer player = (EntityPlayer)par3Entity;
        	 InventoryPlayer inventory = player.inventory;
        	 
        	 
      
            	   
    	        	player.addPotionEffect(new PotionEffect (12, 20 , 0));
    	        	
               }
                {
          
                	
        	 }
                
                
    		}
    		
    		
    	
    	
    	
    	@Override
    	public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
        {
    		if (par1ItemStack.getItemDamage() < 800)
    		{
    		
    		        
    		     if (!par2World.isRemote) {
    		    	 for(int countparticles = 0; countparticles <= 3; countparticles++)
    	             	{
                     Vec3 v3 = par3EntityPlayer.getLook(1);
                     EntityLargeFireball smallfireball = new EntityLargeFireball(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.eyeHeight , par3EntityPlayer.posZ, v3.xCoord, v3.yCoord, v3.zCoord);
                     smallfireball.shootingEntity = par3EntityPlayer;
                    
                     par2World.spawnEntityInWorld(smallfireball);
                 	}
                 }
    		        
    			
    	        par1ItemStack.damageItem(400, par3EntityPlayer);
    
    		} 
    		return par1ItemStack;
        }
    	
    	 @Override
         public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
    	     {
    			 
    
    			 
    			 
         par3List.add( "\u00A72" + "Active Ability:" + "\u00A7c" + " Flameburst.");
         par3List.add( "\u00A7f" + "Shoots a burst of fireballs.");
         par3List.add( "\u00A7e" + "Passive Ability:" + "\u00A74" + " Boon of Fire.");
         par3List.add( "\u00A7f" + "Fire Resistance while in inventory.");
         par3List.add( "\u00A7f" + "Melee attacks ignite for 3s.");
         par3List.add("");
         par3List.add("\u00A76" + "Active Cost:" + "\u00A7f" +  " 1 Charge");
         par3List.add("\u00A7d" + "Max Charges:" + "\u00A7f" +  " 3");
         par3List.add("\u00A76" + "Charges: " + "\u00A7f" +  ((( 1200 - par1ItemStack.getItemDamage() ) /400)));
         par3List.add("\u00A7b" + "Recharge Rate :" + "\u00A7f" + " 1 Charge every 20s");
         par3List.add("\u00A7d" + "Tim till Full Charges: " + "\u00A7f" +  ((par1ItemStack.getItemDamage() ) /20) + "/60s");
         
    
    }
    
    }
    Posted in: Modification Development
  • 0

    posted a message on Flight Item doesn't play nice with other mods

    the event handler would allow flight only if that item is in their inventory, or if their in creative mode.

    Basically, even if you have an Angel Ring from Extra Utilities, you still cant fly if you dont have a jewel.

    Posted in: Modification Development
  • 0

    posted a message on Flight Item doesn't play nice with other mods

    I'm trying to make an item that allows the player to fly if it's in their inventory. So far, it works. But flight doesn't disable if the item leave their inventory.

    Here's the code:

    package com.jeshan.item;
    
    import java.util.List;
    import java.util.Random;
    
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.item.EntityEnderPearl;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.world.World;
    import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
    
    public class JewelofQuetzalcoatl extends Item {
    
    	public  JewelofQuetzalcoatl()
        {
            this.maxStackSize = 1;
            this.setCreativeTab(CreativeTabs.tabMisc);
            this.bFull3D = true;
           this.setMaxStackSize(1);
         
        }
    	@Override
    	public boolean hasEffect(ItemStack par1ItemStack){
    		return true;}
    	
    	 @Override
         public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
         {
         par3List.add( "\u00A7b" + "Passive Ability:" + "\u00A7a" + " Ehecatl");
         par3List.add("\u00A7a" + "Allows flight while in inventory.");
        
         
         ;
    
    
    }    
    		@Override
       	 public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean par5) {
    		
       	 	super.onUpdate(itemstack,  world,  entity,  par4,  par5);
       	      	
    
       	    
          	 
         	  if (entity instanceof EntityPlayer) {
     	            EntityPlayer player = (EntityPlayer) entity;
     	            InventoryPlayer inventory = player.inventory;
     	            if (inventory.hasItem(MainItemClass.JewelofQuetzalcoatl)) {
     	            	player.capabilities.allowFlying = true;
     	            	
    
    
     	            }
     	            else if (!inventory.hasItem(MainItemClass.JewelofQuetzalcoatl)) {
     	            	player.capabilities.allowFlying = false;
     	            	player.capabilities.isFlying = false;
    
    
     	            }
           }
         	  }
           
       	 
       	 
       	
       	
    
    
    }
    

    I tried to make an Event in Event Handler that checks if a player has this item, if false (or if they're not in creative mode) , they cannot fly.

    This worked, the problem is if you have another mod that adds a flight ring item, this completely overrides that item and makes it useless.

    How can i make this item work properly?

    Posted in: Modification Development
  • 0

    posted a message on removing an item on right click and placing a new one in the same slot

    i tried that. It changes to SunShield and then instantly changes back.

    Posted in: Modification Development
  • 0

    posted a message on [Solved]Item not activating upon meeting the requirements

    I tried that. It changes to SunShield and then instantly changes back.

    Posted in: Modification Development
  • 0

    posted a message on removing an item on right click and placing a new one in the same slot

    i'm trying to make an item that will 'switch' to a different item on right click. So far, it does just that. Except on right click it'll delete the item and place the new item in an entirely different slot. This is a slight nuisance and impracticable mid combat. How do i make it so that the new item will appear in the same slot as the old one?


    Here's my code:



    package com.jeshan.item;
    
    import java.util.List;
    import java.util.Random;
    
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.ItemSword;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.world.World;
    
    public class MoonBlade extends ItemSword {
    	public MoonBlade(ToolMaterial p_i45356_1_) {
    		super(p_i45356_1_);
    		// TODO Auto-generated constructor stub
    	}
    
    
    
    	{
    	this.setMaxDamage(-1);
    	
    }
    	@Override
    	public boolean hasEffect(ItemStack par1ItemStack){
    		return true;}
    	
    		@Override
    	  public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
      	
      	
          {
    			 p_77659_3_.inventory.setInventorySlotContents(p_77659_3_.inventory.getFirstEmptyStack(), new ItemStack(MainItemClass.SunShield));
    			p_77659_3_.inventory.consumeInventoryItem(MainItemClass.MoonBlade);
    			
    			 
    		 
    		 
    		return p_77659_1_;
    
          	}
          
          	 @Override
               public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
               {
               par3List.add( "\u00A7b" + "Active Ability:" + "\u00A7a" + " Right-Click to Switch to Sun Shield.");
               par3List.add( "\u00A7b" + "Held Ability:" + "\u00A7a" + " Speed III , Night Vision and Waterbreathing ");
               par3List.add("\u00A71" + "Cost:" + "\u00A7f" + " 0");
               
               par3List.add("Durability:" +  "Indestructible");
    
         
    }
       
          	 
          	public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
    
          	{
    
          	     if (entity instanceof EntityPlayer)
    
          	     {          EntityPlayer Player = (EntityPlayer) entity;
    
          	          if(Player.getCurrentEquippedItem() != null && Player.getCurrentEquippedItem().getItem() == MainItemClass.MoonBlade)
    
          	          {
    
          	        	((EntityLivingBase) entity).addPotionEffect(new PotionEffect (1, 20 , 1));
          	        	((EntityLivingBase) entity).addPotionEffect(new PotionEffect (16, 20 , 0));
          	        	((EntityLivingBase) entity).addPotionEffect(new PotionEffect (13, 20 , 0));
          	          }
    
          	          else
    
          	          { 
    
          	               // the item is not equipped
    
          	          }
    
          	     }
    
          	 
    
    }
    }
         
    
    


    On a side note, i'm also trying to figure out how to restrict these items to only one per inventory. So you can only have one Sun Shield or Moon Blade in your inventory.

    Posted in: Modification Development
  • 0

    posted a message on [Solved]Item not activating upon meeting the requirements

    I have an item that should grant the player several differnet buffs if they're under 15% health and the item is in there inventory. Currently, it does no such thing.


    here's the item class:

    package com.axel.item;
    
    import java.util.List;
    import java.util.Random;
    
    import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.item.EntityEnderPearl;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.EntityPlayerMP;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.Potion;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.world.World;
    import net.minecraftforge.event.entity.living.LivingEvent;
    
    public class DivineIntervention extends Item {
    
    	public  DivineIntervention()
        {
            this.maxStackSize = 1;
            this.setCreativeTab(CreativeTabs.tabMisc);
            this.bFull3D = true;
           this.setMaxStackSize(64);
         
        }
    	
            public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer player)
            	
            	
            {
           
            	
            	
            	p_77659_2_.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
            	Random rand = new Random();
            	for(int countparticles = 0; countparticles <= 10; ++countparticles)
            	{
            		p_77659_2_.spawnParticle("reddust", player.posX + (rand.nextDouble() - 0.5D) * (double)player.width, player.posY + rand.nextDouble() * (double)player.height - (double)player.yOffset, player.posZ + (rand.nextDouble() - 0.5D) * (double)player.width, 0.0D, 0.0D, 0.0D);
            		p_77659_2_.spawnParticle("enchantmenttable", player.posX + (rand.nextDouble() - 0.5D) * (double)player.width, player.posY + rand.nextDouble() * (double)player.height - (double)player.yOffset, player.posZ + (rand.nextDouble() - 0.5D) * (double)player.width, 0.0D, 0.0D, 0.0D);
            		p_77659_2_.spawnParticle("portal", player.posX + (rand.nextDouble() - 0.5D) * (double)player.width, player.posY + rand.nextDouble() * (double)player.height - (double)player.yOffset, player.posZ + (rand.nextDouble() - 0.5D) * (double)player.width, 0.0D, 0.0D, 0.0D);
    
            	}
    
            	
         
            	float z = player.getHealth();
            	float x = player.getMaxHealth();
            	player.setHealth(x);
            	player.extinguish();
            	player.clearActivePotions();
            	player.addPotionEffect(new PotionEffect (12, 1200 , 1));
            	player.addPotionEffect(new PotionEffect (1, 600 , 2));
            	player.addPotionEffect(new PotionEffect (5, 60 , 4));
            	player.addPotionEffect(new PotionEffect (6, 5 , 1));
            	player.addPotionEffect(new PotionEffect (23, 60 , 4));
            	player.addPotionEffect(new PotionEffect (11, 60 , 255));
            	--p_77659_1_.stackSize;
    			return p_77659_1_;
    
      
            	
            }
            	 @Override
                 public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
                 {
                 par3List.add( "\u00A7b" + "Active Ability:" + "\u00A7a" + " Grants Resistance Infinity, Speed 2, Instant Health I, Saturation 4.  ");
                 par3List.add("\u00A71" + "Cost:" + " Single Use");
                 
                 ;
    
           
    }      	 
    
    
           		 public void onUpdate(ItemStack itemstack, World world, EntityPlayer player, int i, boolean flag)
           		 
            		 {
            			float currenthealth = player.getHealth();
            			float maxhealth = player.getMaxHealth();
            			float percenthealth = (currenthealth / maxhealth) * 100;		
            		 	if (player.dimension == -1 || player.dimension == 1)
            		 
            		 		return;
            		 	
            		 
            		 else {
            			 
            			 if (  percenthealth <= 15 ) {
            			 
            				 player.setHealth(maxhealth);
            		        	player.extinguish();
            		        	player.clearActivePotions();
            		        	player.addPotionEffect(new PotionEffect (12, 1200 , 1));
            		        	player.addPotionEffect(new PotionEffect (1, 600 , 2));
            		        	player.addPotionEffect(new PotionEffect (5, 60 , 4));
            		        	player.addPotionEffect(new PotionEffect (6, 5 , 1));
            		        	player.addPotionEffect(new PotionEffect (23, 60 , 4));
            		        	player.addPotionEffect(new PotionEffect (11, 60 , 255));
            		        	--itemstack.stackSize;
            		        
            		 } }
    					 } 
    }

    It also should be unable to do this if you're in the Nether or the End.

    Posted in: Modification Development
  • 0

    posted a message on PandoraCraft SMP Server | New World | 1.11 | Vanilla | MindCrack/HermitCraft-like server | Whitelisted | Applications Open

    -Name (What you prefer others to call you): Jeshan (Pronounced Jay-shan)

    -Minecraft IGN (In-game Name):Neoneal

    -Age:15

    -Country of residence (Residing in the USA or Canada would provide the player with optimal connection.) :Canada, eh.

    -How long have you been playing Minecraft?: About 3-4 years, started when 1.4 was in snapshot stages

    -Do you plan on recording (Not a requirement)? If you do, please provide your YouTube channel url:

    -Expected amount of playtime on PandoraCraft (weekly): 2-3 hours daily? I have other friends and responsibilities to.

    -Please provide us some screenshots of your previous builds (This is not necessary but will increase your chances of getting accepted):

    A house


    A spawnpoint for an adventure map, with the help of others


    My computer was wiped and reset, so alot of my really cool building photos are gone, unfortunately.

    -Do you have any long-term or short-term projects that you plan on pursuing during your time on the server?:

    Ah, many things. I plan on acquiring all the achievements, and possibly constructing a nether hub. Large towers and bases, as well as a mob farm if allowed.

    -Any additional information I should know?:

    Not right now.

    -Please provide your skype account and/or discord id. If you prefer, you can PM it to me when you're accepted:

    I will pm if i am accepted.

    [Copying and pasting this form and filling it in means that you agree and will comply to all the above

    :


    Posted in: PC Servers
  • 0

    posted a message on delete

    I have sent my application! I highly suggest adding a discord.

    Posted in: PC Servers
  • 0

    posted a message on Model not rendering in hand

    i made a custom model block a while ago, but right now the block isn't rendering in my hand. I'm stuck with a 2D texture i made.

    Here are the codes:

    ClientProxy

    package com.kami.Main;
    
    import com.kami.blocks.MBlocks;
    import com.kami.blocks.TileEntityReverseLantern;
    import com.kami.lib.RefStrings;
    import com.kami.renderer.ItemRenderReverseLantern;
    import com.kami.renderer.renderreverselantern;
    
    import cpw.mods.fml.client.registry.ClientRegistry;
    import cpw.mods.fml.client.registry.RenderingRegistry;
    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
    import net.minecraft.item.Item;
    import net.minecraftforge.client.MinecraftForgeClient;
    
    public class ClientProxy extends ServerProxy{
    	
    	@Override
    	public void registerRenderInfo(){
    		//ReverseLantern
    		TileEntitySpecialRenderer render = new renderreverselantern();
    		MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MBlocks.reverselantern),new ItemRenderReverseLantern(render, new TileEntityReverseLantern()));
    		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReverseLantern.class, render);
       }
    	public int addArmor(String armor){
    	return RenderingRegistry.addNewArmourRendererPrefix(armor);
    	
    	 }
    	public void registerTileEntitySpecialRenderer(){ 
    	}
    
    }

    Item Render Reverse Lantern:

    package com.kami.renderer;
    
    import org.lwjgl.opengl.GL11;
    
    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraftforge.client.IItemRenderer;
    
    public class ItemRenderReverseLantern implements IItemRenderer{
    	
    	TileEntitySpecialRenderer render;
    	private TileEntity entity;
    	
    	public ItemRenderReverseLantern(TileEntitySpecialRenderer render, TileEntity entity) {
    		this.entity = entity;
    		this.render = render;
    	}
    	@Override
    	public boolean handleRenderType(ItemStack item, ItemRenderType type) {
    		// TODO Auto-generated method stub
    		return true;
    	}
    
    	@Override
    	public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
    		// TODO Auto-generated method stub
    		return true;
    	}
    
    	@Override
    	public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    		if(type == IItemRenderer.ItemRenderType.ENTITY)
    			GL11.glTranslatef(-0.5F, -0.0F, -0.5F);
    		this.render.renderTileEntityAt(this.entity, 0.0D, 0.0D, 0.0D, 0.0F);
    		
    	}
    
    }
    

    Tile Entity Reverse Lantern:

    package com.kami.blocks;
    
    import net.minecraft.tileentity.TileEntity;
    
    public class TileEntityReverseLantern extends TileEntity {
    
    }
    

    Main Block Class:

    package com.kami.blocks;
    
    import com.kami.creativetabs.MCreativeTabs;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.world.World;
    
    public class reverselantern extends BlockContainer{
    
    	protected reverselantern(Material material) {
    		super(material);
    		this.setLightLevel(50.0F);
    		this.setHardness(1.0F);
    		this.setCreativeTab(MCreativeTabs.tabBlock);
    	
    	}
    	
    	public int getRenderType() {
    		return -1;
    	}
    
    	public boolean renderAsNormalBlock() {
    		return false;
    		
    	}
    	
    	
    	@Override
    	public TileEntity createNewTileEntity(World ver1, int ver2) {
    	
    		return new TileEntityReverseLantern();
    	}
    
    
    	@Override
    	public boolean isOpaqueCube() {
    		return false;
    		
    		
    }
    }
    
    


    Block Registry:

    package com.kami.blocks;
    
    import com.kami.creativetabs.MCreativeTabs;
    import com.kami.item.ItemNewLogs;
    
    import com.kami.lib.RefStrings;
    
    import cpw.mods.fml.common.registry.GameRegistry;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockDoor;
    import net.minecraft.block.BlockFence;
    import net.minecraft.block.BlockLog;
    import net.minecraft.block.BlockOldLog;
    import net.minecraft.block.BlockRotatedPillar;
    import net.minecraft.block.BlockStairs;
    import net.minecraft.block.material.Material;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraftforge.common.MinecraftForge;
    import scala.collection.immutable.Set;
    
    public class MBlocks {
    	public static void mainRegistry() {
    		initializeBlock();
    		registerItem();
    	}
    	
    	public static Block WickOre;
    	public static Block Wickblock;
    	public static Block negative;
    	public static Block spartblock;
    	public static Block Calore;
    	public static Block Ascendore;
    	public static Block Calblock;
    	public static Block Ascendblock;
    	public static Block NSblock;
    	//Reversal Series
    	public static Block Rore;
    	public static Block Rdirt;
    	public static Block Rgrass;
    	public static Block Rbricks;
    	public static Block rlantern;
    	public static Block reverselantern;
    	public static Block RWPlanks;
    	public static BlockStairs RBstairs;
    	public static BlockStairs RWstairs;
    	public static Block flagblue;
    	public static Block flagred;
    	public static Block flagyellow;
    	public static Block flaggreen;
    	public static Block rift;
    	public static Block shiningrift;
    	public static Block newlogs;
    	//public static BlockFence RBFence;
     
    	//public static BlockDoor RWDoor;
    	
    	public static void initializeBlock(){
    		//Wickantie Series
    		WickOre = new WickOre (Material.rock).setBlockName("WickOre").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":wickore");WickOre.setHarvestLevel("pickaxe", 2);
    		Wickblock = new wickblock (Material.iron).setBlockName("wickblock").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":wickblock");Wickblock.setHarvestLevel("pickaxe", 2);
    		negative = new negative (Material.ground).setBlockName("negative").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":negative");
    		spartblock = new spartblock (Material.iron).setBlockName("spartblock").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":spartblock");spartblock.setHarvestLevel("pickaxe", 3);
    		Calore = new Calore (Material.rock).setBlockName("Calore").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":calore");Calore.setHarvestLevel("pickaxe", 2);
    		Ascendore = new Ascendore (Material.rock).setBlockName("Ascendore").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":ascendore");Ascendore.setHarvestLevel("pickaxe", 3);		
    		Calblock = new blockofcalbrium (Material.iron).setBlockName("Calblock").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":calblock");Calblock.setHarvestLevel("pickaxe", 2);
    		Ascendblock = new Ascendblock (Material.iron).setBlockName("Ascendblock").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":ascendblock");Ascendblock.setHarvestLevel("pickaxe", 3);
    		NSblock = new NSblock (Material.iron).setBlockName("NSblock").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":nsblock");NSblock.setHarvestLevel("pickaxe", 3);
    		reverselantern = new reverselantern(Material.glass).setBlockName("Reverse_Lantern").setBlockTextureName(RefStrings.MODID + ":reverse_lantern");
    		//Reverse Series
    		Rore = new Rore (null, Material.rock, null).setBlockName("Rore").setBlockTextureName(RefStrings.MODID + ":rore");
    		Rdirt = new Rdirt (Material.ground).setBlockName("Rdirt").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":rdirt");Rdirt.setHarvestLevel("shovel", 0);
    		Rgrass = new Rgrass (Material.ground).setBlockName("Rgrass");
    		Rbricks = new Rbricks (Material.rock).setBlockName("Rbricks");
    		rlantern = new rlantern (Material.glass).setBlockName("rlantern");
    		RWPlanks = new RWPlanks(Material.wood).setBlockName("RWPlanks");
    		RBstairs = new RBstairs(Rbricks, 0);
    		RWstairs = new RWstairs(RWPlanks, 0);
    		rift = new rift (Material.glass).setBlockName("rift").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":rift");
    		shiningrift = new rift (Material.glass).setBlockName("shiningrift").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":shiningrift").setLightLevel(50.0F);
    		flagblue = new flag (Material.rock).setBlockName("blueflag").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":blueflag");
    		flagred = new flag (Material.rock).setBlockName("redflag").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":redflag");
    		flagyellow = new flag (Material.rock).setBlockName("yellowflag").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":yellowflag");
    		flaggreen = new flag (Material.rock).setBlockName("greenflag").setCreativeTab(MCreativeTabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":greenflag");
    		newlogs = new NewLogs().setBlockName("Log").setCreativeTab(MCreativeTabs.tabBlock);
    		//RBFence = new RBFence("Rbricks", Material.wood);
    		//RWDoor = new RWDoor(Material.wood);
    		
    		
    	}
    	
    	public static void registerItem(){
    		GameRegistry.registerBlock(WickOre, WickOre.getUnlocalizedName());
    		GameRegistry.registerBlock(Wickblock, Wickblock.getUnlocalizedName());
    		GameRegistry.registerBlock(negative, negative.getUnlocalizedName());
    		GameRegistry.registerBlock(spartblock, spartblock.getUnlocalizedName());
    		GameRegistry.registerBlock(Calore, Calore.getUnlocalizedName());
    		GameRegistry.registerBlock(Ascendore, Ascendore.getUnlocalizedName()) ;
    		GameRegistry.registerBlock(Calblock, Calblock.getUnlocalizedName()) ;
    		GameRegistry.registerBlock(Ascendblock, Ascendblock.getUnlocalizedName()) ;
    		GameRegistry.registerBlock(NSblock, NSblock.getUnlocalizedName());
    		GameRegistry.registerBlock(Rore, Rore.getUnlocalizedName());
    		GameRegistry.registerBlock(Rdirt, Rdirt.getUnlocalizedName());
    		GameRegistry.registerBlock(Rgrass, Rgrass.getUnlocalizedName());
    		GameRegistry.registerBlock(Rbricks, Rbricks.getUnlocalizedName());
    		GameRegistry.registerBlock(rlantern, rlantern.getUnlocalizedName());
    		GameRegistry.registerBlock(RWPlanks, RWPlanks.getUnlocalizedName());
    		GameRegistry.registerBlock(RBstairs, RBstairs.getUnlocalizedName());
    		GameRegistry.registerBlock(RWstairs, RWstairs.getUnlocalizedName());
    		GameRegistry.registerBlock(reverselantern, reverselantern.getUnlocalizedName());
    		GameRegistry.registerBlock(flagblue, flagblue.getUnlocalizedName());		
    		GameRegistry.registerBlock(flagred, flagred.getUnlocalizedName());
    		GameRegistry.registerBlock(flaggreen, flaggreen.getUnlocalizedName());
    		GameRegistry.registerBlock(flagyellow, flagyellow.getUnlocalizedName());
    		GameRegistry.registerBlock(rift, rift.getUnlocalizedName());
    		GameRegistry.registerBlock(shiningrift, shiningrift.getUnlocalizedName());
    		GameRegistry.registerBlock(newlogs, ItemNewLogs.class, newlogs.getUnlocalizedName().substring(5));
    	}	
    	
    	
    }
    

    Hope this can be fixed!



    Posted in: Modification Development
  • 0

    posted a message on Custom model is broken
    Quote from Spyeedy»

    I'm not sure, as I'm on 1.8.9. By overriding isOpaqueCube to return false, solves the x-ray problem.


    @Override
    public boolean isOpaqueCube()
    {
        return false;
    }


    Not sure what 1.7.10 requires other than isOpaqueCube to solve the issue. Also, I recommend you update to the latest version, 1,10.


    Oh, i forgot the override annotation. But now i'm getting this:

    "The method IsOpaqueCube() of type reverselantern must override or implement a supertype method"
    Posted in: Modification Development
  • 0

    posted a message on Custom model is broken
    Quote from Spyeedy»

    You will need to override isOpaqueCube in your Block class and return false.


    I did that - it's still causing that error.
    Posted in: Modification Development
  • 0

    posted a message on Custom model is broken
    Quote from Spyeedy»

    Ah I see now, you mean this (image below)?


    Yes! that's it.
    Posted in: Modification Development
  • 0

    posted a message on Custom model is broken
    Quote from Spyeedy»

    Would be better if you provided pics of what you mean by "x-ray"


    lantern error


    Edit: It's broken. http://imgur.com/a/2E6E5 that's an imgur link

    Posted in: Modification Development
  • To post a comment, please .