Jump to content

memcallen

Members
  • Posts

    343
  • Joined

  • Last visited

Everything posted by memcallen

  1. Eclipse
  2. I don't know what's wrong, or how to fix it...
  3. It can't inline it because the class doesn't have a source attachment...
  4. I have this code: player.setVelocity(player.motionX,player.motionY+1D,player.motionZ); player.velocityChanged = true; And it doesn't crash me, but it kicks me because EntityPlayer.setVelocity doesn't exist server side. How could I fix this?
  5. Ok I got it to work, thanks
  6. Yes, I have all my events in one class so that I don't have to register multiple event handlers. I use FMLCommonHandler.instance().bus().register(new Events()) (Events is my event class).
  7. I found this event: EntityJoinWorldEvent but I can't figure out what the proper method is called. I did this: @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event){ System.out.println("Joined!"); } But it never prints "Joined!" in the console. Am I using the correct event/method for this event?
  8. I tried this: GL11.glTranslated(0.5F, 0.5F, 0.5F); GL11.glRotated(dir*90, 0, 1, 0); GL11.glTranslated(-0.5F, -0.5F, -0.5F); It works slightly better, but it's still offset a little bit.
  9. So the centre point is in the middle of the main axle? And Is gl11.gltranslated relative or absolute?
  10. http://www.minecraftforge.net/wiki/Rendering_a_Techne_Model_as_a_Block I'm pretty sure this is outdated, but it should be the same.
  11. I am using the metadata, I think the first post has a different trial than what I was doing (I'm using metadata*90 for the rotation). Thanks, I wasn't sure what the last float was for, I've never seen any uses for it in any tutorials.
  12. I mean as in when you rotate a block, it rotates oddly heres a video:
  13. I've made a turbine block that looks like a windmill. It's supposed to run off of steam blocks that I've added, but it doesn't rotate correctly. My TESR class: package com.example.gammacraft.blockRenderers; import org.lwjgl.opengl.GL11; import com.example.gammacraft.TileEntity.SteamTurbineTileEntity; import assets.gammacraft.textures.models.SteamTurbineModel; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class SteamTurbineRenderer extends TileEntitySpecialRenderer { SteamTurbineModel model; public SteamTurbineRenderer() { model = new SteamTurbineModel(); } @Override public void renderTileEntityAt(TileEntity tile, double x, double y,double z, float scale) { int dir = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord); SteamTurbineTileEntity te = (SteamTurbineTileEntity)tile.getWorldObj().getTileEntity(tile.xCoord, tile.yCoord, tile.zCoord); GL11.glPushMatrix(); GL11.glTranslated(x+0.5F, y+0.5F, z); GL11.glRotated(te.getRotation(), 0, 0, 1); System.out.println(te.getRotation()); GL11.glDisable(GL11.GL_LIGHTING); this.bindTexture(new ResourceLocation("gammacraft:textures/blocks/Candle.png")); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } My TileEntity (I will add the packets later): package com.example.gammacraft.TileEntity; import net.minecraft.tileentity.TileEntity; public class SteamTurbineTileEntity extends TileEntity { public int Speed = 0; public float rotation = 0; public SteamTurbineTileEntity() { // TODO Auto-generated constructor stub } public void setRotation(float rot){ this.rotation = rot; } public float getRotation(){ return this.rotation; } public void setSpeed(int Speed){ this.Speed = Speed; } public int getSpeed(){ return this.Speed; } } And my block class: package com.example.gammacraft.blocks.energy; import java.util.Random; import com.example.gammacraft.gammacraft; import com.example.gammacraft.TileEntity.SteamTurbineTileEntity; import net.minecraft.block.Block; import net.minecraft.block.BlockPistonBase; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class SteamTurbine extends Block implements ITileEntityProvider { public SteamTurbine() { super(Material.iron); this.setCreativeTab(gammacraft.gammacraftcreativetab); this.setBlockName("SteamTurbine"); } public void onNeighborBlockChange(World world, int x, int y, int z, Block block){ SteamTurbineTileEntity te = (SteamTurbineTileEntity)world.getTileEntity(x, y, z); if(world.getBlock(x, y-1, z)==gammacraft.SteamBlock)te.Speed=5; world.scheduleBlockUpdate(x, y, z, (Block)this, 1); } public void updateTick(World world,int x,int y,int z,Random random){ SteamTurbineTileEntity te = (SteamTurbineTileEntity)world.getTileEntity(x, y, z); te.setRotation(te.getRotation()+te.getSpeed()); if(world.getBlock(x, y-1, z)!=gammacraft.SteamBlock){ if(te.Speed>0){ te.Speed--; } if(te.Speed<0){ te.Speed++; } }else{ if(te.Speed>0){ te.Speed++; } if(te.Speed<0){ te.Speed--; } } System.out.println(te.Speed); if(te.Speed!=0) world.scheduleBlockUpdate(x, y, z, (Block)this, 2); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float Hitx, float Hity, float Hitz) { if(player.getHeldItem()!=null){ if(player.getHeldItem().getItem()==gammacraft.wrench){ if(side!=0||side!=1){ world.setBlockMetadataWithNotify(x, y, z, side-2, 0); System.out.println(side); } return true; } } return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new SteamTurbineTileEntity(); } @Override public boolean isOpaqueCube(){ return false; } @Override public int getRenderType() { return -1; } public boolean renderAsNormalBlock() { return false; } }
  14. Ok thanks.
  15. Does FluidContainerRegistry.getFluidForFilledItem work with milk? I noticed that it's not extending ItemBucket
  16. 1.In the getCapacity() method is it in buckets or millibuckets? 2.How do I get the Fluid in a bucket? 3.Is there a Field that I can use for getting the fluid? Thanks in advance
  17. I'm assuming that you can't render a Turbo Model Thingy?
  18. I've created a Turbo Model Thingy with techne (if you don't use techne that's what it's called). I tried using export as>Java but it didn't work, it just rendered a cube. How am I supposed to render a cone? (I'm making a Geyser but I want a model for it)
  19. Yeah I haven't done rendering in a while...
  20. I don't know why but my TESR isn't rendering @Override public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glTranslated(var2, var4, var6); t.addVertexWithUV(10*pixel, 0*pixel, 0*pixel,1,1); t.addVertexWithUV(10*pixel, 6*pixel, 6*pixel,1,0); t.addVertexWithUV(6*pixel, 6*pixel, 6*pixel,0,0); t.addVertexWithUV(6*pixel, 0*pixel, 0*pixel, 0, 1); GL11.glPopMatrix(); } The function gets called but it doesn't render.
  21. It's in hex? That makes more sense. Thanks
  22. bump, I've made no progress so far... :'(
  23. "[15:37:18] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:random.explosion" It still doesn't work. Whats the sound called? Do I have to use the entire path? EDIT: Nevermind, I put explosion instead of explode, it works now. Thanks!
  24. Yeah I did, I spent some time trying to figure out what it meant, and I figured out the "getRenderColor()" function, although I have no idea what it does.
  25. Then what are the explosion sounds called? I'm in 1.7.2 and I even checked in the eclipse folder to make sure it was right...
×
×
  • Create New...

Important Information

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