Jump to content

LordFokas

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by LordFokas

  1. What I'm suggesting is a quick and painless change, which is changing

    Block.getCollisionBoundingBoxFromPool(World w, int x, int y, int z)

    to

    Block.getCollisionBoundingBoxFromPool(World w, int x, int y, int z, Entity e)

    where the Entity is the one whose collision is being tested at the moment. It should be ignored by minecraft / forge code, but it's useful when you need to override some block collisions in specific ways.

     

    While you can use 'addCollidingBlockToList()' to override collision behavior, as long as your AABB is not null, non-living entities such as EntityItem and EntityArrow will still collide with the block, even if you have overriden 'addCollidingBlockToList()' to allow those entities to go through the block.

    On the other hand, if your returned AABB is null, addCollidingBlockToList doesn't seem to get called at all, so you can't just sneak your real AABB into the list anyways.

  2. Actually, tickCount is how slow you want it to rotate.

    That's the amount of ticks (1/20th of a second) between each rotation. So the fastest setting would be 1, while 20 would result in a rotation / second.

     

    Note that the texture width must be a multiple of 16, and the height must be a multiple of the width.

    Frames are stacked vertically, so the image should always be taller than it is wide.

  3. Well,

     

    1) You can't. Minecraft doesn't support it. The best bet you have is to bind textures between rendering calls on the model renderers. Like, render Modelrenderer1, bind texture, render Modelrenderer2. However you can't do it inside modelrenderers that are a child node to other modelrenderers. I have a project, called ARC (Advanced Rendering Core) that is still under development. It is Open Source. It allows you to define a texture not only per block, but also per face. It also enables you to do a lot more things that Minecrafts rendering system doesn't support.

     

    2) You need to save the reference to the specific modelrenderer and rotate it as you wish every time you render. This won't work inside custom block renderers, because they're barely even called. To achieve the kind of animation you want, you need a TileEntitySpecialRenderer. However, using a TESR is very expensive, and you should avoid it unless strictly necessary.

  4. You don't need a TileEntity. In fact, that's more downsides than anything else...

     

    Like DarkGuardsman said, you get the players rotation. But that's a float, and you can't use that on MetaData.

     

    I have a block that can have horizontal rotation, which depends pretty much on the player's Yaw angle.

    So I have this function on my Helper class:

     

    public static int yaw2dir(float yaw){
    	int dir = (MathHelper.floor_double((double)(yaw * 4.0F / 360.0F) + 0.5D) & 3)+3;
    	if(dir > 4) dir -= 4;
    	switch(dir){
    		case 1: return dirZPos;
    		case 2: return dirXNeg;
    		case 3: return dirZNeg;
    		case 4: return dirXPos;
    		default: return 0;
    	}
    }
    

     

    When the block is placed, I call that function with player.rotationYaw, and it returns the block's orientation (facing the player). I then proceed to set that value as the block's Metadata.

     

    It is later used by my block's renderer to decide what texture to use on each face.

  5. It's pretty much the same thing.

     

    you just need to override String getTextureFile() on your blocks, to return your texture file's path.

    Then on getBlockTextureFromSide you just return the index of the texture in that file, according to the side.

     

    You should also have your client proxy tell Forge to preload that file, when the mod initializes.

    And that's pretty much it.

     

    I don't know if I was clear or you understood me, but in case the answer is no, just tell me and I'll help.

  6. Of course you can.

     

    In Eclipse, just click the folder you want (common or src) and add a new package.

    When you compile and reobfuscate the code, there will be a folder tree with the same name as your packages in /reobf

  7. Is the block made by you, or should it apply to any block?

     

    If it's made by you, you can use metadata to do that, assuming you don't need a complex system.

    If it's not, you can replace the block by another block made by yourself, and have a TileEntity store the block that was in that place.

     

    I can't help any more unless you are more specific and give more details on the feature you're trying to create.

  8. Actually SCC's answer is not that bad... And it does work... although I don't know if you can succeed to assign a block an ID that is already being used... probably Eloraam has a way to go around it, given she's one of the Forge main devs (or was at least), and her skill levels are above those of the average modder.

     

    At this moment, the core mod option sounds the best, or you can waste some hours looking at the code, searching for something that allows you to override a block the way Elo does with the Mossy cobble.

  9. I never rendered items, only blocks, that's why I asked. I assumed you knew what you were doing, turns out you needed an entity so you just cast the first object you get your hands on to Entity and use it as a parameter on the function.

     

    I'm not able to help you any more, nor do I believe you are fit to be a modder, or any kind of programmer at all.

    This is probably my last reply on this thread.

     

    Please do yourself a favor and learn proper programming before attempting to make a Minecraft mod.

×
×
  • Create New...

Important Information

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