Jump to content

[1.7.10] Turn block to Default Block (Techne Model)


RedstoneBiten

Recommended Posts

Hi! How do i make block turn to Default again? What i mean is that my code has the code: public void onNeighborBlockChange(World world, int i, int j, int k, Block l) So it teleport the model up. BUT! When i destory the block and place it again, its at the same point there i destoryed it.

 

Sorry for my bad english! Please help

 

 

Code:

 

public ModelRocket slide = new ModelRocket();

private double angle;

 

public void onNeighborBlockChange(World world, int i, int j, int k, Block l)

{

angle = angle - 0.3;

slide.Shape1.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape3.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape4.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape5.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape6.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape8.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape9.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape10.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape11.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape13.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape14.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape16.rotationPointY = (float)angle;

angle = angle - 0.3;

slide.Shape17.rotationPointY = (float)angle;

angle = angle - 0.05;

slide.Shape1.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape3.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape4.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape5.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape6.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape8.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape9.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape10.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape11.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape13.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape14.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape16.rotateAngleY = (float)angle;

angle = angle - 0.05;

slide.Shape17.rotateAngleY = (float)angle;

}

 

 

public int quantityDropped(Random par1Random){

return 1;

}

 

}

public static class TileEntityCustom extends TileEntity {}

public static class TileEntityCustomRenderer extends TileEntitySpecialRenderer {

private final ModelRocket model;

public TileEntityCustomRenderer() {this.model = new ModelRocket();}

@Override

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

GL11.glPushMatrix();

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

ResourceLocation textures = (new ResourceLocation("Rocket.png"));

Minecraft.getMinecraft().renderEngine.bindTexture(textures);

GL11.glPushMatrix();

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

GL11.glPushMatrix();

GL11.glRotatef(te.getBlockMetadata() * 90, 0.0F, 1.0F, 0.0F);

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

GL11.glPopMatrix();

GL11.glPopMatrix();

GL11.glPopMatrix();}

}

 

// Date: 2015-03-23 16:54:43

// Template version 1.1

// Java generated by Techne

// Keep in mind that you still need to fill in some blanks

// - ZeuX

 

 

 

 

 

 

 

 

public static class ModelRocket extends ModelBase

