Jump to content

hydroflame

Members
  • Posts

    1511
  • Joined

  • Last visited

Posts posted by hydroflame

  1. ah AH

     

    RenderingRegistry.registerEntityRenderingHandler(EntityDireWolf.class, new RenderDireWolf(new ModelDireWolf(), 1.0f));

     

    this should be in a client proxy, as the constructor "new ModelDireWolf()" is called server side in this case.

     

    so remove everythign "rendering" related from main mod and put it in the client proxy (most likely in the method "registerRenders", just remember to also call the method,  like  commonProxy.registerRenderers())

     

     

     

    in CommonProxy:

     

    public void registerRenderers(){

    //empty

    }

     

     

    in client proxy:

     

    public void registerRenderers(){

    RenderingRegistry.registerEntityRenderingHandler(EntityDireWolf.class, new RenderDireWolf(new ModelDireWolf(), 1.0f));

    //and extra stuff related

    }

     

     

    in main mod class:

     

     

    public void load( FMLsomethingEvent event){

    commonProxy.registerRenderers();

    }

     

     

     

     

    also, nice code btw, clean and all, i like it ;)

  2. no no, keep it as modelbase, im pretty sure this work since a lot of people are using it that way (mo's creature as example)

     

    it said that the import you suggested doesn't exist

    it being eclipse ? (that b*tch)

     

    can you put in

     

    sploier

     

     

    your main mod class, model class, proxies class and wolf mob thigny class ?

  3. this is just speculation as i have never worked with models yet.

     

    but if you have to add @SideOnly(Side.CLIENT) you would only need to put it the line above public class yourclassname{} as it would say to forge that the whole class is client only

     

    but then again that might not help

     

    make sure that the only place there you have

     

    import Modelwtv;

    is in files that are only used by the client

  4. you could always just make a loop

     

    public int getHighestBlock(world, x, z){
    
    for(int i = 128; i > 0; i--){
    if(world.getBlockId(x, i, z) != 0){
      return i;
    }
    
    return 0;
    }
    }
    

     

    if it return 0 all the time it means your code is running BEFORE the land is generated

  5. It just doesn't work for me.

     

    yo fresh my mod doesnt work fix it!

     

    no srly if you want us to help, explain whats happening, is there just straight up nothing happening.

    i noticed that my version of "onBlockActivate" has way more parameter. maybe its just cuz they changed it (im still in 151) but i doubt thats the case

    is there any error coming up.

  6. I'm wondering how you get the y coordinate that is not underground

     

    heu ... y coordinate of what ?

     

    because technicly yes 0 is a y coordinate.

     

    are you asking how to get the y coordinate of the first block starting from the sky ? aka the non-air block that has the highest Y for a given x, z ?

  7. change modifier of blockMetadata to static

    yeah sorry i didnt actually compiled the code, i tought you would understand what i meant

     

    to render in inventory you have to make a class that implements IItemRenderer and render when the ItemRenderType is of INVENTORY_BLOCK

     

    look at the javadoc and the actual class its pretty straightfoward

  8. no, in the minecraft hierarchy, "entity" is above mob which is itself a "entityLiving"

    i am honestly not sure how to spawn entities but im sure it would be a good idea to use them

     

    to give a good example. the waypoints in rei minimap, visually are "entity" not mob or entity living.

     

    look at the wiki you could probably find something about it.

     

    if you cant find anything, the only other help I can give you is to wait until I need to use them in my mod, which should be soon enough but i can't give any precise ETA

     

    -hydroflame-

     

     

  9. Hey there, welcome to forge, hope you wont be leaving soon

     

    1

    client side:

    Minecraft.getMinecraft().objectMouseOver

     

    this contains whatever the player is pointing at

     

    (oh btw i shouldnt told you, here in forge you have to deal with client/server side, but the advantage are worth it)

     

     

    2 how to move blocks, well for the tornado i can imagine that the tornado itself is an "entity" (which btw with forge you can create your own) i guess it has a random chance to set a block to air and "pick up" the block (using entity rendering, you would render the block floating in the air but it probably wouldnt be collidable)

     

    3 honestly the tutorial about metadata is pretty complete, try to play around with it and you should figure it out easy

     

    ps: the tutorial will teach you a lot. try to look there first if you have a question because usually you can find the answer

     

    -hydroflame, FRev-

  10.  

     

    package mar21.omega.machine.tileEntity.render;

     

    import mar21.omega.machine.MachinePoweredMelter;

    import mar21.omega.mar21.Mar21Extender;

    import net.minecraft.block.Block;

    import net.minecraft.client.renderer.OpenGlHelper;

    import net.minecraft.client.renderer.Tessellator;

    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

    import net.minecraft.entity.Entity;

    import net.minecraft.tileentity.TileEntity;

    import net.minecraft.world.World;

     

    import org.lwjgl.opengl.GL11;

     

    public class TileEntityPoweredMelterRender extends TileEntitySpecialRenderer {

         

            //The model of your block

            private final powered_melter model;

         

            public TileEntityPoweredMelterRender() {

                    this.model = new powered_melter();

            }

         

            //you dont need this function

            private void adjustRotatePivotViaMeta(World world, int x, int y, int z) {

                    int meta = world.getBlockMetadata(x, y, z);

                    GL11.glPushMatrix();

                    GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);

                    GL11.glPopMatrix();

            }

         

            @Override

            public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {

            //The PushMatrix tells the renderer to "start" doing something.

                    GL11.glPushMatrix();

            //This is setting the initial location.

                    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);

            //This is the texture of your block. It's pathed to be the same place as your other blocks here.

                    bindTextureByName(Mar21Extender.getRenderedTexture("powered_melter"));

            //This rotation part is very important! Without it, your model will render upside-down! And for some reason you DO need PushMatrix again!                     

                    GL11.glPushMatrix();

                    GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);

            //This rotation part is making the model rotated as well!

     

    //i think you can do this

    side = te.blockMetadata;

    //and adjust the rotation after

     

                    if(side == 0){GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);}

                    if(side == 1){GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);}

                    if(side == 2){GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);}

                    if(side == 3){GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);}

            //A reference to your Model file. Again, very important.

                    this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

            //Tell it to stop rendering for both the PushMatrix's

                    GL11.glPopMatrix();

                    GL11.glPopMatrix();

            }

     

            //Set the lighting stuff, so it changes it's brightness properly.     

            private void adjustLightFixture(World world, int i, int j, int k, Block block) {

                    Tessellator tess = Tessellator.instance;

                    float brightness = block.getBlockBrightness(world, i, j, k);

                    int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

                    int modulousModifier = skyLight % 65536;

                    int divModifier = skyLight / 65536;

                    tess.setColorOpaque_F(brightness, brightness, brightness);

                    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,  (float) modulousModifier,  divModifier);

            }

    }

     

     

  11. I'm not that new to programming.

    i wasn't necessarily referring to you, sorry :P

     

    Tile Entity are basically extra information about a block, for example, sign have a tile entity that contains the text they are suppose to show

    ,beacon block contains information about their state (on off) and which buff they are giving

     

    it is important to note that you cant place tile entities on block that dont support them, aka dirt, stone air, flower etc, etc

     

    in my case i am using a new block called the plotblock. its tile entity contains the information about the width/height/length of the plot, this way i can use these information to draw a frame to visualize what are the limits that the plot owner can build in (as well as extra information like the cost of the plot etc etc)

     

    the difference between using TE (tile entities) and entities is that tile entities are tied to a bloc. while entities are free to be placed anywhere.

    you could technicly make an invisible entity that has information about the width/height/length of the protected area and x, y,z  and use this entity to draw a big box that represents the limit of the area.

     

    for TE they're are good tutorial on the wiki about how why when to use them. as for entitiy i am not sure as i am not using them (yet).

     

    @redria7, ahaha, sorry xD, but you understand what i mean?

×
×
  • Create New...

Important Information

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