Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Adil Yilan

  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

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

Adil Yilan's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. Ah ok, so it is related to client optimization if I understand correctly? Client will remove the entity from memory if it is outside of the tracking range?
  2. Hi, I have created several entities that work properly but there are few things that I am not sure I understand correctly when it comes to EntityType.Builder. One of those things is how to set clientTrackingRange to adequate value. I have checked Forge documentation, various tutorials, looked for usage in Minecraft source code, but can't really find anything that would give me 100% sure explanation on how to set value properly. Fox, Cat, Bee have it set to 8, but Cow, Sheep, Wolf and Pig have it set to 10... Is it because they can be tamed and follow the player? Why is Zombie set to 10 but Skeleton to 8? I would really like to get proper understanding of this parameter, so any hints are really welcomed, including articles that I can read on my own. Thanks!
  3. @MFMods thank you for so many hints I will dig into the methods that you have mentioned and experiment a bit. Hopefully I will not end up bald. I am still new to a lot of concepts in Forge/Minecraft, but it's still fun and challenging to make stuff on your own. After all, it is one fine working TV as you can see.
  4. I have a TV block that is 48 wide and 16 high. As you can see on the video above, I have an issue where player can put any other block on extra space of TV and I can't figure out how to stop that from happening. SHAPE is defined like this: private static final VoxelShape SHAPE = Block.box(-16.0D, 0.0D, 0.0D, 32.0D, 16.0D, 16.0D); I have overridden all possible methods to return this shape but issue is still there: @Override public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { return SHAPE; } @Override public VoxelShape getOcclusionShape(BlockState pState, BlockGetter pLevel, BlockPos pPos) { return SHAPE; } @Override public VoxelShape getBlockSupportShape(BlockState pState, BlockGetter pReader, BlockPos pPos) { return SHAPE; } @Override public VoxelShape getInteractionShape(BlockState pState, BlockGetter pLevel, BlockPos pPos) { return SHAPE; } @Override public VoxelShape getCollisionShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { return SHAPE; } @Override public VoxelShape getVisualShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { return SHAPE; } Any hints/ideas on how to fix this? Thanks!
  5. @DePhoegon To create an instance of BlockTagsProvider, I would have to pass in DataGenerator. I need to get list of all blocks in runtime, not when data is generating. Apart from seeing the map of tags and blocks, I don't see how could I use that while the mod is running.
  6. I am still not able to find a replacement method for .getValues(). Does anyone know how to get all blocks with specific tag? @DePhoegon I have inspected BlockTagsProvider and ItemTagsProvider but I am not familiar with how to use those. Aren't these supposed to be used with data generators?
  7. .is(..) method is still there where it used to be. Issue was with version of parchment mappings that I was using so method was obfuscated to something else. I have updated to use latest parchment version (from yesterday) and that problem is now gone: 1.18.1-2022.03.06-1.18.2
  8. @DePhoegon I am not sure what exactly are you trying to point out. Methods above were valid in Forge for 1.18.1. Since update to 1.18.2 methods have stopped to exist so there are probably replacement methods that I am trying to find. .is(..) method on BlockState existed before in 1.18.1 .
  9. Not sure how that issue is related to these changes? Is there any way to find replacement methods for .is(...) and .getValues() ?
  10. Hello, Seems that there have been some breaking changes with 1.18.2 regarding the tags. Following code no longer works: public static final Tags.IOptionalNamedTag<Block> MACHINES = BlockTags.createOptional(new ResourceLocation(ExperimentalMod.MODID, "machines")); However, I have managed to change the code to: public static final TagKey<Block> MACHINES = BlockTags.create(new ResourceLocation(ExperimentalMod.MODID, "machines")); Is this valid migration path? There are two additional lines of code that do not work any longer: List<Block> flowers = BlockTags.SMALL_FLOWERS.getValues(); Method .getValues() no longer exists. Is there another way to get all blocks that have specific tag? Same is with .is(...) method: if (!blockState.is(BlockTags.LOGS)) { return; } Is there a different approach now to check if BlockState is tagged with specific tag? Thanks!
  11. I have implemented RpgLauncherItem that launches RpgEntity. This is how it works at the moment: https://vimeo.com/user167486120/review/680142871/22206a0362 I have modeled RPG and RPG launcher in BlockBench and imported them as JSON assets in mod. RpgEntity is using GeckoLib for animation, although there is none at the moment. There are 4 issues on the video above: a) RPG is launched from the feet instead from the eye point - what would be the proper way to set shooting point? b) When launcher is used, it looks as if it is trying to hit the ground - can this animation be disabled? c) Sometimes, RPG goes in totally different direction than the crosshair is targeting - is this related to client/server communication and can that be improved? d) As you can see in the video, RPG is spinning while moving - I have no clue why - haven't added that as an animation any way to prevent this from happening? This is RpgEntity code: public class RpgEntity extends AbstractHurtingProjectile implements IAnimatable { // GeckoLib private final AnimationFactory factory = new AnimationFactory(this); public RpgEntity(EntityType<RpgEntity> entityType, Level level) { super(entityType, level); } public RpgEntity(EntityType<RpgEntity> entityType, LivingEntity player, Level level) { super(entityType, player, player.getViewVector(100).x(), player.getViewVector(100).y(), player.getViewVector(100).z(), level); } public static EntityType<RpgEntity> createType() { Builder<RpgEntity> builder = Builder.of((EntityType.EntityFactory<RpgEntity>)RpgEntity::new, MobCategory.MISC); builder.sized(0.5F, 0.5F); builder.clientTrackingRange(4); builder.updateInterval(20); EntityType<RpgEntity> entityType = builder.build("rpg"); return entityType; } @Override protected void onHitEntity(EntityHitResult pResult) { super.onHitEntity(pResult); this.level.explode(this, this.getX(), this.getY(), this.getZ(), 5.0f, false, BlockInteraction.BREAK); this.discard(); } @Override protected void onHitBlock(BlockHitResult pResult) { super.onHitBlock(pResult); this.level.explode(this, this.getX(), this.getY(), this.getZ(), 5.0f, false, BlockInteraction.BREAK); this.discard(); } @Override public Packet<?> getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } @Override public void registerControllers(AnimationData data) { data.addAnimationController(new AnimationController<RpgEntity>(this, "controller", 0, this::predicate)); } // GeckoLib @Override public AnimationFactory getFactory() { return this.factory; } // GeckoLib private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) { return PlayState.CONTINUE; } } This is RpgLauncherItem code: public class RpgLauncherItem extends Item { public RpgLauncherItem() { super(createProperties()); } private static Properties createProperties() { Properties properties = new Properties(); properties.tab(CreativeModeTab.TAB_COMBAT); properties.stacksTo(1); return properties; } @Override public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pUsedHand) { ItemStack item = pPlayer.getItemInHand(pUsedHand); if (pLevel.isClientSide()) { return InteractionResultHolder.sidedSuccess(item, true); } RpgEntity rpg = new RpgEntity(ProjectileEntities.RPG.get(), pPlayer, pLevel); pPlayer.level.addFreshEntity(rpg); return InteractionResultHolder.sidedSuccess(item, true); } } Any suggestions on how issues above could be resolved would be really appreciated. I am new to all this and getting rocket to fire properly was already a challenge.
  12. Alright, that's enough information, I will dive into it. Thank you so much!
  13. I need data outside of the running Minecraft instance. If I go with WorldSavedData - where will the data be located physically - as in which files/folders on disk drive?
  14. Because I am new to modding and I have no clue what WorldSavedData or Capability is - basically. So I have this block named PinpointerBlock that should be placed on three locations. When the block is activated on the blue position, it should read information about everything between and save it to JSON. That's the whole idea.
  15. I am trying to extract information about the specific structure into a JSON file that will be used as a template to reconstruct the structure through custom made block. When custom block is placed in the world, it will read information from JSON file and place blocks in the same exact order so that structure is reproduced. That's the idea. This is not going to be part of any publicly distributed mod. It's more of developer tool to export structures in a fast way.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.