{

//fields

public static ModelRenderer Shape1;

public static ModelRenderer Shape3;

public static ModelRenderer Shape4;

public static ModelRenderer Shape5;

public static ModelRenderer Shape6;

public static ModelRenderer Shape8;

public static ModelRenderer Shape9;

public static ModelRenderer Shape10;

public static ModelRenderer Shape11;

public static ModelRenderer Shape13;

public static ModelRenderer Shape14;

public static ModelRenderer Shape16;

public static ModelRenderer Shape17;

 

public ModelRocket()

{

textureWidth = 2000;

textureHeight = 2000;

 

Shape1 = new ModelRenderer(this, 0, 500);

Shape1.addBox(-24F, -96F, -24F, 48, 120, 48);

Shape1.setRotationPoint(0F, 0F, 0F);

Shape1.setTextureSize(2000, 2000);

Shape1.mirror = true;

setRotation(Shape1, 0F, 0F, 0F);

Shape3 = new ModelRenderer(this, 0, 800);

Shape3.addBox(-8F, 8F, 24F, 16, 19, 10);

Shape3.setRotationPoint(0F, 0F, 0F);

Shape3.setTextureSize(2000, 2000);

Shape3.mirror = true;

setRotation(Shape3, 0F, 0F, 0F);

Shape4 = new ModelRenderer(this, 0, 800);

Shape4.addBox(24F, 8F, -8F, 10, 19, 16);

Shape4.setRotationPoint(0F, 0F, 0F);

Shape4.setTextureSize(2000, 2000);

Shape4.mirror = true;

setRotation(Shape4, 0F, 0F, 0F);

Shape5 = new ModelRenderer(this, 0, 800);

Shape5.addBox(-8F, -8F, 24F, 16, 16, 10);

Shape5.setRotationPoint(0F, 0F, 0F);

Shape5.setTextureSize(2000, 2000);

Shape5.mirror = true;

setRotation(Shape5, 0F, 0F, 0F);

Shape6 = new ModelRenderer(this, 0, 800);

Shape6.addBox(-8F, 8F, -34F, 16, 19, 10);

Shape6.setRotationPoint(0F, 0F, 0F);

Shape6.setTextureSize(2000, 2000);

Shape6.mirror = true;

setRotation(Shape6, 0F, 0F, 0F);

Shape8 = new ModelRenderer(this, 0, 800);

Shape8.addBox(-8F, -8F, -34F, 16, 16, 10);

Shape8.setRotationPoint(0F, 0F, 0F);

Shape8.setTextureSize(2000, 2000);

Shape8.mirror = true;

setRotation(Shape8, 0F, 0F, 0F);

Shape9 = new ModelRenderer(this, 0, 800);

Shape9.addBox(-34F, -8F, -8F, 10, 16, 16);

Shape9.setRotationPoint(0F, 0F, 0F);

Shape9.setTextureSize(2000, 2000);

Shape9.mirror = true;

setRotation(Shape9, 0F, 0F, 0F);

Shape10 = new ModelRenderer(this, 500, 0);

Shape10.addBox(21F, -77F, -8F, 6, 16, 16);

Shape10.setRotationPoint(0F, 0F, 0F);

Shape10.setTextureSize(2000, 2000);

Shape10.mirror = true;

setRotation(Shape10, 0F, 0F, 0F);

Shape11 = new ModelRenderer(this, 0, 800);

Shape11.addBox(24F, -8F, -8F, 10, 16, 16);

Shape11.setRotationPoint(0F, 0F, 0F);

Shape11.setTextureSize(2000, 2000);

Shape11.mirror = true;

setRotation(Shape11, 0F, 0F, 0F);

Shape13 = new ModelRenderer(this, 0, 800);

Shape13.addBox(-34F, 8F, -8F, 10, 19, 16);

Shape13.setRotationPoint(0F, 0F, 0F);

Shape13.setTextureSize(2000, 2000);

Shape13.mirror = true;

setRotation(Shape13, 0F, 0F, 0F);

Shape14 = new ModelRenderer(this, 600, 0);

Shape14.addBox(-32F, -102F, -32F, 64, 6, 64);

Shape14.setRotationPoint(0F, 0F, 0F);

Shape14.setTextureSize(2000, 2000);

Shape14.mirror = true;

setRotation(Shape14, 0F, 0F, 0F);

Shape16 = new ModelRenderer(this, 900, 0);

Shape16.addBox(-23F, -105F, -24F, 48, 3, 48);

Shape16.setRotationPoint(0F, 0F, 0F);

Shape16.setTextureSize(2000, 2000);

Shape16.mirror = true;

setRotation(Shape16, 0F, 0F, 0F);

Shape17 = new ModelRenderer(this, 1300, 0);

Shape17.addBox(-4F, -125F, -3F, 8, 20, 8);

Shape17.setRotationPoint(0F, 0F, 0F);

Shape17.setTextureSize(2000, 2000);

Shape17.mirror = true;

setRotation(Shape17, 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);

 

Shape1.render(f5);

Shape3.render(f5);

Shape4.render(f5);

Shape5.render(f5);

Shape6.render(f5);

Shape8.render(f5);

Shape9.render(f5);

Shape10.render(f5);

Shape11.render(f5);

Shape13.render(f5);

Shape14.render(f5);

Shape16.render(f5);

Shape17.render(f5);

}

 

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 e)

 

{

super.setRotationAngles(f, f1, f2, f3, f4, f5, e);

}

 

}}

 

Link to comment
Share on other sites

I make a redstone clock and hock it up to the block because it causes a block update thingy.. yeah you know and if i dont place a block on the dust bla bla bla it does not move and if i place 1 on the dust and one NOT on the dust the other one will still move. Because they use the same thingy.. its like 1 block but 2 cant explain xD

Link to comment
Share on other sites

This is the worst idea ever.

 

Use a damn tile entity for christ sakes.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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