Jump to content

Wyverndoes

Members
  • Posts

    22
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    *boop*

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Wyverndoes's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. What if i just create a custom block and use a .JSON file written by programs like Cubik (ones that 3D resourcepack creators use)... will it work?
  2. Ngh (ಠ益ಠ) In 1.8 blocks have changed a lot, so can anybody tell me what classes/.JSON files i need? I'm importing my models from techne...
  3. 1) I thought that blocks that aren't 1x1x1 are custom rendered. 2) Yeah i know that's possible. and I've seen that post, great work 3) Yes, that will work only for torches, because they are being placed on other block sides not on top of each other... I'll figure something out and post it... for now it'll be unsolved ヽ(^‥^=ゞ) ~daze
  4. Is there way to make custom rendered slab and make so you can place redstone on it? or have carpet and be able to place fence on it... Does it have to do something with colliding box? I have never seen something like that in vanilla minecraft...
  5. I have this problem, when I place block facing one direction bounding box works perfectly, but if another one is placed(other direction) it changes first ones too... and also after reloading the game, bounding box is set to the default(1F). I'm using this code public static ForgeDirection getFacing(Entity entity){ int dir = MathHelper.floor_double((entity.rotationYaw * 4 / 360) + 0.5) & 3; return ForgeDirection.VALID_DIRECTIONS[Direction.directionToFacing[dir]]; } public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { int l = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int dir = MathHelper.floor_double((player.rotationYaw * 4 / 360) + 0.5) & 3; world.setBlockMetadataWithNotify(x, y, z, l, 2); System.out.println(l); if(getFacing(player) == ForgeDirection.EAST){ setBlockBounds(0.625F, 0F, 0.625F, 0.875F, 0.1875F, 0.875F); }else if(getFacing(player) == ForgeDirection.NORTH){ setBlockBounds(0.625F, 0F, 0.125F, 0.875F, 0.1875F, 0.375F); }else if(getFacing(player) == ForgeDirection.SOUTH){ setBlockBounds(0.125F, 0F, 0.625F, 0.375F, 0.1875F, 0.875F); }else if(getFacing(player) == ForgeDirection.WEST){ setBlockBounds(0.125F, 0F, 0.125F, 0.375F, 0.1875F, 0.375F); } } I've tried using setblockmetadatawithnotify (stairs use that) but nothing... anyone?
  6. I want to know if there is a code which detects the way player is looking, so i can make something like this: onblockplaced if player is looking at north(-180 in minecraft) then setboundingbox else if player is looking at south... etc. any ideas?
  7. figured it out... Now I just need (!world.isremote) and I'll make so it consumes an item ~solved~ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int X, float Y, float Z, float f) { if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().getItem() == Items.blaze_rod) { EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(Items.blaze_powder, 4)); entityitem.delayBeforeCanPickup = 5; world.spawnEntityInWorld(entityitem); } return true; }
  8. So, after deep search into minecraft files I've come up with this : public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int X, float Y, float Z, float f){ ItemStack itemstack = entityplayer.getCurrentEquippedItem(); if(entityplayer.inventory.currentItem == 369){ EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(Items.blaze_powder, 4)); entityitem.delayBeforeCanPickup = 10; world.spawnEntityInWorld(entityitem); } return true; } but it doesn't work i want to make so that on right click (with specific item) block drops other item... i changed inside 'if' statement if(entityplayer.inventory.hasItem(Items.blaze_rod)){ and it drops blaze powder, as expected, but you can get it from any inventory slot (you must have blaze rod in inventory somewhere) and it spawns two entities(one of them isn't pickable) also doesn't consumes blaze rod...I don't want to use consumeinventoryitem method because of other items... Any ideas?
  9. i was just wandering, i want to make a custom rendered crystals, but i don't want it to be just cubes sticking out of the ground(Techne allows only that) If i use Blender, can java read .OBJ files?
  10. ||||UPDATE|||| I added rotation angles but it still doesn't work package com.joey.renderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import com.joey.Main.lib.RefStrings; import com.joey.blocks.TileEntity.TileEntityMaP; import com.joey.model.ModelMaP; public class RenderMaP extends TileEntitySpecialRenderer{ private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":" + "textures/model/MaP.png"); private ModelMaP model; public RenderMaP(){ this.model = new ModelMaP(); } public static AxisAlignedBB getRotatedInstance(AxisAlignedBB def, int rotation) { def = def.copy(); def.offset(-0.25, -0.5, -0.25); switch (rotation) { case 2 : def = AxisAlignedBB.getBoundingBox(0.625F, 0F, 0.375F * -1, 0.875F, 0.1875F, 0.125F * -1); case 3 : def = AxisAlignedBB.getBoundingBox(0.375F * -1, 0F, 0.875F * -1, 0.125F * -1, 0.1875F, 0.625F * -1); case 1 : def = AxisAlignedBB.getBoundingBox(0.875F * -1, 0F, 0.125F, 0.625F * -1, 0.1875F, 0.375F); } def.offset(0.25, 0.5, 0.25); return def; } public void renderAModelAt(TileEntityMaP EntityMaP, double x, double y, double z, float f){ int metadata = EntityMaP.getBlockMetadata(); int rotationAngle = 0; if(metadata%4 == 0){ rotationAngle = 0; } if(metadata%4 == 1){ rotationAngle = 270; } if(metadata%4 == 2){ rotationAngle = 180; } if(metadata%4 == 3){ rotationAngle = 90; } GL11.glPushMatrix(); GL11.glTranslated((float) x + 0.5F,(float) y + 1.5F,(float) z + 0.5F); GL11.glScalef(1.0F, -1F, -1F); GL11.glRotatef(rotationAngle * 90, 0.0F, 1.0F, 0.0F); this.bindTexture(texture); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0.0F, 0.0F, 1.0F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } }
  11. package com.joey.renderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import com.joey.Main.lib.RefStrings; import com.joey.model.ModelMaP; public class RenderMaP extends TileEntitySpecialRenderer{ private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":" + "textures/model/MaP.png"); private ModelMaP model; public RenderMaP(){ this.model = new ModelMaP(); } public static AxisAlignedBB getRotatedInstance(AxisAlignedBB def, int rotation) { def = def.copy(); def.offset(-0.25, -0.5, -0.25); switch (rotation) { case 2 : def = AxisAlignedBB.getBoundingBox(0.625F, 0F, 0.375F * -1, 0.875F, 0.1875F, 0.125F * -1); case 3 : def = AxisAlignedBB.getBoundingBox(0.375F * -1, 0F, 0.875F * -1, 0.125F * -1, 0.1875F, 0.625F * -1); case 1 : def = AxisAlignedBB.getBoundingBox(0.875F * -1, 0F, 0.125F, 0.625F * -1, 0.1875F, 0.375F); } def.offset(0.25, 0.5, 0.25); return def; } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0.0F, 0.0F, 1.0F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } I also forgot to change default center offsets (defs are 0.5(center of the block)) but already fixed it with some help... I think this must work now... isn't it? just gonna add rotation to it.
  12. In custom block 'render.java' I had mistake, where i forgot to put 'x' here : GL11.glPushMatrix(); GL11.glTranslatef((float) ||x|| + 0.5F, (float) y + 1.5F, (float) z + 0.5F); everything worked well but when I logged in rendered texture was following player according to x axis... I want to do the same thing but with rotation(so texture rotates around block axis) according to player location, but after playing with numbers in this GL11.glRotatef(180, 0.0F, 0.0F, 1.0F); I got nothing..... .・゜゜・(/。\)・゜゜・. any ideas?
  13. I tried in block.java and RenderBlock.java.... Am I being a total noob? ╥﹏╥
×
×
  • Create New...

Important Information

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