Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

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


RedstoneBiten
 Share

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
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.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Yep, it's what the title says I only found out how to generate flowers and didn't find the the thingy with all the configured features are Would be nice if someone could help! Thanks
    • I started a server with PlayerRevive/Tombstone mod and when I die and I respawn I don't stop dying. Also I have a Issue with FramedBlocks: when I put one block of this mod, the server crashes and closes. I put here the server log: [16:55:36 ERROR]: Exception caught during firing event: Cannot invoke "net.minecraft.world.World.func_201670_d()" because "this.field_145850_b" is null         Index: 11         Listeners:                 0: HIGHEST                 1: ASM: class ovh.corail.tombstone.event.EventHandler onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 2: NORMAL                 3: ASM: class com.mrcrayfish.guns.common.DelayedTask onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 4: ASM: class shadows.placebo.util.PlaceboTaskQueue tick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 5: ASM: com.dairymoose.modernlife.core.ModernLifeCommon@501855c1 onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 6: ASM: com.github.alexthe666.citadel.server.CitadelEvents@7bca1184 onServerTickEvent(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 7: ASM: me.ichun.mods.ichunutil.common.core.EventHandlerServer@41275fcc onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 8: ASM: net.minecraftforge.common.ForgeInternalHandler@5495b2c1 onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 9: ASM: class com.simibubi.create.events.CommonEvents onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 10: ASM: class net.geforcemods.securitycraft.SCEventHandler onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 11: ASM: class xfacthd.framedblocks.common.util.EventHandler onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 12: ASM: class com.hollingsworth.arsnouveau.api.event.EventQueue serverTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 13: ASM: com.mrcrayfish.obfuscate.common.data.SyncedPlayerData@2c57ecfc onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 14: ASM: noppes.npcs.ServerTickHandler@30710a3e onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V                 15: ASM: com.sk89q.worldedit.forge.ThreadSafeCache@37b339fc tickStart(Lnet/minecraftforge/event/TickEvent;)V                 16: LOWEST                 17: ASM: ovh.corail.tombstone.proxy.ServerProxy@5a4a21ad onServerTick(Lnet/minecraftforge/event/TickEvent$ServerTickEvent;)V java.lang.NullPointerException: Cannot invoke "net.minecraft.world.World.func_201670_d()" because "this.field_145850_b" is null         at xfacthd.framedblocks.common.tileentity.FramedTileEntity.checkSolidStateOnLoad(FramedTileEntity.java:539)         at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)         at xfacthd.framedblocks.common.util.EventHandler.onServerTick(EventHandler.java:84)         at net.minecraftforge.eventbus.ASMEventHandler_485_EventHandler_onServerTick_ServerTickEvent.invoke(.dynamic)         at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)         at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)         at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)         at net.minecraftforge.fml.hooks.BasicEventHooks.onPreServerTick(BasicEventHooks.java:113)         at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:1001)         at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:818)         at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:269)         at java.base/java.lang.Thread.run(Thread.java:833) [16:55:36 ERROR]: Encountered an unexpected exception [16:55:36 FATAL]: Preparing crash report with UUID 62ce1105-b5dd-4f30-9af8-999e3f1f687f [16:55:37 ERROR]: This crash report has been saved to: /home/container/./crash-reports/crash-2022-09-29_16.55.36-server.txt
    • Been looking everywhere, just hope this helps someone. As of 1.19.2 the only way that doesn't cause problems would be to use push(). Unless someone is brighter than me lol.   @SubscribeEvent public static void onLivingJump(LivingEvent.LivingJumpEvent event){ float jumpMultiplier = 0.07F; if (event.getEntity() instanceof Player){ event.getEntity().push(0,jumpMultiplier,0); }  
  • Topics

×
×
  • Create New...

Important Information

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