• 0

    posted a message on Custom regrowing grass.
    I did that and re-worked some stuff and finally got it working. Thanks!
    Posted in: Modification Development
  • 0

    posted a message on Custom regrowing grass.
    This is my new code, still not working.




    package ModOfZombiesBlocks;
    
    import java.util.Random;
    
    import ModOfZombies.ZombieMod;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.main.Main;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.util.IIcon;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.World;
    import net.minecraftforge.common.IPlantable;
    import net.minecraftforge.common.util.ForgeDirection;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    
    public class BlockSurvivalGrass extends Block {
     
     public IIcon Bottom;
     public IIcon Top;
     public IIcon Front;
     public IIcon Back;
     public IIcon Left;
     public IIcon Right;
     @SideOnly(Side.CLIENT)
     private IIcon field_150200_a;
     @SideOnly(Side.CLIENT)
     private IIcon field_150199_b;
     public BlockSurvivalGrass(Material material) {
     super(material);
     this.setTickRandomly(true);
     this.setCreativeTab(CreativeTabs.tabBlock);
     this.setHardness(0.5F);
     this.setResistance(1F);
     this.setBlockName("Moss");
     }
    
     
    
    /**
     * Ticks the block if it's been scheduled
     */
     public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
     {
     if (!p_149674_1_.isRemote)
     {
     if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2)
     {
     p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, ZombieMod.BlockSurvivalDirt);
     }
     else if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9)
     {
     for (int l = 0; l < 4; ++l)
     {
     int i1 = p_149674_2_ + p_149674_5_.nextInt(3) - 1;
     int j1 = p_149674_3_ + p_149674_5_.nextInt(5) - 3;
     int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
     Block block = p_149674_1_.getBlock(i1, j1 + 1, k1);
    
    if (p_149674_1_.getBlock(i1, j1, k1) == ZombieMod.BlockSurvivalDirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
     {
     p_149674_1_.setBlock(i1, j1, k1, this);
     }
     }
     }
     }
     }
    
    public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
     {
     return ZombieMod.BlockSurvivalDirt.getItemDropped(0, p_149650_2_, p_149650_3_);
     }
     public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable)
     {
     return true;
     }
    
    @SideOnly(Side.CLIENT)
     public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_)
     {
     if (p_149673_5_ == 1)
     {
     return this.field_150200_a;
     }
     else if (p_149673_5_ == 0)
     {
     return Blocks.dirt.getBlockTextureFromSide(p_149673_5_);
     }
     else
     {
     Material material = p_149673_1_.getBlock(p_149673_2_, p_149673_3_ + 1, p_149673_4_).getMaterial();
     return material != Material.snow && material != Material.craftedSnow ? this.blockIcon : this.field_150199_b;
     }
     }
    
    public void registerBlockIcons(IIconRegister icon){
     Bottom = icon.registerIcon(ZombieMod.modid + ":Dirt");
     Top = icon.registerIcon(ZombieMod.modid + ":grass_top");
     Front = icon.registerIcon(ZombieMod.modid + ":grass_side");
     Back = icon.registerIcon(ZombieMod.modid + ":grass_side");
     Left = icon.registerIcon(ZombieMod.modid + ":grass_side");
     Right = icon.registerIcon(ZombieMod.modid + ":grass_side");
     }
    
    public IIcon getIcon(int side, int meta)
     {
     if(side == 0){
     return Bottom;
     }else if(side == 1){
     return Top;
     }
     return Left;
     }
    }


    And don't say its because the 1 isnt there that was in the original, I renamed the class.
    Posted in: Modification Development
  • 0

    posted a message on Custom regrowing grass.
    So I am trying to make a custom grass for my biome that drops dirt and the dirt regrows to grass like vanilla minecraft grass. I do not believe the dirt code is relevant but here is my grass code.


    package ModOfZombiesBlocks;
    
    import java.util.Random;
    
    import ModOfZombies.ZombieMod;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.util.IIcon;
    import net.minecraft.world.World;
    
    public class BlockSurvivalGrass1 extends Block {
     
     public IIcon Bottom;
     public IIcon Top;
     public IIcon Front;
     public IIcon Back;
     public IIcon Left;
     public IIcon Right;
    
    public BlockSurvivalGrass1(Material material) {
     super(material);
     this.setHardness(0.6F);
     this.setStepSound(soundTypeGrass);
     }
    
    @Override
     public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
     {
     return ZombieMod.BlockSurvivalDirt.getItemDropped(0, p_149650_2_, p_149650_3_);
     }
    
    public void registerBlockIcons(IIconRegister icon){
     Bottom = icon.registerIcon(ZombieMod.modid + ":Dirt");
     Top = icon.registerIcon(ZombieMod.modid + ":grass_top");
     Front = icon.registerIcon(ZombieMod.modid + ":grass_side");
     Back = icon.registerIcon(ZombieMod.modid + ":grass_side");
     Left = icon.registerIcon(ZombieMod.modid + ":grass_side");
     Right = icon.registerIcon(ZombieMod.modid + ":grass_side");
     }
    
    public IIcon getIcon(int side, int meta)
     {
     if(side == 0){
     return Bottom;
     }else if(side == 1){
     return Top;
     }
     return Left;
     }
     
    }


    I have already tried copying the vanilla grass and editing it to fit my blocks. Still does not work so if anybody can at least point me in the right direction to make it regrow that would be great!
    Posted in: Modification Development
  • 0

    posted a message on [1.7.x] Using reflection to modify vanilla values without coremodding!
    Haven't tested yet but I hope this works, thanks!
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Mob/Egg don't show? SOLVED
    The entity doesn't have a model loaded in yet. I just want the egg to show up before I continue. The egg isn't showing up.
    Posted in: Modification Development
  • 0

    posted a message on Mob/Egg don't show? SOLVED
    I believe I have all the right code? But the egg isnt appearing in my creative menu or anywhere for that matter. The mob doesn't show up anywhere either.

    Main class

    package ModOfZombies;
    
    //Imports
    import java.util.Random;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.EntityList;
    import net.minecraft.entity.EnumCreatureType;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraftforge.common.util.EnumHelper;
    import MOZ.generation.ZomboniteGenerationClass;
    import ModOfZombies.blocks.OreZomboniteOre;
    import ModOfZombies.items.ZMItems;
    import cpw.mods.fml.common.IWorldGenerator;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.Mod.Instance;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.event.FMLPostInitializationEvent;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.registry.EntityRegistry;
    import cpw.mods.fml.common.registry.GameRegistry;
    
    //ID
    @Mod(modid = ZombieMod.modid, version = ZombieMod.VERSION)
    public class ZombieMod
    {
    public static final String modid = "ZombieMod";
    public static final String VERSION = "0.1";
    private static final String Gen = null;
    
    //More Mob
    public ZombieMod(){
     
     //EntityReg
     EntityRegistry.addSpawn(EntityTest.class, 4, 1, 4, EnumCreatureType.monster);
    }
    
    //CreativeTab
    public static CreativeTabs tabExample = new CreativeTabs("tabExample")
    {
    public Item getTabIconItem()
    {
    return Items.bed;
    }
    };
    
    //Blocks
    public static Block oreZomboniteOre;
    
    
    //Items
    public static Item itemZomboniteIngot;
    
    //Materials
    public static final Item.ToolMaterial ZOMBONITEMATERIAL = EnumHelper.addToolMaterial("ZOMBONITEMATERIAL", 1, 200, 4.0F, 1.5F, 12);
    
    //Register World Generation
    public static IWorldGenerator gen = new ZomboniteGenerationClass();
    public static Object instance;
    
    //Event Handlers
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    
    
     //Zombonite Ingot
     itemZomboniteIngot = new ZMItems().setUnlocalizedName("Zombonite Ingot");
     GameRegistry.registerItem(itemZomboniteIngot, "Zombonite Ingot");
     
     //Zombonite Ore
     oreZomboniteOre = new OreZomboniteOre(Material.rock).setBlockName("Zombonite Ore");
     GameRegistry.registerBlock(oreZomboniteOre, "Zombonite Ore");
    }
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
     EntityHandler.registerMonsters(EntityTest.class, "Cyclops");
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    
    }
    }


    Mob Entity

    package ModOfZombies;
    
    import net.minecraft.entity.SharedMonsterAttributes;
    import net.minecraft.entity.ai.EntityAIAttackOnCollide;
    import net.minecraft.entity.ai.EntityAIHurtByTarget;
    import net.minecraft.entity.ai.EntityAIMoveThroughVillage;
    import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
    import net.minecraft.entity.ai.EntityAISwimming;
    import net.minecraft.entity.ai.EntityAIWander;
    import net.minecraft.entity.ai.EntityAIWatchClosest;
    import net.minecraft.entity.monster.EntityMob;
    import net.minecraft.entity.passive.EntityVillager;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.World;
    import net.minecraft.world.biome.BiomeCache.Block;
    
    public class EntityTest extends EntityMob {
     
     public EntityTest(World world) {
     super(world);
     
     this.tasks.addTask(0, new EntityAISwimming(this));
     this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true));
     this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
     this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false));
     this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
     this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
     this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
     this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
     this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, true));
     }
    
    protected Item getDropItem()
    {
     return Items.apple;
    }
    
    protected void dropRareDrop(int par1) {
     this.entityDropItem(new ItemStack(Items.gold_ingot, 1, 1), 0.0F);
    }
    
    
    protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
    {
     this.playSound("mob.zombie.step", 0.15F, 1.0F);
    }
     
    /*
     protected void applyEntityAttributes()
    {
     super.applyEntityAttributes();
     this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
     this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D);
     this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);
     this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
    }
    */
    @Override
    protected void applyEntityAttributes()
    {
     
     super.applyEntityAttributes();
     this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(10.0D);
     this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D);
     this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.0D);
     this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.0D);
     this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(60.0D);
     
    }
     
     protected boolean isAIEnabled()
    {
     return true;
    }
    
    } 




    EntityHandler

    package ModOfZombies;
    
    import java.util.Random;
    
    import net.minecraft.entity.EntityList;
    import net.minecraft.entity.EnumCreatureType;
    import net.minecraft.world.biome.BiomeGenBase;
    import cpw.mods.fml.common.registry.EntityRegistry;
    
    public class EntityHandler {
     
     public static void registerMonsters(Class entityClass, String name) {
     int entityId = EntityRegistry.findGlobalUniqueEntityId();
     long x = name.hashCode();
     Random random = new Random(x);
     int mainColor = random.nextInt() * 16777215;
     int subColor = random.nextInt() * 16777215;
     
     EntityRegistry.registerGlobalEntityID(entityClass, name, entityId);
     EntityRegistry.addSpawn(entityClass, 50, 2, 4, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.forest);
     EntityRegistry.registerModEntity(entityClass, name, entityId, ZombieMod.instance, 64, 1, true);
     EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, mainColor, subColor));
     
     }
    }
    
    
     


    Posted in: Modification Development
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    I apologize for no updates! School is keeping me really busy...
    Posted in: Maps
  • 1

    posted a message on [ADV] [Maze] [Parkour] End Game!
    Funny thing is I already had a much bigger parkour idea for this map so you are in luck :)
    Posted in: Maps
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    Quote from Psergiop2

    It's just that I rather not face...whatever the end beast is,without armor hehe :P .Maybe an ender chest where you put the armor and other stuff and retrieve it at the end of the parkour.
    Oh trust me! I have ideas on how to make the dragon a bit easier once the time comes but it will take a bit longer to gather supplies. I am hoping I am not dragging the story on with part 2 but it should be MUCH longer than a like 15-20 minute play through.
    Posted in: Maps
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    Quote from Psergiop2

    Hehe,Thanks Vegeto,just needed to clear my mind.
    As I said there's no need to rush it,just please watchout for the armor degrading in stuff like lava as it happened oh the PArt 1, it would break down in one attack :P
    I think I have a work around to the armor issue! Don't worry everything will work fine before I release it! I plan on having a friend do a thorough test.
    Posted in: Maps
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    I just want to let you guys know this map is much more in depth then the first one and it will require more than two days to make. I want to have it out by next week but no promises. I am a solo worker and I want to keep it that way so just be patient! Thanks! :)
    Posted in: Maps
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    Quote from Psergiop2

    Me too if you don't mind.
    Just a question is this a remake or an ADD to Part 1?
    I'm unsure if I should start from beginning if it'll just get me into another area hehe :P
    Good luck and It seems pretty nice,just don't rush it :D
    I don't know what you mean exactly. The old parts will be there but won't be accessible.
    Posted in: Maps
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    I updated the videos section with all the new LPs and here are some very tiny teaser images :)
    Posted in: Maps
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    Hey! My internet is down but I am still working on the map. I will post teaser images and update the OP with all the lets play as soon as my internet is back up I am currently using my phone to right this.
    Posted in: Maps
  • 0

    posted a message on [ADV] [Maze] [Parkour] End Game!
    Quote from CraftingVegeto

    Would be good to have a little teaser for the PART 2 :P
    I think i'm not the only one waiting for that buddy ;)
    I will soon! Progress is slowing down because of school but I will definitely continue to work on it! :D
    Quote from Psergiop2

    I might just do a let's play too,I'm currently looking for good maps and this one seems good! ^_^
    Alright cool! :D Post it here if you do! :)
    Posted in: Maps
  • To post a comment, please or register a new account.