-
[1.8]Custom Rendered Blocks
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?
-
[1.8]Custom Rendered Blocks
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...
- [1.7.10]OpenGL11
-
[1.7.10]Custom Rendered Block Questions
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
-
[1.7.10]Custom Rendered Block Questions
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...
-
[1.7.10][SOLVED]Detecting the way player is looking
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?
-
[1.7.10][SOLVED]Detecting the way player is looking
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?
-
[1.7.10][SOLVED]Block Right Click
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; }
-
[1.7.10][SOLVED]Block Right Click
any ideas about right click?
-
[1.7.10][SOLVED]Block Right Click
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?
-
[1.7.10][SOLVED]Custom Rendered Blocks
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?
-
[1.7.10][SOLVED]Custom Rendered Block rotation and with hitbox
||||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(); } }
-
[1.7.10][SOLVED]Custom Rendered Block rotation and with hitbox
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.
-
[1.7.10]OpenGL11
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?
-
[1.7.10][SOLVED]Custom Rendered Block rotation and with hitbox
I tried in block.java and RenderBlock.java.... Am I being a total noob? ╥﹏╥
IPS spam blocked by CleanTalk.