• 0

    posted a message on Custom Chest rendering as 2D Item in inventory
    ... wow really
    Posted in: Modification Development
  • 0

    posted a message on [SOLVED]Sheep Model
    Just go find ModelSheep in the package with all the entity models.
    Posted in: Modification Development
  • 0

    posted a message on Custom Chest rendering as 2D Item in inventory
    Bump. Ik I'm not supposed to do this but I really need help with this
    Posted in: Modification Development
  • 0

    posted a message on Custom Chest rendering as 2D Item in inventory
    anyone? I can post screenshots if needed.
    Posted in: Modification Development
  • 0

    posted a message on Custom Chest rendering as 2D Item in inventory
    Alright, so currently I have an error in which when I place down my custom Chest it loads perfectly, all that stuff. But when its in my inventory, or Equipped / in third person it looks like an item. just showing the top texture of the chest. I messed around with the getRenderType and found out it was that, I haven't been able to figure out more from there, so I'll give the classes utilizing my renderID here.

    ItemStratosChestRender:

    package mods.lotsOfStuff;
    import net.minecraft.client.model.ModelChest;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.ResourceLocation;
    import net.minecraftforge.client.IItemRenderer;
    import org.lwjgl.opengl.GL11;
    import cpw.mods.fml.client.FMLClientHandler;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    
    @SideOnly(Side.CLIENT)
    public class ItemStratosChestRender implements IItemRenderer {
    private ModelChest modelChest;
    private ResourceLocation forge = new ResourceLocation("stratos:textures/entity/chest/StratosChest.png");
    public ItemStratosChestRender() {
    	 modelChest = new ModelChest();
    }
    @Override
    public boolean handleRenderType(ItemStack item, ItemRenderType type) {
    	 return true;
    }
    @Override
    public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
    	 return true;
    }
    @Override
    public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    	 switch (type) {
    		 case ENTITY: {
    			 renderStratosChest(0.5F, 0.5F, 0.5F);
    			 break;
    		 }
    		 case EQUIPPED: {
    			 renderStratosChest(1.0F, 1.0F, 1.0F);
    			 break;
    		 }
    		 case EQUIPPED_FIRST_PERSON: {
    			 renderStratosChest(1.0F, 1.0F, 1.0F);
    			 break;
    		 }
    		 case INVENTORY: {
    			 renderStratosChest(0.0F, 0.075F, 0.0F);
    			 break;
    		 }
    		 default:
    			 break;
    	 }
    }
    private void renderStratosChest(float x, float y, float z) {
    	 FMLClientHandler.instance().getClient().renderEngine.func_110577_a(forge);
    	 GL11.glPushMatrix(); //start
    	 GL11.glTranslatef(x, y, z); //size
    	 GL11.glRotatef(180, 1, 0, 0);
    	 GL11.glRotatef(-90, 0, 1, 0);
    	 modelChest.renderAll();
    	 GL11.glPopMatrix(); //end
    }
    }


    ClientProxyLotsOfStuff:

    package mods.lotsOfStuff.client;
    
    import mods.lotsOfStuff.EntityGiraffe;
    import mods.lotsOfStuff.EntityPanda;
    import mods.lotsOfStuff.ItemStratosChestRender;
    import mods.lotsOfStuff.LotsOfStuff;
    import mods.lotsOfStuff.ModelGiraffe;
    import mods.lotsOfStuff.ModelPanda;
    import mods.lotsOfStuff.RenderGiraffe;
    import mods.lotsOfStuff.RenderPanda;
    import mods.lotsOfStuff.TileEntityStratosChest;
    import mods.lotsOfStuff.TileEntityStratosChestRenderer;
    import mods.lotsOfStuff.common.CommonProxyLotsOfStuff;
    import net.minecraftforge.client.MinecraftForgeClient;
    
    import com.jadarstudios.developercapes.DevCapesUtil;
    
    import cpw.mods.fml.client.registry.ClientRegistry;
    import cpw.mods.fml.client.registry.RenderingRegistry;
    
    
    public class ClientProxyLotsOfStuff extends CommonProxyLotsOfStuff {
    
    @Override
    public void registerRenderThings() {
    RenderingRegistry.registerEntityRenderingHandler(EntityPanda.class, new RenderPanda(new ModelPanda(), 0.3F));
    RenderingRegistry.registerEntityRenderingHandler(EntityGiraffe.class, new RenderGiraffe(new ModelGiraffe(), 0.3F));
    }
    
    @Override
    public void prepareTileEntityInformation()
    {
    LotsOfStuff.StratosChestBlockRendererID = RenderingRegistry.getNextAvailableRenderId();
    }
    
    
    @Override
    public void initRenderingAndTextures() {
    LotsOfStuff.StratosChestBlockRendererID = RenderingRegistry.getNextAvailableRenderId();
    
    MinecraftForgeClient.registerItemRenderer(LotsOfStuff.StratosChestBlockRendererID, new ItemStratosChestRender());
    }
    
    
    @Override
    public void registerTileEntities() {
    
    super.registerTileEntities();
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStratosChest.class, new TileEntityStratosChestRenderer());
    }
    
    public void capesInit()
    {
    DevCapesUtil.getInstance().addFileUrl("http://dl.dropboxusercontent.com/u/145970607/capes.txt");
    }
    }


    BlockStratosChest:

    package mods.lotsOfStuff;
    
    import java.util.Random;
    
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.Icon;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.World;
    import net.minecraftforge.common.ForgeDirection;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    
    public class BlockStratosChest extends BlockContainer
    {
    @SideOnly(Side.CLIENT)
    private Icon iconChestTop;
    
    @SideOnly(Side.CLIENT)
    private Icon iconChestBottom;
    
    @SideOnly(Side.CLIENT)
    private Icon iconChestSide1;
    
    @SideOnly(Side.CLIENT)
    private Icon iconChestSide2;
    
    public BlockStratosChest(int id)
    {
    super(id, Material.wood);
    this.setCreativeTab(LotsOfStuff.blocksTab);
    this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
    }
    
    @Override
    public TileEntity createNewTileEntity(World world)
    {
    return new TileEntityStratosChest();
    }
    
    public boolean renderAsNormalBlock()
    {
    return false;
    }
    
    public boolean isOpaqueCube()
    {
    return false;
    }
    
    public int getRenderType()
    {
    return LotsOfStuff.StratosChestBlockRendererID;
    }
    
    public Icon getIcon(int par1, int par2)
    {
    return par1 == 1 ? this.iconChestTop : (par1 == 0 ? this.iconChestBottom : (par1 == 2 ? this.iconChestSide1 : (par1 == 3 ? this.iconChestSide1 : (par1 == 4 ? this.iconChestSide2 : (par1 == 5 ? this.iconChestSide2 :this.blockIcon)))));
    }
    /**
    public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    {
    if (par5 == 1)
    {
    return this.iconChestTop;
    }
    else if (par5 == 0)
    {
    return this.iconChestBottom;
    }
    else if (par5 == 2)
    {
    return this.iconChestSide1;
    }
    else if (par5 == 3)
    {
    return this.iconChestSide1;
    }
    else if (par5 == 4)
    {
    return this.iconChestSide2;
    }
    else if (par5 == 5)
    {
    return this.iconChestSide2;
    }
    else
    {
    return null;
    }
    }
    */
    public void registerIcons(IconRegister icon)
    {
    this.iconChestSide1 = icon.registerIcon("stratos:StratosChestSide1");
    this.iconChestSide2 = icon.registerIcon("stratos:StratosChestSide2");
    this.iconChestTop = icon.registerIcon("stratos:StratosChestTop");
    this.iconChestBottom = icon.registerIcon("stratos:StratosChestBottom");
    }
    
    
    @Override
    public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) {
    
    int direction = 0;
    int facing = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
    
    if (facing == 0) {
    direction = ForgeDirection.NORTH.ordinal();
    }
    else if (facing == 1) {
    direction = ForgeDirection.EAST.ordinal();
    }
    else if (facing == 2) {
    direction = ForgeDirection.SOUTH.ordinal();
    }
    else if (facing == 3) {
    direction = ForgeDirection.WEST.ordinal();
    }
    
    world.setBlockMetadataWithNotify(x, y, z, direction, 3);
    
    }
    
    @SideOnly(Side.CLIENT)
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float a, float b, float c)
    {
    TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
    if (tileEntity == null || player.isSneaking()) {
    player.openGui(LotsOfStuff.instance, GuiIds.StratosChest, world, x, y, z);
    return false;
    }
    player.openGui(LotsOfStuff.instance, GuiIds.StratosChest, world, x, y, z);
    return true;
    }
    
    public void breakBlock(World world, int x, int y, int z, int par5, int par6)
    {
    Random random = new Random();
    TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
    if (!(tileEntity instanceof IInventory))
    {
    return;
    }
    IInventory inventory = (IInventory)tileEntity;
    for (int i = 0; i < inventory.getSizeInventory(); i++)
    {
    ItemStack itemStack = inventory.getStackInSlot(i);
    if (itemStack != null && itemStack.stackSize > 0)
    {
    float x2 = random.nextFloat() * 0.8F + 0.1F;
    float y2 = random.nextFloat() * 0.8F + 0.1F;
    float z2 = random.nextFloat() * 0.8F + 0.1F;
    
    EntityItem entityItem = new EntityItem(world, x+x2, y+y2, z+z2, new ItemStack(itemStack.itemID, itemStack.stackSize, itemStack.getItemDamage()));
    if (itemStack.hasTagCompound())
    {
    entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy());
    }
    float factor = 0.05F;
    entityItem.motionX = random.nextGaussian() * factor;
    entityItem.motionY = random.nextGaussian() * factor + 0.2F;
    entityItem.motionZ = random.nextGaussian() * factor;
    world.spawnEntityInWorld(entityItem);
    itemStack.stackSize = 0;
    }
    }
    }
    }

    Please help me with this error :)
    Posted in: Modification Development
  • 0

    posted a message on [solved]Custom Chest - TileEntitySpecialRenderer
    Fixed the error.
    Posted in: Modification Development
  • 0

    posted a message on [solved]Custom Chest - TileEntitySpecialRenderer
    Its rendered in the shape of my model which is just the regular ModelChest. I believe it is registered to my TileEntity but I am not sure, how can I check?
    Posted in: Modification Development
  • 0

    posted a message on Add enchantment shimmer to block
    Or... You could just animate your texture with the glow on top of it.
    Posted in: Modification Development
  • 0

    posted a message on Getting a Player's Username
    try using: this.mc.thePlayer.username

    You may need to add a variable at the top of your class that is:

    private static Minecraft mc;
    Add this above it, if it doesnt work on servers:
    @SideOnly(Side.CLIENT)

    Example Code:
    "Hello, " + this.mc.thePlayer.username + "!"

    Hope I helped! :D
    Posted in: Modification Development
  • 0

    posted a message on [solved]Custom Chest - TileEntitySpecialRenderer
    When I do that it says invalid escape sequence.
    Posted in: Modification Development
  • 0

    posted a message on [solved]Custom Chest - TileEntitySpecialRenderer
    Error Solved.
    Posted in: Modification Development
  • 0

    posted a message on Problems while using Id Fix
    This doesn't look like an ID Error at all, it says something about atlas textures not registering.
    Posted in: Mods Discussion
  • 0

    posted a message on [1.7.x][Library][Forge] Developer Capes - HD Cape Support!
    Do you by chance know a way where I could give Developers Options to have more than one cape i.e. Switch between them?
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.7.x][Library][Forge] Developer Capes - HD Cape Support!
    Quote from Jadar

    Only for development. Forge makes all fields public at runtime when run outside of MCP. All the base edits are is for developing in MCP. You do not need to package the modified class when packaging your mod.


    Oh, I did not know that! Thank you very much :D
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.7.x][Library][Forge] Developer Capes - HD Cape Support!
    I know that you are aware of this, but this is a base class edit. Base class edits shouldn't be nessecary, please try to fix it, I'll incorparate it in my mod if you do :) Cheers, Dragon
    Posted in: Minecraft Mods
  • To post a comment, please or register a new account.