Jump to content

Acrogenous

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Acrogenous

  1. so I created a "makeBook" method that adds a written book with information in it to a players inventory; public static void makeBook(EntityPlayer player, String title, String author,String... pages) { NBTTagList pagesTag = new NBTTagList(); NBTTagCompound compound = new NBTTagCompound(); compound.setString("author",author); compound.setString("title",title); for(int i = 0; i < pages.length; ) { pagesTag.appendTag(new NBTTagString(pages[i])); i++; } compound.setTag("pages",pagesTag); ItemStack book = new ItemStack(Items.WRITTEN_BOOK); book.setTagCompound(compound); player.addItemStackToInventory(book); } and then I pass this line of code in another class: makeBook(player,"title","author","CHAPTER 1 In this world, all around us there is a force"); and no matter if I add \n or any other thing like that the book always looks like this (the title and author work however) any ideas how I make it A; display all the text and B; format it thanks in advance ~Acro
  2. thank you @Choonster it wasn't being activated, and fair point @jabelar it was not printing anything, that's what I meant to say, I probably didn't word it correctly thank you all that helped!
  3. Nope, didn't work, I didn't think it had anything to do with the itemstack (otherwise the latter statement wouldn't work either) public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState p_onBlockActivated_3_, EntityPlayer player, EnumHand hand, EnumFacing p_onBlockActivated_6_, float p_onBlockActivated_7_, float p_onBlockActivated_8_, float p_onBlockActivated_9_) { if(player.getHeldItem(hand) != ItemStack.EMPTY) { ItemStack stack = player.getHeldItem(hand); if (stack.hasTagCompound() && stack.getItem() == ModItems.logiCard && player.isSneaking() ) { NBTTagCompound card = stack.getTagCompound(); card.setInteger("xpos", blockpos.getX()); card.setInteger("ypos", blockpos.getY()); card.setInteger("zpos", blockpos.getZ()); } if (stack.hasTagCompound() && stack.getItem() == ModItems.logiCard && !player.isSneaking()) { direction(stack, player, world, blockpos); } } return super.onBlockActivated(world, blockpos, p_onBlockActivated_3_,player,hand, p_onBlockActivated_6_, p_onBlockActivated_7_, p_onBlockActivated_8_, p_onBlockActivated_9_); }
  4. I tried that, from that I gauged that it was the actual ifSneaking() statment that wasn't working
  5. so are we reckoning isSneaking() isn't working because I haven't checked if the ItemStack is null?
  6. I have legitimately simplified this code as much as possible to see if this was a parenthesis error, but to no avail @Override public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState p_onBlockActivated_3_, EntityPlayer player, EnumHand hand, EnumFacing p_onBlockActivated_6_, float p_onBlockActivated_7_, float p_onBlockActivated_8_, float p_onBlockActivated_9_) { ItemStack stack = player.getHeldItem(hand); if (stack.hasTagCompound() && stack.getItem() == ModItems.logiCard && player.isSneaking()) { NBTTagCompound card = stack.getTagCompound(); card.setInteger("xpos", blockpos.getX()); card.setInteger("ypos", blockpos.getY()); card.setInteger("zpos", blockpos.getZ()); } if (stack.hasTagCompound() && stack.getItem() == ModItems.logiCard && !player.isSneaking()) { direction(stack, player, world, blockpos); } return super.onBlockActivated(world, blockpos, p_onBlockActivated_3_,player,hand, p_onBlockActivated_6_, p_onBlockActivated_7_, p_onBlockActivated_8_, p_onBlockActivated_9_); } it is fine with detecting if the player is not sneaking, but it does absolutely nothing when the player is sneaking (there is already a compound tag on the item i am using, this was created originally but the code is greatly simplified, as said above) . A further point is when I invert the statements still only the !isSneaking works. thanks in advance ~Acro
  7. Ah, I thought that only applied to TextComponent! Thank you all!
  8. this isn't the lang file this is Lore.add(1,"§2Bound Entropy: "+String.valueOf(a.getTagCompound().getInteger("entropy"))); how would you suggest to go about using string interpolation to achieve the same result? (I am not particularly familiar with interpolation)
  9. On the lore of one of my Items there is this string: but in minecraft it is displayed with what I believe is an Å at the start of it: any idea to how I remove this rogue character but keep the formatting? Thanks in advanced
  10. So Im making a tas ticksaver for minecraft speedrunning. its meant to "record" the players position every tick and play back at the same speed but for some reason, on timing it, it appears to play back twice as fast? public void onUpdate(ItemStack p_onUpdate_1_, World world, Entity player, int p_onUpdate_4_, boolean p_onUpdate_5_) { i++; if(this.startRec) { loc.add(player.getPosition()); pitch.add(player.rotationPitch); yaw.add(player.rotationYaw); } if(this.startPlay) { if(i <= loc.size()) { player.setNoGravity(true); System.out.println(i); //player.setPositionAndRotation(loc.get(i-1).getX(),loc.get(i-1).getY(),loc.get(i-1).getZ(),yaw.get(i-1),pitch.get(i-1)); player.moveToBlockPosAndAngles(loc.get(i-1),yaw.get(i-1),pitch.get(i-1)); player.setPositionAndUpdate(player.posX,player.posY,player.posZ); //this is to make textures load } else { this.startPlay = false; player.setNoGravity(false); } } super.onUpdate(p_onUpdate_1_, world, player, p_onUpdate_4_, p_onUpdate_5_); } thanks in advanced
  11. So, Thaumcraft stops being maintained for perfectly acceptable reasons and then, a previous addon becomes standalone and takes the reigns! much like my previous addon Greater Druidry this is the first addon for this specific mod. This was a test mainly to see if I could work on the LT api and see if I could add some of the Thaumic Tinkerer stuff we all knew and loved, albeit in a slightly different fashion (I'm no Vazkii xD) so far we have: Ichor, Ichorium and Ichorcloth your favorite OTT end game items Ichorium Pickaxe you can mine normally, really fast, or if you right click (or shift-right click to reverse) you can modify its AOE effect and then if you shift-left click you can mine in an area, really fast. To reduce the tears from server owners when 1331 block's become entities (yes, the maximum is 11x11x11) it only mines stone (all variants) and gives you the equivalent amount of cobblestone, so no more rogue stacks of granite for you. RESULT! Ichorium Sword WIP but still Owch Ethereal Ladder Block (from Ethereal Platform) very simply, you right click it, your now on top of it. Black Hole Charm (from Black Hole Talisman (I Think)) when it is on (It has the enchantment effect activated by right click deactivated by shift-right click) it absorbs all entities within a 15 block radius. As an added bonus it converts every stack of cobblestone in your inventory into an Ultra Dense Gem, which can be simply uncrafted) Ichorcloth Strapped Ichorium Capped Silverwood Wand (and all the components) It's an OP wand. Sceptres (Freezing, Dislocation and Uprising) Wand Foci did not exist in thaumcraft 2. here's my equivilant. Sceptres. they all have 200 durability Freezing: Everything that doesn't jump, doesn't move. (in a radius) Dislocation: you were here, now your there. Uprising: ZOOOM! (like sword of the Zephyr, but spamable) XP Charm (from XP Talisman) It stores XP. Go figure Ichorcloth Armour It's OP. Boots work like the Uprising Sceptre but infinitely. leggings make you run fast, chest allows you to fly and helmet gives you night vision and saturation. More stuff will be added as more stuff is added to Lost Thaumaturgy and like Pengu, I plan on adding more unusual stuff myself Unless it is in fact to do with Lost Thaumaturgy don't complain to Pengu. These mods are very separate entities. (and same vice versa) Suggestions in the comments, Complaints to Github. Feedback is much appreciated It would also be very appreciated if someone could make me a better logo, thanks. Also please could some people submit translations on github? DOWNLOAD LINK you could also subscribe to my youtube. I explain my mods when I get the chance and do awesome speedruns
  12. thank you Draco18s; I know for loops are a thing, but don't both my method and your method have roughly the same amount of characters? I can see it is neater however so I will try and use this in the future. I wasn't aware of negative variables (Java isn't my main language but it probably exists in other languages I've just never known) this is my problem, thanks I didn't know this, it would make the code neater. My code isn't generally neat, (which are effectively points 1 and 3 here) and I will try and work on this aspect, so thanks for the advice!
  13. public boolean onBlockDestroyed(ItemStack p_onBlockDestroyed_1_, World world, IBlockState blockstate, BlockPos block, EntityLivingBase player) { if(player.isSneaking()) { int x = 0-aoe; int y = 0-aoe; int z = 0-aoe; while(z != aoe) { while(y != aoe) { while(x != aoe) { if(world.getBlockState(new BlockPos(x,y,z)).getBlock()== Blocks.STONE) { world.destroyBlock(new BlockPos(block.getX() +x, block.getY() +y, block.getZ() +z), true); } x++; } x= 0-aoe; y++; } y= 0-aoe; z++; } } return super.onBlockDestroyed(p_onBlockDestroyed_1_, world, blockstate, block, player); } so when you shift mine something it is suppose to mine all blocks around it in "aoe" radius, there are 2 problems however; 1 it still mines things that aren't stone and 2 it doesn't mine all the stone, thanks in advanced.
  14. I used number ID just in case that was breaking it, if you could please can you post an example of how I would go about using this? I get "method references are not supported at language levels 1.6" if that helps
  15. @Override public boolean onBlockActivated(World world, BlockPos coords, IBlockState p_onBlockActivated_3_, EntityPlayer player, EnumHand handcontents, EnumFacing p_onBlockActivated_6_, float p_onBlockActivated_7_, float p_onBlockActivated_8_, float p_onBlockActivated_9_) { if(isIgnitable) { ItemStack fs = new ItemStack(Item.getItemById(259)); if(player.getHeldItemMainhand() == fs) { System.out.println("it got this far"); doExplode(coords,world); } System.out.println(player.getHeldItemMainhand()); System.out.println(fs); } return super.onBlockActivated(world, coords, p_onBlockActivated_3_, player, handcontents, p_onBlockActivated_6_, p_onBlockActivated_7_, p_onBlockActivated_8_, p_onBlockActivated_9_); } this does not work, when the block is right clicked with flint and steel (259) it should doExplode. the console does not display "it got this far" either
  16. I have since deleted the class as I found an alternative way to get to a solution. I may re-implement this entity at a later date and if I get the same problem I shall post the code and stacktrace here
  17. Thank you very much!. I was trying to follow the old guides that had AxisAllignedBB.getBoundingBox which doesnt work. edit: the potion effect function is only applicable to players?
  18. as far as I can tell that doesn't work anymore, at least the way I do it. can you please give an example?
  19. I would like to get all the entities in a radius around a block so that I can apply a potion effect to all of them. how would I go about doing this?
  20. if I want the entity to have those variables passed on to it when it is created, how would I go about doing that? I seem to be getting a problem with a ticking entity. saying there is a nullPointer on the "createExplosion" line. why is this? the problem in fact seems to lie in the entity not existing past 1 tick...
  21. Ah! that makes sense. I did do that before (I was following some code form DefenseTech) but didn't think it was necessary, thank you very much!
  22. I have created an entity, an explosive to be precise, but the function onLivingUpdate does not appear to be firing at all. I have a println on the initiating of the class saying it has worked and then 2 more print lines in the onLivingUpdate section, these dont seem to be firing however, what am I doing wrong? public class EntityExplosive extends EntityPig { int fuse; EntityPlayer player; BlockPos coords; float explosion; World world; public EntityExplosive(World getworld, BlockPos getcoords, EntityPlayer getplayer, float getexplosion, int getfuse) { super(getworld); System.out.println("it worked"); this.fuse = getfuse; this.player = getplayer; this.coords = getcoords; this.explosion = getexplosion; this.world = getworld; } @Override public void onLivingUpdate() { System.out.println(this.fuse); if(this.fuse != 0) { this.fuse --; System.out.println("counting down"); } if(this.fuse < 1) { this.world.createExplosion(this.player,this.coords.getX(),this.coords.getY(),this.coords.getZ(),this.explosion,true); this.setDead(); return; } super.onLivingUpdate(); } } It extends EntityPig so I didn't have to construct the rest of the class. the variables passed on creation of the EntityExplosive are: the world, the blockpos, the player, 10 and 100. thank you in advance.
×
×
  • Create New...

Important Information

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