Jump to content

3059673

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by 3059673

  1. Player NBT data is not sent from server to client on join, client receives data only after data has been changed 1 time. How to sync player data on join ?
  2. Well, movement with WASD only allows forward, backward, and strafe left and right. Turning and looking up/down/right/left requires a captive mouse, so you cannot have both at the same time. At least without a major rework of the movement code. If you want to get into that, I can't help. But, I'd advise against it because users may become very disoriented. Im working on thaumcraft addon(for now just for private uses). Im remaking the foci switching system (pressing F when you have dosens of them may be confusing). So far ive made a working quick-change system. But what if you are escaping some monsters chasing you and you want to quickly change the focus and run at the same time ? Thats it ! I looked at ichuns morph source, he actually does what i need but he uses his own HUD not smth like a furnace gui. Thats the problem
  3. I mean "furnace inventory" I have an item. When i rightclick, inventory opens (container) . All player movement is normally blocked. But i need it to be not blocked. I know i could make smth like a HUD that shows on rightclick, but i want vanilla to maintain all container/gui, mouse clicking, itemstack grabbing stuff .............., it's too hard to make !
  4. I need to make GUI that would not block player movement (W,S,A,D) . How can I do that ?
  5. Where should i call FMLNetworkHandler.openGui/EntityPlayer.openGui on SERVER or on CLIENT ?
  6. TickHandler - Server - player //ThaumicWheelProject if(utils.isKeyPressed("V",player.username) && player.getCurrentEquippedItem()!= null && player.getCurrentEquippedItem().getItem() instanceof ItemWandCasting && (!player.getEntityData().hasKey(ThaumicWheelUtils.isOpenedForNBT) || !player.getEntityData().getBoolean(ThaumicWheelUtils.isOpenedForNBT))){ player.getEntityData().setBoolean(ThaumicWheelUtils.isOpenedForNBT, true); new SimplePacket().openNewThaumicWheelGUI(player); } else if(!utils.isKeyPressed("V",player.username) && (player.getEntityData().hasKey(ThaumicWheelUtils.isOpenedForNBT) || player.getEntityData().getBoolean(ThaumicWheelUtils.isOpenedForNBT))){ player.getEntityData().setBoolean(ThaumicWheelUtils.isOpenedForNBT, false); if(ThaumicWheelUtils.GUIs.containsKey(player)) player.closeScreen(); ThaumicWheelUtils.GUIs.remove(player); } //................ In packethandler FMLNetworkHandler.openGui is used. Container public class ThaumicWheelContainer extends Container{ public World world; public EntityPlayer player; public int posX,posY,posZ; public ItemStack pouch; public int pouchSlot = -1; public IInventory inv = new FocusPouchINV(); public ThaumicWheelContainer(EntityPlayer player,World par2World, int par3, int par4, int par5) { this.world = par2World; this.posX = par3; this.posY = par4; this.posZ = par5; this.player = player; this.pouch = ThaumicWheelUtils.playerGetPouch(player); this.pouchSlot = ThaumicWheelUtils.playerGetPouchSlot(player); ThaumicWheelUtils.GUIs.put(player, this); for (int a = 0; a < 18; a++) { this.addSlotToContainer(new RestrictedSlot(inv, a, 37 + a % 6 * 18, 60 + a / 6 * 18,IWandFocus.class)); } ItemFocusPouch p = (ItemFocusPouch) ConfigItems.itemFocusPouch; if(pouch != null && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemWandCasting){ ItemStack[] fs = p.getInventory(pouch); for(int i = 0;i<fs.length;i++){ inv.setInventorySlotContents(i, fs[i]); } }else{ player.closeScreen(); player.getEntityData().setBoolean(ThaumicWheelUtils.isOpenedForNBT, false); if(ThaumicWheelUtils.GUIs.containsKey(player)) player.closeScreen(); ThaumicWheelUtils.GUIs.remove(player); } } @Override public boolean canInteractWith(EntityPlayer entityplayer) { return true; } public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer){ new SimplePacket().changeWandFoci(par4EntityPlayer,par1); return (((Slot)this.inventorySlots.get(par1)) != null) ? ((Slot)this.inventorySlots.get(par1)).getStack() : null; } } GuiContainer public class ThaumicWheelGUI extends GuiContainer{ public EntityPlayer player; public ItemStack wand; public ThaumicWheelGUI(EntityPlayer player,World world,int x, int y,int z){ super(new ThaumicWheelContainer(player,world,x,y,z)); this.player = player; this.wand = player.getCurrentEquippedItem(); } public boolean doesGuiPauseGame() { return false; } public void drawScreen(int par1, int par2, float par3) { super.drawScreen(par1, par2, par3); } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { UtilsFX.drawTag(50, 50, Aspect.AIR); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("thaumcraft","textures/gui/gui_focuspouch.png")); int x = (this.width-175)/2; int y = (this.height-142)/2; GL11.glEnable(3042); this.drawTexturedModalRect(x, y, 0, 0, 175, 142); GL11.glDisable(3042); } }
  7. My custom container slots are overlaying player's invetory slots (not visually). When i click on slots in my container, it somehow clicks on the respective slot in player's inventory and swaps/puts/takes items from it . How do i manage that ? In my container constructor i didn't add any player's inventory slots, i don't need them.
  8. Normally, in vanila minecraft when a player walks any item in his hand is rendrering with "walking" animation. When i walk with my custom modeled item in hand, item "walks" too much . How to reduce the "walking" amimation ? Im pretty sure that the causes are incorrect gl translations, rotations or scales.
  9. Thanks that solved the problem; -dx,-dy,-dz is ok
  10. When i do GL11.glRotatef(angle, axisX, axisY, axisZ) it doesn't rotate around its center . If you know EnderStorage mod's Ender tank I want to rotate a valve similar to its one . My one rotates incorrectly , around some other point, not center
  11. How to rotate an object (IModelCustom part in my case) around its center and specified axis ?
  12. I have some kind of modular Block that saves its upgrades/modules in its NBT + owner's username. But how would i make a recipe if its nbt is always different: players are different, upgrades are different . THAUMCRAFT RECIPES ARE NBT SENSETIVE !!! If i place already modified block, recipe is not going to work !
  13. I'm making a custom recipe for thaumcraft. So i obviously can't use any custom recipe managers or handlers. What do i need : basicly have some ItemStacks for input and take one of them, change its NBT and then pass it to the output. Thaumcraft recipe handler works like original minecraft one ("xyx","zzz","bbb",'z',stack,'y',stack2.....) and thaum recipe handler is NBT sensetive on input. Any ideas ?
  14. I found the mistake. I used getPickBlock method to specify the output ItemStack @Override public ItemStack getPickBlock(MovingObjectPosition mop, World world, int x, int y, int z) { RussyPeripheral tile = (RussyPeripheral) world.getBlockTileEntity(x, y, z); ItemStack stack = new ItemStack(this,1); if(!stack.hasTagCompound()) stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setString("owner", tile.Username); stack.getTagCompound().setBoolean("canWaitForKey",tile.canWaitForKey); if(tile.eniquepass != null) stack.getTagCompound().setString("pass", tile.eniquepass); stack.getTagCompound().setInteger("valve1Active", tile.valve1state); stack.getTagCompound().setBoolean(tile.RVALVE_UPGRADE, tile.rightValveUpgrade); for(int i = 0;i<MyTickHandler.loadedRussyTiles.size();i++){ if(MyTickHandler.loadedRussyTiles.get(i).xCoord == tile.xCoord && MyTickHandler.loadedRussyTiles.get(i).yCoord == tile.yCoord && MyTickHandler.loadedRussyTiles.get(i).zCoord == tile.zCoord){ MyTickHandler.loadedRussyTiles.remove(i); } } return stack; } But I should have used getBlockDropped method for it . Thank you for your responses ! SOLVED
  15. I have created an ItemBlock to save NBT data to it then someone breaks its block. Block : public class ChairBlock extends BlockContainer{ int renderType ; private int x,y,z; public ChairBlock(int par1, Material par2Material ) { super(par1, par2Material); this.setResistance(120F); this.setHardness(120F); this.setBlockUnbreakable(); } @Override public boolean renderAsNormalBlock() { return false; } public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("rs:Peripheral"); } public boolean hasTileEntity(){ return true; } public boolean isOpaqueCube(){ return false; } @Override public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return true; } @Override public int getRenderType() { return renderType; } public void setRenderType(int id){ this.renderType = id; } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if(world.isRemote) return true; MovingObjectPosition hit = RayTracer.retraceBlock(world, player, x, y, z); RussyPeripheral tile = (RussyPeripheral) world.getBlockTileEntity(x, y, z); if(!player.isSneaking()){ if(hit == null) return false; if(Utils.isHoldingUsableWrench(player) && tile.Username.equals(player.username)){ if(tile.blockMetadata + 1 > 3){ world.setBlockMetadataWithNotify(x, y, z, 0, 2); }else{ world.setBlockMetadataWithNotify(x, y, z, tile.blockMetadata+1, 2); } return true; } if(hit.subHit == 1 && tile.getInstalledUpgrades().contains(tile.RVALVE_UPGRADE)){ tile.setValve1Activated(); } }else{ if(Utils.isHoldingUsableWrench(player) && tile.Username.equals(player.username) && !player.capabilities.isCreativeMode){ this.removeBlockByPlayer(world, player, x, y, z); } } return true; } @Override public ItemStack getPickBlock(MovingObjectPosition mop, World world, int x, int y, int z) { RussyPeripheral tile = (RussyPeripheral) world.getBlockTileEntity(x, y, z); ItemStack stack = new ItemStack(this,1); if(!stack.hasTagCompound()) stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setString("owner", tile.Username); stack.getTagCompound().setBoolean("canWaitForKey",tile.canWaitForKey); if(tile.eniquepass != null) stack.getTagCompound().setString("pass", tile.eniquepass); stack.getTagCompound().setInteger("valve1Active", tile.valve1state); stack.getTagCompound().setBoolean(tile.RVALVE_UPGRADE, tile.rightValveUpgrade); for(int i = 0;i<MyTickHandler.loadedRussyTiles.size();i++){ if(MyTickHandler.loadedRussyTiles.get(i).xCoord == tile.xCoord && MyTickHandler.loadedRussyTiles.get(i).yCoord == tile.yCoord && MyTickHandler.loadedRussyTiles.get(i).zCoord == tile.zCoord){ MyTickHandler.loadedRussyTiles.remove(i); } } return stack; } @Override public TileEntity createNewTileEntity(World world){ RussyPeripheral tile = new RussyPeripheral(); tile.setUsername("NONE"); MyTickHandler.loadedRussyTiles.add(tile); return tile; } public TileEntity createTileEntity(World world, int metadata) { RussyPeripheral tile = new RussyPeripheral(); tile.setUsername("NONE"); MyTickHandler.loadedRussyTiles.add(tile); return tile; } @Override public boolean removeBlockByPlayer(World world, EntityPlayer player, int x, int y, int z) { if(!player.capabilities.isCreativeMode && !world.isRemote) dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); world.setBlockToAir(x, y, z); return true; } public void onBlockPlacedBy(World par1World, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack stack){ } public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { RussyPeripheral tile = (RussyPeripheral) par1World.getBlockTileEntity(par2, par3, par4); int ro = 0; if(tile.worldObj != null){ ro = tile.getBlockMetadata(); } float xMin,yMin,zMin,xMax,yMax,zMax; xMin = 0.12500001F; yMin = 0.0F; zMin = 0.10500001F; xMax = 0.9049993F; yMax = 0.8949993F; zMax = 0.88999933F; if(ro == 1){ this.setBlockBounds(0.12500001F, 0.0F,0.10500001F, 0.9049993F, 0.8949993F, 0.88999933F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); if(tile.getInstalledUpgrades().contains(tile.RVALVE_UPGRADE)){ this.setBlockBounds(0.034999996F, 0.17499997F, 0.54999965F, 0.13500002F, 0.39999977F, 0.7949994F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } }else if(ro == 2){ this.setBlockBounds(0.105000004F, 0.0F, 0.13000001F, 0.88999933F, 0.8949993F, 0.9149993F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); if(tile.getInstalledUpgrades().contains(tile.RVALVE_UPGRADE)){ this.setBlockBounds(0.19999994F, 0.16499998F, 0.044999994F, 0.44999975F, 0.39999977F, 0.145000001F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } }else if(ro == 3){ this.setBlockBounds(0.085F, 0.0F, 0.10500001F, 0.87499934F, 0.8949993F, 0.8949993F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); if(tile.getInstalledUpgrades().contains(tile.RVALVE_UPGRADE)){ this.setBlockBounds(0.85499936F, 0.16499998F, 0.19999999F, 0.95499927F, 0.3949998F, 0.44999975F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } }else if(ro == 0){ this.setBlockBounds(0.11000001F, 0.0F, 0.095F, 0.88999933F, 0.8949993F, 0.87999934F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); if(tile.getInstalledUpgrades().contains(tile.RVALVE_UPGRADE)){ this.setBlockBounds(0.54999965F, 0.16499998F, 0.86499935F, 0.7999994F, 0.39999977F, 0.96499926F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } } this.setBlockBounds(0, 0, 0, 1, 1, 1); } public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 start, Vec3 end) { RussyPeripheral theTile = (RussyPeripheral)world.getBlockTileEntity(x, y, z); if (theTile == null) { return null; } List cuboids = new LinkedList(); theTile.addTraceableCuboids(cuboids); return RayTracer.instance().rayTraceCuboids(new Vector3(start), new Vector3(end), cuboids, new BlockCoord(x, y, z), this); } @SideOnly(Side.CLIENT) @ForgeSubscribe public void onBlockHighlight(DrawBlockHighlightEvent event) { if ((event.target.typeOfHit == EnumMovingObjectType.TILE) && (event.player.worldObj.getBlockTileEntity(event.target.blockX, event.target.blockY, event.target.blockZ) instanceof RussyPeripheral)) { RayTracer.retraceBlock(event.player.worldObj, event.player, event.target.blockX, event.target.blockY, event.target.blockZ); } } public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); } } ItemBlock public class RussyPeripheralAsItem extends ItemBlock{ public RussyPeripheralAsItem(int par1) { super(par1); this.setHasSubtypes(false); this.setUnlocalizedName(StatCollector.translateToLocal("rs.item.RussyP")); this.setFull3D(); } @Override public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { if(super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata)) { int rotation = MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 2.5D) & 3; world.setBlock(x, y, z, this.itemID, rotation, 2); RussyPeripheral tile = (RussyPeripheral) world.getBlockTileEntity(x, y, z); if(player instanceof EntityPlayer){ tile.Username = player.username; } if(stack.stackTagCompound != null){ tile.readFromNBT(stack.stackTagCompound); } player.setCurrentItemOrArmor(0, null); } return false; } @SideOnly(Side.CLIENT) @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean extended) { if(!StringHelper.isShiftKeyDown()){ list.add(StringHelper.shiftForInfo); }else{ if(stack.hasTagCompound()){ String Username = EnumChatFormatting.YELLOW+stack.stackTagCompound.getString("owner"); String eniquepass = EnumChatFormatting.YELLOW+stack.stackTagCompound.getString("pass"); boolean rightValveUpgrade = stack.stackTagCompound.getBoolean(RussyPeripheral.RVALVE_UPGRADE); list.add(EnumChatFormatting.AQUA+"Owner: "+Username); list.add(EnumChatFormatting.AQUA+"Eniquepass: "+eniquepass); list.add(EnumChatFormatting.AQUA+"Installed modules:"); if(rightValveUpgrade) list.add(EnumChatFormatting.RED+" - Right Valve"); } } } } But then I try to break my block, my itemBlock drops well, but its NBT is empty. (I check NBT ingame with NBTEditor) What am I doing wrong ?
  16. But what if i have 2 AABBs in one block space ?
  17. How can i check if the point the player is looking at intersacts or is inside the given AxisAlignedBB ?
  18. When i try to render custom bounding box of my block, it just doesn't render. What do i do incorrectly ? Here is my code Block: public class ChairBlock extends BlockContainer{ int renderType ; private EntityPlayer player; private int x,y,z; public ChairBlock(int par1, Material par2Material ) { super(par1, par2Material); } @Override public boolean renderAsNormalBlock() { return false; } public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("rs:Peripheral"); } public boolean hasTileEntity(){ return true; } public boolean isOpaqueCube(){ return false; } @Override public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return true; } @Override public int getRenderType() { return renderType; } public void setRenderType(int id){ this.renderType = id; } @Override public TileEntity createNewTileEntity(World world){ if(this.player != null){ RussyPeripheral tile = new RussyPeripheral(); tile.setUsername(player.username); MyTickHandler.loadedRussyTiles.add(tile); return tile; }else{ RussyPeripheral tile = new RussyPeripheral(); tile.setUsername("NONE"); MyTickHandler.loadedRussyTiles.add(tile); return tile; } } public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack){ int rotation = MathHelper.floor_double((double)((par5EntityLiving.rotationYaw * 4F) / 360F) + 2.5D) & 3; par1World.setBlock(par2, par3, par4, this.blockID, rotation, 2); this.player = (EntityPlayer) par5EntityLiving; } public boolean onBlockBroken(World world, int par2, int par3, int par4, EntityPlayer player, int par6, float par7, float par8, float par9) { return blockConstructorCalled; } public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { this.setBlockBounds(0, 0, 0, 1, 1, 1); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } Event Class: public class Events { public static float xMin,yMin,zMin,xMax,yMax,zMax = 0; private static boolean inited = false; //@SideOnly(Side.CLIENT) @ForgeSubscribe public void onDrawBlockHighlight(DrawBlockHighlightEvent e){ if(e.target.typeOfHit.equals(EnumMovingObjectType.TILE) && e.player.worldObj.getBlockTileEntity(e.target.blockX, e.target.blockY, e.target.blockZ) instanceof RussyPeripheral){ e.setCanceled(true); Vec3 hitV = e.target.hitVec; Float[] parts = EnderPeripheralModel.rightValve; Block block = e.player.worldObj.getBlockTileEntity(e.target.blockX, e.target.blockY, e.target.blockZ).blockType; TileEntity tile = e.player.worldObj.getBlockTileEntity(e.target.blockX, e.target.blockY, e.target.blockZ); if(!inited){ /*xMin = tile.xCoord+0.54000175F; yMin = tile.yCoord+0.5040015F; zMin = tile.zCoord+0.4710013F; xMax = tile.xCoord+0.64000175F; yMax = tile.yCoord+0.6040015F; zMax = tile.zCoord+0.5710013F;*/ xMin = tile.xCoord; yMin = tile.yCoord; zMin = tile.zCoord; xMax = tile.xCoord+1F; yMax = tile.yCoord+1F; zMax = tile.zCoord+1F; inited = true; } //this.drawOutlinedBoundingBox(xMin, yMin, zMin, xMax, yMax, zMax); this.drawOutlinedBoundingBox((float)tile.xCoord+(float)block.getBlockBoundsMinX(),(float)tile.yCoord+(float) block.getBlockBoundsMinY(),(float)tile.zCoord+(float) block.getBlockBoundsMinZ(),(float)tile.xCoord+(float) block.getBlockBoundsMaxX(),(float)tile.yCoord+(float) block.getBlockBoundsMaxY(),(float)tile.zCoord+(float) block.getBlockBoundsMaxZ()); //EnderPeripheralModel.drawOutlinedBoundingBox(rValve); //EnderPeripheralModel.drawOutlinedBoundingBox(main); //this.setBlockBounds(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5]); //super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); //float backX = 0.07500001043081284F; //this.setBlockBounds(0.1550000160932541F, 0.011000001803040504F, 0.10499998927116394F, 0.9349998831748962F, 0.8749999403953552F, 0.8849999904632568F); //e.context.drawSelectionBox(par1EntityPlayer, par2MovingObjectPosition, par3, par4); } } public static void drawOutlinedBoundingBox(float minX,float minY, float minZ, float maxX, float maxY, float maxZ) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 0.0F, 0.0F, 0.5F); GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(false); Tessellator tessellator = Tessellator.instance; tessellator.startDrawing(3); tessellator.addVertex(minX, minY, minZ); tessellator.addVertex(maxX, minY, minZ); tessellator.addVertex(maxX, minY, maxZ); tessellator.addVertex(minX, minY, maxZ); tessellator.addVertex(minX, minY, minZ); tessellator.draw(); tessellator.startDrawing(3); tessellator.addVertex(minX, maxY, minZ); tessellator.addVertex(maxX, maxY, minZ); tessellator.addVertex(maxX, maxY, maxZ); tessellator.addVertex(minX, maxY,maxZ); tessellator.addVertex(minX, maxY, minZ); tessellator.draw(); tessellator.startDrawing(1); tessellator.addVertex(minX, minY, minZ); tessellator.addVertex(minX, maxY, minZ); tessellator.addVertex(maxX, minY, minZ); tessellator.addVertex(maxX,maxY, minZ); tessellator.addVertex(maxX, minY, maxZ); tessellator.addVertex(maxX, maxY, maxZ); tessellator.addVertex(minX, minY, maxZ); tessellator.addVertex(minX, maxY, maxZ); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); } @ForgeSubscribe public void onDrawBlockHighlight1(RenderWorldLastEvent e){ } }
  19. Sure thing! What you need to do is to trace a ray from the player, in the direction he's aiming and see where it hits. Based on where it hits the block, you do your logic. It's basically just ray tracing, and that's whats used in the mod you mentioned in the OP. So you should probably read up on ray tracing and learn how to create your own ray tracer and use that to deal with the sub hits No one could say better... Thank you Mazetar !
  20. Can just someone help without refering to someones source !
  21. I can't figure out where that is done in the code. Maybe something like addCollisionBoxesToList, getCollisionBoundingBoxFromPool or collisionRayTrace in the Block.class . I can't see him adding/setting/editing block bounds, collision stuff. He somehow gets subhit equaled 4 or that kind of int . I just ****ing cant understand !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  22. If you look at, for example, codechickens Ender Storage, the ender tank and the chest have subCollisionBoxes. If you look at the valve of the tank you can see that it has its own collision box, so is done for the 3 dyeable buttons too. I heard something about MOP subHits, is that related and how to do that ?
×
×
  • Create New...

Important Information

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