• 0

    posted a message on Test Mod Code Release!
    Sorry if I posted this in the wrong place.

    About a month ago I created a test mod just for fun. I stopped developing it because I got bored so I decided to share the code with you guys!

    Please note that it is FULL of bugs, the build didn't go so well for me so the code version works better.

    Code download:
    Mod Download(Buggy not recommended):
    Posted in: Modification Development
  • 0

    posted a message on Tile Entity Icon not working[Solved]
    Sadly, no :/

    EDIT: Nvm I'm not sure why id did not work the first time!!!! This makes me facepalm so much! Thanks for the help man I really appreciate it! :)
    Posted in: Modification Development
  • 0

    posted a message on Tile Entity Icon not working[Solved]
    Because when you break the block the particles are purple and in order to fix that you need an icon.
    Posted in: Modification Development
  • 0

    posted a message on Tile Entity Icon not working[Solved]
    I fixed the 3D ItemBlock but I still can't register an Icon to it even though when I hopped over to the hopper class the registerIcon bit of code was the same.
    Posted in: Modification Development
  • 0

    posted a message on Tile Entity Icon not working[Solved]
    3D ItemBlock. Here is the tutorial I followed but it's outdated and things have changed:

    EDIT: I just failed so much!!!!! I registered it to the wrong block in the CLientProxy :P

    But I still need to set an Icon because the particles are purple.
    Posted in: Modification Development
  • 0

    posted a message on Name of Block, where do i set?
    Yes
    Posted in: Modification Development
  • 0

    posted a message on Tile Entity Icon not working[Solved]
    Edit: Tile entity is registered in the main class under FMLInitializationEvent.
    GameRegistry.registerTileEntity(TileEntityCustomBlock.class,"Custom block");
    Posted in: Modification Development
  • 0

    posted a message on Tile Entity Icon not working[Solved]
    I am trying to make a 3D item but for some reason it wont work (Probably because of outdated tutorials). I get no errors but the texture is purple and not 3d. I followed ScratchForFun's tutorial.

    Custom block model class:

    
    public class ModelCustomBlock extends ModelBase
    {
     //fields
     ModelRenderer Base;
     ModelRenderer Body1;
     ModelRenderer Shape1;
     ModelRenderer Shape2;
     ModelRenderer Shape3;
     
     public ModelCustomBlock()
     {
     textureWidth = 64;
     textureHeight = 32;
     
     Base = new ModelRenderer(this, 0, 0);
     Base.addBox(-8F, 0F, -8F, 4, 1, 4);
     Base.setRotationPoint(6F, 23F, 6F);
     Base.setTextureSize(64, 32);
     Base.mirror = true;
     setRotation(Base, 0F, 0F, 0F);
     Body1 = new ModelRenderer(this, 0, 0);
     Body1.addBox(0F, 0F, 0F, 0, 4, 4);
     Body1.setRotationPoint(-2F, 19F, -2F);
     Body1.setTextureSize(64, 32);
     Body1.mirror = true;
     setRotation(Body1, 0F, 0F, 0F);
     Shape1 = new ModelRenderer(this, 0, 0);
     Shape1.addBox(0F, 0F, 0F, 4, 4, 0);
     Shape1.setRotationPoint(-2F, 19F, -2F);
     Shape1.setTextureSize(64, 32);
     Shape1.mirror = true;
     setRotation(Shape1, 0F, 0F, 0F);
     Shape2 = new ModelRenderer(this, 0, 0);
     Shape2.addBox(0F, 0F, 0F, 0, 4, 4);
     Shape2.setRotationPoint(2F, 19F, -2F);
     Shape2.setTextureSize(64, 32);
     Shape2.mirror = true;
     setRotation(Shape2, 0F, 0F, 0F);
     Shape3 = new ModelRenderer(this, 0, 0);
     Shape3.addBox(0F, 0F, 0F, 4, 4, 0);
     Shape3.setRotationPoint(-2F, 19F, 2F);
     Shape3.setTextureSize(64, 32);
     Shape3.mirror = true;
     setRotation(Shape3, 0F, 0F, 0F);
     }
     
     public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
     {
     super.render(entity, f, f1, f2, f3, f4, f5);
     setRotationAngles(f, f1, f2, f3, f4, f5, entity);
     Base.render(f5);
     Body1.render(f5);
     Shape1.render(f5);
     Shape2.render(f5);
     Shape3.render(f5);
     }
     /**
     * Renders the model
     */
     public void renderModel(float f){
     Base.render(f);
     Body1.render(f);
     Shape1.render(f);
     Shape2.render(f);
     Shape3.render(f);
     }
     
     private void setRotation(ModelRenderer model, float x, float y, float z)
     {
     model.rotateAngleX = x;
     model.rotateAngleY = y;
     model.rotateAngleZ = z;
     }
     
     public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent)
     {
     super.setRotationAngles(f, f1, f2, f3, f4, f5, ent);
     }
    
    }
    
    

    Item Renderer class:

    
    public class ItemRendererCustomBlock implements IItemRenderer{
    
    private ModelCustomBlock model;
     
     private static ResourceLocation texture = new ResourceLocation(Reference.MODID,"textures/model/Bucket.png");
     
     private static RenderItem renderItem = new RenderItem();
     
     public ItemRendererCustomBlock(){
     model = new ModelCustomBlock();
     }
     
     public boolean handleRenderType(ItemStack item, ItemRenderType type) {
     return true;
     }
    
    
     public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,ItemRendererHelper helper) {
     return true;
     }
    
    public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
     TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityCustomBlock(), 0.0d, 0.0d, 0.0d, 0.0f);
     }
    
     
    
    }
    
    

    Item class:

    
    public class CustomTestBlock extends BlockContainer{
    
    public CustomTestBlock() {
     super(Material.iron);
     setBlockName("customTestBlock");
     this.blockHardness = 2.0f;
     this.setBlockBounds(1f/16f*6f, 0.0f, 1f/16f*6f, 1f-1f/16f*6f, 1f-1f/16f*11f,1f-1f/16f*6f);
     this.setCreativeTab(CreativeTabs.tabDecorations);
     }
    
    public TileEntity createNewTileEntity(World world,int par2) {
     return new TileEntityCustomBlock();
     }
     public int getRenderType()
     {
     return -9060;
     }
     public boolean renderAsNormalBlock()
     {
     return false;
     }
     public boolean isOpaqueCube()
     {
     return false;
     }
     @SideOnly(Side.CLIENT)
     public Block getBlockDropped(int par1, Random par2, int par3)
     {
     return testmod.customtestblock;
     }
     @SideOnly(Side.CLIENT)
     public void registerIcons(IIconRegister icon){
     this.blockIcon = icon.registerIcon(Reference.MODID + ":" + "customTestBlock");
     }
    
    }
    
    

    ClientProxy class:

    
    public class ClientProxy extends CommonProxy{
     
     public void registerProxies(){
     ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCustomBlock.class, new RendererCustomBlock());
     MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(testmod.testblock), new ItemRendererCustomBlock());
     }
    
    
    }
    
    

    Tile Entity Class (Not much):

    
    public class TileEntityCustomBlock extends TileEntity {
    
    }
    
    Thanks in advance!
    
    
    Posted in: Modification Development
  • 0

    posted a message on [SOLVED]Get Item from block?
    Oh my god you have got to be kidding me IT WAS THAT SIMPLE?????!!?:P

    Thanks dude I still don't know how I did not think of that!
    Posted in: Modification Development
  • 0

    posted a message on [SOLVED]Get Item from block?
    I want to register an Item renderer, but the item is a block and in order to register it I need to get the item of the block (Hope you understand).

    The code
    MinecraftForgeClient.registerItemRenderer(testmod.testblock.getItem, new ItemRendererCustomBlock());

    I need something like this:

    testmod.testblock.getItem

    Thanks!
    Posted in: Modification Development
  • 0

    posted a message on [solved]Custom rendered blocks help!
    My bad thanks for your help!
    Posted in: Modification Development
  • 0

    posted a message on [solved]Custom rendered blocks help!
    I want to create a custom rendered block for my testmod, so I searched for tutorials but all of them seem to be out of date(The most recent tutorial I found was for 1.6.4). I decided to learn from vanilla custom rendered blocks but I don't know where to look and all I found was this function in the block class:
     /**
     * The type of render function that is called for this block
     */
     public int getRenderType()
     {
     return 0;
     }

    Please help me!

    Thanks in advance!
    Posted in: Modification Development
  • 0

    posted a message on AttackEntityEvent Help! [SOLVED]
    Yes it worked! Thank you guys!
    Posted in: Modification Development
  • 0

    posted a message on AttackEntityEvent Help! [SOLVED]
    I tried that and here's the output:
    1xitem.testSword@0


    Now I really don't know why it does't work.
    Posted in: Modification Development
  • 0

    posted a message on AttackEntityEvent Help! [SOLVED]
    So now that that's fixed, how do I check what Item the EntityPlayer used?
    Posted in: Modification Development
  • To post a comment, please .