Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. I don't know if this is intentional but in your SkillStorage, method writeNBT you kept rewrite/override the value of "xp", "static", and "dynamic". I guess what you are trying to do here is something like: for(int i = 0; i < 26; i++) { data.putInt("xp" + i, (int) instance.getXp(i) * 10); data.putInt("static" + i, instance.getStaticLevel(i)); data.putInt("dynamic" + i, instance.getLevel(i)); } so does writeNBT(), you assign the same value to every slot or whatever it is.
  2. Probably at AbstractArrowEntity L392 where it multiplies its motion by a negative number?
  3. I think what you mean is not Minecraft refuses to run, instead, the code compilation has failed. The second constructor of StairsBlock has a Supplier<BlockState> as its first parameter, but you are passing an instance of Block in it. You can check vanilla for examples.
  4. I don't think so, ResourceLocation will split the string into two piece, modid and the location. And if the modid does not exist (where there's ':' or not, and if it's empty in front of ':') it will assign minecraft modid to it.
  5. If I understand it correctly getUpdateTag provides the information that needs to be synced (check its doc), and getUpdatePacket provides the packet that going to be send to the client, I think it's fine to put any number for the tileEntityTypeIn (the second parameter of SUpdateTileEntityPacket), since it's hardcoded to check if the tileentity and the number matches. And then onDataPacket is called when the client has received the packet, it provides the data send from the server which you gather the information you need for client from it.
  6. Block.onBlockActivate: if world.isRemote: do nothing else: revert DynamiteTileEntity.active DynamiteTileEntity.tick: if world.isRemote & active: spawn particles DynamiteTileEntity.active on client side is always false as it's never updated. Although it can be caused by something else but I can't access your full code so this is just my guess. You need to find a way to sync the value, using some default syncing methods in TileEntity/IForgeTileEntity e.g. getUpdatePacket and onDataPacket. There are also quite a lot of posts about this, you should have a look at them.
  7. Please post the whole log.
  8. Do you mean Item Entities? If so you can set isImmuneToFire() in your item/block item item properties.
  9. You’ve found out already didn't you?
  10. Sorry I did not read your question properly, I don't know why getBiome returns null, sorry.
  11. The world can be null.
  12. If you check WorkbenchContainer#canInteractWith you will see it hardcoded that the block must be Blocks.CRAFTING_TABLE in order for the player to interact with the container.
  13. It seems like you've never assign a value to test_entity.
  14. I've simplified my problem into a smaller area: https://bitbucket.org/poopoodice/ava/src/1.16.x/src/main/java/poopoodice/ava/items/miscs/TestItem.java @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity player, Hand handIn) { if (worldIn.isRemote()) player.world.playSound(player, 0, 1, 0, AVASounds.GENERIC_GRENADE_EXPLODE, SoundCategory.PLAYERS, 1.0F, 1.0F); if (!worldIn.isRemote()) player.world.playSound(null, 0, 0, 0, AVASounds.GENERIC_GRENADE_EXPLODE, SoundCategory.PLAYERS, 1.0F, 1.0F); worldIn.playSound(player, 0, 0, 0, AVASounds.GENERIC_GRENADE_EXPLODE, SoundCategory.PLAYERS, 1.0F, 1.0F); return super.onItemRightClick(worldIn, player, handIn); } My test result: 1. The first World#playSound -> result in the attenuation distance is applied (can be heard from 16+ blocks away) 2. The second World#playSound -> result in the attenuation distance is not applied (cannot be heard from 16+ blocks away) 3. The third World#playSound -> result in the attenuation distance is applied It seems like playing sound on server world will only send to the players that are within the radius of max(16.0F, volume * 16.0F), and for other vanilla sounds that uses greater attenuation distance for example ravager's roar, it is played on both sides which will work. If I can only play the sound on server while the attenuation effect to be applied, the only way I can think of is send packets to all players, is that necessary or is there an alternative way of doing it? Edit: Sending Customs packets works.
  15. Hello, after spending lots of time investigating why attenuation distance does not work, I figured out that it only works when the sound is played on client. Is this intentional?
  16. Don't use capital letters, and you misspelled textures to texutres, the console should tell you what files are expected but not found.
  17. Check how the torches and blocks like that manages to break according to the neighborhood changes (updatePostPlacement).
  18. Also you should be doing in on client only - client setup not common setup.
  19. They are located inside TickEvent. https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html
  20. TickEvent has multiple sub events, in this case you should use WorldTickEvent which provides the world instance.
  21. RegistryObject is an extension of java.util.function.Supplier
  22. You can change item model through ItemPropertyOverrides https://mcforge.readthedocs.io/en/latest/models/overrides/, like bows...etc.
  23. You also need to override isCrossbow in your item class.
  24. The text being displayed and its action are separated therefore you can just create a new style with click event (Style#setClickEvent), and then use TextComponent#setStyle to assign the style to the text.
×
×
  • Create New...

Important Information

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