Jump to content

vassdeniss

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by vassdeniss

  1. Fixed it. Just looked at how vanilla does it in the Features class and implemented it in my own generation class
  2. Still no. Jesus i have no idea heres my registry line public static final RegistryObject<Block> MINT_BUSH_BLOCK = BLOCKS.register("mint_bush_block", MintBush::new); and the mint bush class itself public class MintBush extends SweetBerryBushBlock { public MintBush() { super(Block.Properties.create(Material.PLANTS) .hardnessAndResistance(0, 0) .doesNotBlockMovement() .tickRandomly() .sound(SoundType.PLANT) ); } @Override public ItemStack getItem(IBlockReader worldIn, BlockPos pos, BlockState state) { return new ItemStack(RegistryHandler.MINT.get()); } @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { int i = state.get(AGE); boolean flag = i == 3; if (!flag && player.getHeldItem(handIn).getItem() == Items.BONE_MEAL) { return ActionResultType.PASS; } else if (i > 1) { int j = 1 + worldIn.rand.nextInt(2); spawnAsEntity(worldIn, pos, new ItemStack(RegistryHandler.MINT.get(), j + (flag ? 1 : 0))); worldIn.playSound((PlayerEntity) null, pos, SoundEvents.ITEM_SWEET_BERRIES_PICK_FROM_BUSH, SoundCategory.BLOCKS, 1, 0.8f + worldIn.rand.nextFloat() * 0.4f ); worldIn.setBlockState(pos, state.with(AGE, 1), 2); return ActionResultType.SUCCESS; } else { return super.onBlockActivated(state, worldIn, pos, player, handIn, hit); } } @Override public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn) { super.onEntityCollision(state, worldIn, pos, entityIn); } } maybe its something there but I doubt it
  3. @Mod.EventBusSubscriber public class DecorationGeneration { public static ConfiguredFeature<?, ?> MINT; public static void registerBushes() { MINT = register("mint", Feature.RANDOM_PATCH.withConfiguration( new BlockClusterFeatureConfig.Builder( new SimpleBlockStateProvider( RegistryHandler.MINT_BUSH_BLOCK.get().getDefaultState().with(MintBush.AGE, 3)), SimpleBlockPlacer.PLACER) .tries(64).func_227317_b_() .whitelist(Sets.newHashSet(Blocks.GRASS_BLOCK)).build()) .withPlacement(Features.Placements.PATCH_PLACEMENT).chance(80) ); } @SubscribeEvent(priority = EventPriority.HIGHEST) public static void gen(BiomeLoadingEvent event) { if (MINT != null) { event.getGeneration().withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, MINT); } } private static <FC extends IFeatureConfig> ConfiguredFeature<FC, ?> register(String name, ConfiguredFeature<FC, ?> configuredFeature) { return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("makoru", name), configuredFeature); } } DecoGeneration private void setup(final FMLCommonSetupEvent event) { OreGeneration.registerOres(); DecorationGeneration.registerBushes(); DeferredWorkQueue.runLater(() -> { GlobalEntityTypeAttributes.put(RegistryHandler.NIMBAT.get(), NimbatEntity.setCustomAttributes().create()); }); } Main Class
  4. MINT = register("mint", Feature.RANDOM_PATCH.withConfiguration( new BlockClusterFeatureConfig.Builder( new SimpleBlockStateProvider( RegistryHandler.MINT_BUSH_BLOCK.get().getDefaultState().with(MintBush.AGE, 3)), SimpleBlockPlacer.PLACER) .tries(64).func_227317_b_() .whitelist(Sets.newHashSet(Blocks.GRASS_BLOCK)).build()) .withPlacement(Features.Placements.PATCH_PLACEMENT).chance(80) ); Still not seeing it Everything seems correct i don't get it
  5. Youve been of amazing help! Ill try to see if it generates now. I believe i shall also update my mappings
  6. Specifically noProjection and HEIGHTMAP_DOUBLE_SQUARE
  7. Im missing some of the code youre using. Im using MCP i think it uses different functions?
  8. private void setup(final FMLCommonSetupEvent event) { DecorationGeneration.registerBushes(); } @Mod.EventBusSubscriber public class DecorationGeneration { private static final ArrayList<ConfiguredFeature<?, ?>> overworldDeco = new ArrayList<ConfiguredFeature<?, ?>>(); public static void registerBushes() { overworldDeco.add(register("mint", Feature.RANDOM_PATCH.withConfiguration(new BlockClusterFeatureConfig .Builder(new SimpleBlockStateProvider(RegistryHandler.MINT_BUSH_BLOCK.get().getDefaultState().with(MintBush.AGE, 3)), SimpleBlockPlacer.PLACER).tries(64).whitelist(ImmutableSet.of(Blocks.GRASS_BLOCK.getBlock())) .func_227317_b_().build() )).withPlacement(Features.Placements.PATCH_PLACEMENT).chance(24)); } @SubscribeEvent(priority = EventPriority.HIGHEST) public static void gen(BiomeLoadingEvent event) { BiomeGenerationSettingsBuilder generation = event.getGeneration(); for (ConfiguredFeature<?, ?> bush : overworldDeco){ if (bush != null) generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, bush); } } private static <FC extends IFeatureConfig> ConfiguredFeature<FC, ?> register(String name, ConfiguredFeature<FC, ?> configuredFeature) { return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, MakoRuMod.MOD_ID + ":" + name, configuredFeature); } } I did something like this. I believe im getting closer but still it doesn't work?
  9. Am i doing something wrong? @Mod.EventBusSubscriber public class DecorationGeneration { @SubscribeEvent(priority = EventPriority.HIGHEST) public static void generateBushes(BiomeLoadingEvent event) { BiomeGenerationSettingsBuilder generation = event.getGeneration(); BlockClusterFeatureConfig MINT_BUSH_CONFIG = (new BlockClusterFeatureConfig.Builder( new SimpleBlockStateProvider( RegistryHandler.MINT_BUSH_BLOCK.get().getDefaultState().with(MintBush.AGE, 3) ), SimpleBlockPlacer.PLACER ) ).tries(64).whitelist(ImmutableSet.of( Blocks.GRASS_BLOCK.getDefaultState().getBlock() )).func_227317_b_().build(); ConfiguredFeature<?, ?> MINT_BUSH = Feature.RANDOM_PATCH.withConfiguration(MINT_BUSH_CONFIG); ConfiguredFeature<?, ?> MINT_BUSH_DECORATED = MINT_BUSH.withPlacement(Features.Placements.PATCH_PLACEMENT).chance(24); if (event.getCategory().equals(Biome.Category.PLAINS)) { generation.withFeature( GenerationStage.Decoration.VEGETAL_DECORATION, MINT_BUSH_DECORATED ); } } }
  10. Do i override the updateAiTasks or still stay on the leasedstate? Also i suppose i have to add an if statement checking if the bat is leased in the else? else { if (this.spawnPosition != null && (!this.world.isAirBlock(this.spawnPosition) || this.spawnPosition.getY() < 1)) { this.spawnPosition = null; } if (this.spawnPosition == null || this.rand.nextInt(30) == 0 || this.spawnPosition.withinDistance(this.getPositionVec(), 2.0D)) { this.spawnPosition = new BlockPos(this.getPosX() + (double)this.rand.nextInt(7) - (double)this.rand.nextInt(7), this.getPosY() + (double)this.rand.nextInt(6) - 2.0D, this.getPosZ() + (double)this.rand.nextInt(7) - (double)this.rand.nextInt(7)); } double d2 = (double)this.spawnPosition.getX() + 0.5D - this.getPosX(); double d0 = (double)this.spawnPosition.getY() + 0.1D - this.getPosY(); double d1 = (double)this.spawnPosition.getZ() + 0.5D - this.getPosZ(); Vector3d vector3d = this.getMotion(); Vector3d vector3d1 = vector3d.add((Math.signum(d2) * 0.5D - vector3d.x) * (double)0.1F, (Math.signum(d0) * (double)0.7F - vector3d.y) * (double)0.1F, (Math.signum(d1) * 0.5D - vector3d.z) * (double)0.1F); this.setMotion(vector3d1); float f = (float)(MathHelper.atan2(vector3d1.z, vector3d1.x) * (double)(180F / (float)Math.PI)) - 90.0F; float f1 = MathHelper.wrapDegrees(f - this.rotationYaw); this.moveForward = 0.5F; this.rotationYaw += f1; if (this.rand.nextInt(100) == 0 && this.world.getBlockState(blockpos1).isNormalCube(this.world, blockpos1)) { this.setIsBatHanging(true); } } Here i mean. But also how do I take the lead position in the world?
  11. Ill try and ask if anything goes wrong thank you!
  12. public class NimbatEntity extends BatEntity { public NimbatEntity(EntityType<? extends BatEntity> type, World worldIn) { super(type, worldIn); } public static AttributeModifierMap.MutableAttribute setCustomAttributes() { return MobEntity.func_233666_p_() .createMutableAttribute(Attributes.MAX_HEALTH, 1.0f); } @Override public boolean canBeLeashedTo(PlayerEntity player) { return true; } @Override public boolean canDespawn(double distanceToClosestPlayer) { return false; } }
  13. The bool canBeLeasedTo works to put it on but the entity doesnt get pulled back by the lead. Please help
  14. It is updateAiTasks and i just overridden it and yes i do wanna keep the AI so i kept the super call but the TemptGoal still gives errors? Im missing something?
  15. Thats the problem then. BatEntity extends AmbientEntity
  16. Just fixed it. It was my extension. I was extending bat entity which cant have a temptgoal for some reason?
×
×
  • Create New...

Important Information

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