Jump to content

Ryat

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Ryat

  1. Ryat

    [1.8]New Earth ALPHA

    Updated. Corrected Recipes Added Better Recipe Graphics in link Clay Brick are created by clicking on Campfire Added Mixes Updated Furnace Recipes
  2. Ryat

    [1.8]New Earth ALPHA

    I have a very high opinion of what this mod could become. I'm currently working on customizing minecraft's base world generation. The purpose of this mod is to make a difficult pack that just shy of hardcore and no where near stupidness like immortal bosses. The mod is intended to be a standalone mod, but as the other modders update to 1.8 I will look at adding additional mods try it out and let me know.. Remember its in early alph There are currently 3 levels of furnaces. each will only work with their specific items Ore is distributed by Biomes so you will be required to travel for stuff. http://adf.ly/1ElIqw <------ Download Version 1.2 for 1.8 Download latest Forge 1.8 Right Click campfire with clay to make Clay Brick**** Recipes http://i.imgur.com/J3TnbDD.png http://i.imgur.com/EGxsUF9.png http://i.imgur.com/sP8tLeI.png http://i.imgur.com/1LtXpBA.png TODO: Teleportation Tool Genetic Engineering Chemistry Animal Breeding Change Log: v1.2a: Corrected Recipes Added Better Recipe Graphics Clay Brick are created by clicking on Campfire Added Mixes Updated Furnace Recipes V1.1: Added All Tools and Weapons Added Basic Crafting of materials for weapons Added Elemental Blocks If you have any suggestions please feel free to post your ideas here! thanks
  3. Figured it out. In case anyone else wants to know.... @SubscribeEvent public void populateChunk(PopulateChunkEvent.Pre event) { Chunk chunk = event.world.getChunkFromChunkCoords(event.chunkX, event.chunkZ); for (ExtendedBlockStorage storage : chunk.getBlockStorageArray()) { if (storage != null) { for (int x = 0; x < 16; ++x) { for (int y = 0; y < 16; ++y) { for (int z = 0; z < 16; ++z) { if (storage.getBlockByExtId(x, y, z) == Blocks.stone) { storage.set(x, y, z, CustomBlocks.customBlock.getDefaultState()); } } } } } } }
  4. I'd like to replace vanilla stone with different custom stones based on height. Does anyone know of anywhere I could look for a reference on doing this please? Thanks!
  5. Will do Enio and thanks. I'm trying to write the pseudo code first before I jump straight into it and just needed to make sure I can do what I want. Thanks! I'll post here when I have something in code.
  6. Can anyone tell me which of the following is best for an item on the creation of it? For example, if I want a method to call when my custom item is dropped from a block break. Will either Overridden onEntityItemUpdate or onUpdate be called while the item is in a vanilla chest? For example, I'd like to have items lose durability while in a chest. Unless I'm doing something wrong or read the documentation wrong, onCreated is being called when the item spawns from a block break, like mining an ore. Thanks in advance
  7. Thanks guys! Got it working. Much appreciated. Awesome tutorials GreyGhost
  8. Nothing really concrete right now, just messing around with jank until I can figure out how I can get the tags working correctly. DNA Class package net.newearth.ne.genetics; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; public class DNA { public Enchantment enchant; public DNA(){ enchant = new DNAHelper().getRandomEnchant(); System.out.println(getName()); } public String getName(){ return this.enchant.getName(); } /** * Return ID of Enchantment * @return */ public int getID(){ return this.enchant.effectId; } } HELPER package net.newearth.ne.genetics; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.minecraft.enchantment.Enchantment; public class DNAHelper { public ArrayList<Enchantment> eList = new ArrayList(); public DNAHelper(){ eList.add(Enchantment.aquaAffinity); eList.add(Enchantment.baneOfArthropods); eList.add(Enchantment.blastProtection); eList.add(Enchantment.depthStrider); eList.add(Enchantment.efficiency); eList.add(Enchantment.featherFalling); eList.add(Enchantment.fireAspect); eList.add(Enchantment.fireProtection); eList.add(Enchantment.flame); eList.add(Enchantment.fortune); eList.add(Enchantment.infinity); eList.add(Enchantment.knockback); eList.add(Enchantment.looting); eList.add(Enchantment.luckOfTheSea); eList.add(Enchantment.lure); eList.add(Enchantment.power); eList.add(Enchantment.projectileProtection); eList.add(Enchantment.protection); eList.add(Enchantment.punch); eList.add(Enchantment.respiration); eList.add(Enchantment.sharpness); eList.add(Enchantment.silkTouch); eList.add(Enchantment.smite); eList.add(Enchantment.thorns); eList.add(Enchantment.unbreaking); } public Enchantment getRandomEnchant(){ int x = new Random().nextInt(eList.size()); return this.eList.get(x); } public String getName(Enchantment e){ if(e == Enchantment.aquaAffinity){ return "Aqua Affinity"; } if(e == Enchantment.baneOfArthropods){ return "Bane of Arthropods"; } if(e == Enchantment.blastProtection){ return "Blast Protection"; } if(e == Enchantment.depthStrider){ return "Depth Strider"; } if(e == Enchantment.efficiency){ return "Efficiency"; } if(e == Enchantment.featherFalling){ return "Feather Falling"; } if(e == Enchantment.fireAspect){ return "Fire Aspect"; } if(e == Enchantment.fireProtection){ return "Fire Protection"; } if(e == Enchantment.flame){ return "Flame"; } if(e == Enchantment.fortune){ return "Fortune"; } if(e == Enchantment.infinity){ return "Infinity"; } if(e == Enchantment.knockback){ return "Knockback"; } if(e == Enchantment.looting){ return "Looting"; } if(e == Enchantment.luckOfTheSea){ return "Luck of the Sea"; } if(e == Enchantment.lure){ return "Lure"; } if(e == Enchantment.power){ return "Power"; } if(e == Enchantment.projectileProtection){ return "Projectile Protection"; } if(e == Enchantment.protection){ return "Protection"; } if(e == Enchantment.punch){ return "Punch"; } if(e == Enchantment.respiration){ return "Respiration"; } if(e == Enchantment.sharpness){ return "Sharpness"; } if(e == Enchantment.silkTouch){ return "Silk Touch"; } if(e == Enchantment.smite){ return "Smite"; } if(e == Enchantment.thorns){ return "Thorns"; } if(e == Enchantment.unbreaking){ return "Unbreaking"; } return "null"; } }
  9. I'm trying to add a NBTTagCompound to an Item. The code works except that when another item is spawned the tag tooltip on all other items of the same will change to match the new random value given to the new item. What I'd like to have is each instance have their own tooltip. Can anyone point me to somewhere I could look to research this please? Feel free to fix the code if you wish. Thanks! package net.newearth.ne.items; import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.newearth.ne.NewEarthMain; import net.newearth.ne.genetics.DNA; import net.newearth.ne.genetics.DNAHelper; public class CuprumMineral extends Item { public DNA dna; public CuprumMineral() { this.setMaxStackSize(1); } @Override public void onUpdate(ItemStack stack, World world, Entity entity, int metadata, boolean bool) { if (stack.getTagCompound() == null) { // System.out.println("No Tag"); stack.setTagCompound(new NBTTagCompound()); this.dna = new DNA(); } NBTTagCompound nbt = new NBTTagCompound(); String name = new DNAHelper().getName(dna.enchant); nbt.setString("dna", name); stack.getTagCompound().setTag("dna", nbt); stack.setStackDisplayName(EnumChatFormatting.AQUA + "Cuprum Mineral"); } /** * Called when item is crafted/smelted. Used only by maps so far. */ @Override public void onCreated(ItemStack stack, World worldIn, EntityPlayer playerIn) { } /** * Called when a Block is right-clicked with this Item * * @param pos * The block being right-clicked * @param side * The side being right-clicked */ @Override // Run this code when clicked public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { return false; } /** * Called whenever this item is equipped and the right mouse button is * pressed. Args: itemStack, world, entityPlayer */ @Override public ItemStack onItemRightClick(ItemStack stack, World worldIn, EntityPlayer playerIn) { /* * if(stack.getTagCompound() != null){ * * stack.getTagCompound().removeTag("dna"); * * stack.clearCustomName(); } */ return stack; } /** * allows items to add custom lines of information to the mouseover * description * * @param tooltip * All lines to display in the Item's tooltip. This is a List of * Strings. * @param advanced * Whether the setting "Advanced tooltips" is enabled */ @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) { if (stack.getTagCompound() != null) { if (stack.getTagCompound().hasKey("dna")) { NBTTagCompound nbt = (NBTTagCompound) stack.getTagCompound() .getTag("dna"); String gene = nbt.getString("dna"); tooltip.add(gene); } } } public String getItemStackDisplayName(ItemStack stack) { return ("" + StatCollector.translateToLocal(this .getUnlocalizedNameInefficiently(stack) + ".name")).trim(); } @Override @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack stack) { if (stack.getTagCompound() != null) { return stack.getTagCompound().hasKey("dna"); } return false; } }
×
×
  • Create New...

Important Information

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