samjviana
Members-
Posts
82 -
Joined
-
Last visited
-
Days Won
1
Everything posted by samjviana
-
The error is because forge is looking for kinda server version of the mods. I don't mind helping XD, if u want to send me the all the mods you are using I can try to make it work and reply here.
-
now the problem is on "curios" mod LOL, are you trying to run this mods on an server world?
-
send the new log, without extradisks
-
oh ... actually, i looked better at the log, and there are two mods that as causing errors one is "rats" and the other is "extradisks", i think that the crash is due to "extradisks" and not "rats" Apparently "extradisks" is missing it's .toml file that is essencial to load the mod. can you send me where you download that mod? taking that you didn'd made it too
-
this mod "rats" is it yours?
-
The error is happening when it tries to load the Loot Table of rats:christmas_rat_gifts, can you show the code behing this loot table?
-
[1.16.5] How to make EnchantedBook go to Custom ItemGroup
samjviana replied to samjviana's topic in Modder Support
That's what i tried: "enchantment.bunchofthings.grass_walker": "Grass Walker", "enchantment.grass_walker": "Grass Walker", "bunchofthings.grass_walker": "Grass Walker", But when in an enchantment item GUI it shows "grass_walker I", "grass_walker II" and so on. -
Error at load_registries event phase
samjviana replied to ThisIsNotOriginal's topic in Modder Support
Take a look ate this section of the Docs https://mcforge.readthedocs.io/en/latest/concepts/registries/ In advance, an exemple of DeferredRegister would be something like this: DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID); RegistryObject<Block> COPPER_ORE = BLOCKS.register("copper_ore", () -> new OreBlock(...)); And when you need to access the entries (blocks) you would get them throught the BLOCKS DeferredRegister or if you need only one specific entry you would use COPPER_ORE.get() ... in your case: -
[1.16.5] How to make EnchantedBook go to Custom ItemGroup
samjviana replied to samjviana's topic in Modder Support
Thanks, it worked ... I tried the second way, but i'll create an custom EnchantmentType to organize things better. One last thing ... how i can "rename" the enchantment in the lang file, tried several things and nothing works, the enchantment keeps showing it's registry name -
[1.16.5] How to make EnchantedBook go to Custom ItemGroup
samjviana replied to samjviana's topic in Modder Support
But how can i do that for an enchantment book, for normal items i was able to do that by calling the function "group" as you said, but with the enchantment seems to be different. -
[1.16.5] How to make EnchantedBook go to Custom ItemGroup
samjviana posted a topic in Modder Support
I making some custom emchantment, and would like them to show up on an Custom ItemGroup, but i don't know where to start, i tried looking into some classes and did some google about it, but can't find anything usefull. -
So, after a lot of searching and testing with some piston related code, i was able to fix the problem by creating an custom PistonTileEntity and an PistonTileEntityRenderer. 😪 Now i'm stuck in another problem. But i'll open another topic about it later.
-
I just did that and it worked. Thanks I also notice that the vanilla has not just the PistonBlockHead, PistonBlock and StickyPiston but also an MovingPiston ... looking into it now.
-
It is already on github ... link to repository I just commited some changes.
-
Cause i needed the head of the piston to be a different block ... or different texture. A sticky piston made from black slime ball. Nothing special about it, just for understanding how everything works. Is there an different way to achieve that?
-
I'm trying to create an custom sticky piston with another slime color. And i actully did make it work but having some problems. The piston itself cannot be pushed and i couldn't find out how to change that. When the piston is retracting the piston head texture changes to the default and when the retraction ends it changes back to the actual texture. Please correct me if I did something wrong or if something could be done better. The Piston Head code: public class BlackStickyPistonHeadBlock extends PistonHeadBlock { public BlackStickyPistonHeadBlock(Properties properties) { super(properties); } @Override public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) { return super.isValidPosition(state, worldIn, pos); } @Override public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) { if (facing.getOpposite() == stateIn.get(FACING)) { if (!stateIn.isValidPosition(worldIn, currentPos)) { return stateIn; } } if (!stateIn.isValidPosition(worldIn, currentPos)) { if (facing.getOpposite() == stateIn.get(FACING)) { return Blocks.AIR.getDefaultState(); } } return stateIn; } } The Piston Block code (Most part of it is just "copied" from the vanilla PistonBlock code): public class BlackStickyPistonBlock extends PistonBlock { private final boolean isSticky; public BlackStickyPistonBlock(boolean sticky, Properties properties) { super(sticky, properties); this.isSticky = sticky; } private boolean doMove(World worldIn, BlockPos pos, Direction directionIn, boolean extending) { BlockPos blockpos = pos.offset(directionIn); if (!extending && worldIn.getBlockState(blockpos).isIn(ModBlocks.BLACK_STICKY_PISTON_HEAD.get())) { worldIn.setBlockState(blockpos, Blocks.AIR.getDefaultState(), 20); } PistonBlockStructureHelper pistonblockstructurehelper = new PistonBlockStructureHelper(worldIn, pos, directionIn, extending); if (!pistonblockstructurehelper.canMove()) { return false; } else { Map<BlockPos, BlockState> map = Maps.newHashMap(); List<BlockPos> list = pistonblockstructurehelper.getBlocksToMove(); List<BlockState> list1 = Lists.newArrayList(); for (int i = 0; i < list.size(); ++i) { BlockPos blockpos1 = list.get(i); BlockState blockstate = worldIn.getBlockState(blockpos1); list1.add(blockstate); map.put(blockpos1, blockstate); } List<BlockPos> list2 = pistonblockstructurehelper.getBlocksToDestroy(); BlockState[] ablockstate = new BlockState[list.size() + list2.size()]; Direction direction = extending ? directionIn : directionIn.getOpposite(); int j = 0; for (int k = list2.size() - 1; k >= 0; --k) { BlockPos blockpos2 = list2.get(k); BlockState blockstate1 = worldIn.getBlockState(blockpos2); TileEntity tileentity = blockstate1.hasTileEntity() ? worldIn.getTileEntity(blockpos2) : null; spawnDrops(blockstate1, worldIn, blockpos2, tileentity); worldIn.setBlockState(blockpos2, Blocks.AIR.getDefaultState(), 18); ablockstate[j++] = blockstate1; } for (int l = list.size() - 1; l >= 0; --l) { BlockPos blockpos3 = list.get(l); BlockState blockstate5 = worldIn.getBlockState(blockpos3); blockpos3 = blockpos3.offset(direction); map.remove(blockpos3); worldIn.setBlockState(blockpos3, Blocks.MOVING_PISTON.getDefaultState().with(FACING, directionIn), 68); worldIn.setTileEntity(blockpos3, MovingPistonBlock.createTilePiston(list1.get(l), directionIn, extending, false)); ablockstate[j++] = blockstate5; } if (extending) { PistonType pistontype = this.isSticky ? PistonType.STICKY : PistonType.DEFAULT; BlockState blockstate4 = ModBlocks.BLACK_STICKY_PISTON_HEAD.get().getDefaultState().with(PistonHeadBlock.FACING, directionIn).with(PistonHeadBlock.TYPE, pistontype); BlockState blockstate6 = Blocks.MOVING_PISTON.getDefaultState().with(MovingPistonBlock.FACING, directionIn).with(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT); map.remove(blockpos); worldIn.setBlockState(blockpos, blockstate6, 68); worldIn.setTileEntity(blockpos, MovingPistonBlock.createTilePiston(blockstate4, directionIn, true, true)); } BlockState blockstate3 = Blocks.AIR.getDefaultState(); for (BlockPos blockpos4 : map.keySet()) { worldIn.setBlockState(blockpos4, blockstate3, 82); } for (Entry<BlockPos, BlockState> entry : map.entrySet()) { BlockPos blockpos5 = entry.getKey(); BlockState blockstate2 = entry.getValue(); blockstate2.updateDiagonalNeighbors(worldIn, blockpos5, 2); blockstate3.func_235734_a_(worldIn, blockpos5, 2); blockstate3.updateDiagonalNeighbors(worldIn, blockpos5, 2); } j = 0; for (int i1 = list2.size() - 1; i1 >= 0; --i1) { BlockState blockstate7 = ablockstate[j++]; BlockPos blockpos6 = list2.get(i1); blockstate7.updateDiagonalNeighbors(worldIn, blockpos6, 2); worldIn.notifyNeighborsOfStateChange(blockpos6, blockstate7.getBlock()); } for (int j1 = list.size() - 1; j1 >= 0; --j1) { worldIn.notifyNeighborsOfStateChange(list.get(j1), ablockstate[j++].getBlock()); } if (extending) { worldIn.notifyNeighborsOfStateChange(blockpos, ModBlocks.BLACK_STICKY_PISTON_HEAD.get()); } return true; } } private boolean shouldBeExtended(World worldIn, BlockPos pos, Direction facing) { for(Direction direction : Direction.values()) { if (direction != facing && worldIn.isSidePowered(pos.offset(direction), direction)) { return true; } } if (worldIn.isSidePowered(pos, Direction.DOWN)) { return true; } else { BlockPos blockpos = pos.up(); for(Direction direction1 : Direction.values()) { if (direction1 != Direction.DOWN && worldIn.isSidePowered(blockpos.offset(direction1), direction1)) { return true; } } return false; } } @Override public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) { if (state.get(EXTENDED)) { Direction direction = state.get(FACING); BlockPos blockPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ()); if (direction.compareTo(Direction.UP) == 0) { worldIn.destroyBlock(blockPos.up(), false); } else if(direction.compareTo(Direction.DOWN) == 0) { worldIn.destroyBlock(blockPos.down(), false); } else if(direction.compareTo(Direction.EAST) == 0) { worldIn.destroyBlock(blockPos.east(), false); } else if(direction.compareTo(Direction.WEST) == 0) { worldIn.destroyBlock(blockPos.west(), false); } else if(direction.compareTo(Direction.NORTH) == 0) { worldIn.destroyBlock(blockPos.north(), false); } else if(direction.compareTo(Direction.SOUTH) == 0) { worldIn.destroyBlock(blockPos.south(), false); } } super.onBlockHarvested(worldIn, pos, state, player); } @Override public boolean eventReceived(BlockState state, World worldIn, BlockPos pos, int id, int param) { Direction direction = state.get(FACING); if (!worldIn.isRemote) { boolean flag = this.shouldBeExtended(worldIn, pos, direction); if (flag && (id == 1 || id == 2)) { worldIn.setBlockState(pos, state.with(EXTENDED, Boolean.valueOf(true)), 2); return false; } if (!flag && id == 0) { return false; } } if (id == 0) { if (net.minecraftforge.event.ForgeEventFactory.onPistonMovePre(worldIn, pos, direction, true)) return false; if (!this.doMove(worldIn, pos, direction, true)) { return false; } worldIn.setBlockState(pos, state.with(EXTENDED, Boolean.valueOf(true)), 67); worldIn.playSound((PlayerEntity) null, pos, SoundEvents.BLOCK_PISTON_EXTEND, SoundCategory.BLOCKS, 0.5F, worldIn.rand.nextFloat() * 0.25F + 0.6F); } else if (id == 1 || id == 2) { if (net.minecraftforge.event.ForgeEventFactory.onPistonMovePre(worldIn, pos, direction, false)) return false; TileEntity tileentity1 = worldIn.getTileEntity(pos.offset(direction)); if (tileentity1 instanceof PistonTileEntity) { ((PistonTileEntity) tileentity1).clearPistonTileEntity(); } BlockState blockstate = Blocks.MOVING_PISTON.getDefaultState().with(MovingPistonBlock.FACING, direction) .with(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT); worldIn.setBlockState(pos, blockstate, 20); worldIn.setTileEntity(pos, MovingPistonBlock.createTilePiston( this.getDefaultState().with(FACING, Direction.byIndex(param & 7)), direction, false, true)); worldIn.func_230547_a_(pos, blockstate.getBlock()); blockstate.func_235734_a_(worldIn, pos, 2); if (this.isSticky) { BlockPos blockpos = pos.add(direction.getXOffset() * 2, direction.getYOffset() * 2, direction.getZOffset() * 2); BlockState blockstate1 = worldIn.getBlockState(blockpos); boolean flag1 = false; if (blockstate1.isIn(Blocks.MOVING_PISTON)) { TileEntity tileentity = worldIn.getTileEntity(blockpos); if (tileentity instanceof PistonTileEntity) { PistonTileEntity pistontileentity = (PistonTileEntity) tileentity; if (pistontileentity.getFacing() == direction && pistontileentity.isExtending()) { pistontileentity.clearPistonTileEntity(); flag1 = true; } } } if (!flag1) { if (id != 1 || blockstate1.isAir() || !canPush(blockstate1, worldIn, blockpos, direction.getOpposite(), false, direction) || blockstate1.getPushReaction() != PushReaction.NORMAL && !blockstate1.isIn(Blocks.PISTON) && !blockstate1.isIn(Blocks.STICKY_PISTON)) { worldIn.removeBlock(pos.offset(direction), false); } else { this.doMove(worldIn, pos, direction, false); } } } else { worldIn.removeBlock(pos.offset(direction), false); } worldIn.playSound((PlayerEntity) null, pos, SoundEvents.BLOCK_PISTON_CONTRACT, SoundCategory.BLOCKS, 0.5F, worldIn.rand.nextFloat() * 0.15F + 0.6F); } net.minecraftforge.event.ForgeEventFactory.onPistonMovePost(worldIn, pos, direction, (id == 0)); return true; } }
-
I'm trying to create an custom piston with another slime color. And i actully did make it work but having some problems. The piston itself cannot be pushed and i couldn't find out how to change that. When the piston is retracting the piston head texture changes to the default and and the retraction ends it changes back to the actual texture. When i break the piston while extended the head remains. Please correct me if I did something wrong or if something could be done better. The Piston Head code: public class BlackStickyPistonHeadBlock extends PistonHeadBlock { public BlackStickyPistonHeadBlock(Properties properties) { super(properties); } @Override public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) { return super.isValidPosition(state, worldIn, pos); } @Override public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) { if (facing.getOpposite() == stateIn.get(FACING)) { if (!stateIn.isValidPosition(worldIn, currentPos)) { return stateIn; } } if (!stateIn.isValidPosition(worldIn, currentPos)) { if (facing.getOpposite() == stateIn.get(FACING)) { return Blocks.AIR.getDefaultState(); } } return stateIn; } } The Piston Block code (Most part of it is just "copied" from the vanilla PistonBlock code): public class BlackStickyPistonBlock extends PistonBlock { private final boolean isSticky; public BlackStickyPistonBlock(boolean sticky, Properties properties) { super(sticky, properties); this.isSticky = sticky; } private boolean doMove(World worldIn, BlockPos pos, Direction directionIn, boolean extending) { BlockPos blockpos = pos.offset(directionIn); if (!extending && worldIn.getBlockState(blockpos).isIn(ModBlocks.BLACK_STICKY_PISTON_HEAD.get())) { worldIn.setBlockState(blockpos, Blocks.AIR.getDefaultState(), 20); } PistonBlockStructureHelper pistonblockstructurehelper = new PistonBlockStructureHelper(worldIn, pos, directionIn, extending); if (!pistonblockstructurehelper.canMove()) { return false; } else { Map<BlockPos, BlockState> map = Maps.newHashMap(); List<BlockPos> list = pistonblockstructurehelper.getBlocksToMove(); List<BlockState> list1 = Lists.newArrayList(); for (int i = 0; i < list.size(); ++i) { BlockPos blockpos1 = list.get(i); BlockState blockstate = worldIn.getBlockState(blockpos1); list1.add(blockstate); map.put(blockpos1, blockstate); } List<BlockPos> list2 = pistonblockstructurehelper.getBlocksToDestroy(); BlockState[] ablockstate = new BlockState[list.size() + list2.size()]; Direction direction = extending ? directionIn : directionIn.getOpposite(); int j = 0; for (int k = list2.size() - 1; k >= 0; --k) { BlockPos blockpos2 = list2.get(k); BlockState blockstate1 = worldIn.getBlockState(blockpos2); TileEntity tileentity = blockstate1.hasTileEntity() ? worldIn.getTileEntity(blockpos2) : null; spawnDrops(blockstate1, worldIn, blockpos2, tileentity); worldIn.setBlockState(blockpos2, Blocks.AIR.getDefaultState(), 18); ablockstate[j++] = blockstate1; } for (int l = list.size() - 1; l >= 0; --l) { BlockPos blockpos3 = list.get(l); BlockState blockstate5 = worldIn.getBlockState(blockpos3); blockpos3 = blockpos3.offset(direction); map.remove(blockpos3); worldIn.setBlockState(blockpos3, Blocks.MOVING_PISTON.getDefaultState().with(FACING, directionIn), 68); worldIn.setTileEntity(blockpos3, MovingPistonBlock.createTilePiston(list1.get(l), directionIn, extending, false)); ablockstate[j++] = blockstate5; } if (extending) { PistonType pistontype = this.isSticky ? PistonType.STICKY : PistonType.DEFAULT; BlockState blockstate4 = ModBlocks.BLACK_STICKY_PISTON_HEAD.get().getDefaultState().with(PistonHeadBlock.FACING, directionIn).with(PistonHeadBlock.TYPE, pistontype); BlockState blockstate6 = Blocks.MOVING_PISTON.getDefaultState().with(MovingPistonBlock.FACING, directionIn).with(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT); map.remove(blockpos); worldIn.setBlockState(blockpos, blockstate6, 68); worldIn.setTileEntity(blockpos, MovingPistonBlock.createTilePiston(blockstate4, directionIn, true, true)); } BlockState blockstate3 = Blocks.AIR.getDefaultState(); for (BlockPos blockpos4 : map.keySet()) { worldIn.setBlockState(blockpos4, blockstate3, 82); } for (Entry<BlockPos, BlockState> entry : map.entrySet()) { BlockPos blockpos5 = entry.getKey(); BlockState blockstate2 = entry.getValue(); blockstate2.updateDiagonalNeighbors(worldIn, blockpos5, 2); blockstate3.func_235734_a_(worldIn, blockpos5, 2); blockstate3.updateDiagonalNeighbors(worldIn, blockpos5, 2); } j = 0; for (int i1 = list2.size() - 1; i1 >= 0; --i1) { BlockState blockstate7 = ablockstate[j++]; BlockPos blockpos6 = list2.get(i1); blockstate7.updateDiagonalNeighbors(worldIn, blockpos6, 2); worldIn.notifyNeighborsOfStateChange(blockpos6, blockstate7.getBlock()); } for (int j1 = list.size() - 1; j1 >= 0; --j1) { worldIn.notifyNeighborsOfStateChange(list.get(j1), ablockstate[j++].getBlock()); } if (extending) { worldIn.notifyNeighborsOfStateChange(blockpos, ModBlocks.BLACK_STICKY_PISTON_HEAD.get()); } return true; } } private boolean shouldBeExtended(World worldIn, BlockPos pos, Direction facing) { for(Direction direction : Direction.values()) { if (direction != facing && worldIn.isSidePowered(pos.offset(direction), direction)) { return true; } } if (worldIn.isSidePowered(pos, Direction.DOWN)) { return true; } else { BlockPos blockpos = pos.up(); for(Direction direction1 : Direction.values()) { if (direction1 != Direction.DOWN && worldIn.isSidePowered(blockpos.offset(direction1), direction1)) { return true; } } return false; } } @Override public boolean eventReceived(BlockState state, World worldIn, BlockPos pos, int id, int param) { Direction direction = state.get(FACING); if (!worldIn.isRemote) { boolean flag = this.shouldBeExtended(worldIn, pos, direction); if (flag && (id == 1 || id == 2)) { worldIn.setBlockState(pos, state.with(EXTENDED, Boolean.valueOf(true)), 2); return false; } if (!flag && id == 0) { return false; } } if (id == 0) { if (net.minecraftforge.event.ForgeEventFactory.onPistonMovePre(worldIn, pos, direction, true)) return false; if (!this.doMove(worldIn, pos, direction, true)) { return false; } worldIn.setBlockState(pos, state.with(EXTENDED, Boolean.valueOf(true)), 67); worldIn.playSound((PlayerEntity) null, pos, SoundEvents.BLOCK_PISTON_EXTEND, SoundCategory.BLOCKS, 0.5F, worldIn.rand.nextFloat() * 0.25F + 0.6F); } else if (id == 1 || id == 2) { if (net.minecraftforge.event.ForgeEventFactory.onPistonMovePre(worldIn, pos, direction, false)) return false; TileEntity tileentity1 = worldIn.getTileEntity(pos.offset(direction)); if (tileentity1 instanceof PistonTileEntity) { ((PistonTileEntity) tileentity1).clearPistonTileEntity(); } BlockState blockstate = Blocks.MOVING_PISTON.getDefaultState().with(MovingPistonBlock.FACING, direction) .with(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT); worldIn.setBlockState(pos, blockstate, 20); worldIn.setTileEntity(pos, MovingPistonBlock.createTilePiston( this.getDefaultState().with(FACING, Direction.byIndex(param & 7)), direction, false, true)); worldIn.func_230547_a_(pos, blockstate.getBlock()); blockstate.func_235734_a_(worldIn, pos, 2); if (this.isSticky) { BlockPos blockpos = pos.add(direction.getXOffset() * 2, direction.getYOffset() * 2, direction.getZOffset() * 2); BlockState blockstate1 = worldIn.getBlockState(blockpos); boolean flag1 = false; if (blockstate1.isIn(Blocks.MOVING_PISTON)) { TileEntity tileentity = worldIn.getTileEntity(blockpos); if (tileentity instanceof PistonTileEntity) { PistonTileEntity pistontileentity = (PistonTileEntity) tileentity; if (pistontileentity.getFacing() == direction && pistontileentity.isExtending()) { pistontileentity.clearPistonTileEntity(); flag1 = true; } } } if (!flag1) { if (id != 1 || blockstate1.isAir() || !canPush(blockstate1, worldIn, blockpos, direction.getOpposite(), false, direction) || blockstate1.getPushReaction() != PushReaction.NORMAL && !blockstate1.isIn(Blocks.PISTON) && !blockstate1.isIn(Blocks.STICKY_PISTON)) { worldIn.removeBlock(pos.offset(direction), false); } else { this.doMove(worldIn, pos, direction, false); } } } else { worldIn.removeBlock(pos.offset(direction), false); } worldIn.playSound((PlayerEntity) null, pos, SoundEvents.BLOCK_PISTON_CONTRACT, SoundCategory.BLOCKS, 0.5F, worldIn.rand.nextFloat() * 0.15F + 0.6F); } net.minecraftforge.event.ForgeEventFactory.onPistonMovePost(worldIn, pos, direction, (id == 0)); return true; } }
-
🤔🤔 Ooh, you're right. So to get the light level first the BlockState is passed as parameters. Now i get it, didn't realize that. I haven't gotten used to lamba expressions yet
-
I know that the function should receive ToIntFunction<BlockState>, i just named the parameter as "lightLevel" because the number returned is the light level that the block will have. And i couldn't think in a better/proper way to name it. But thanks, btw what would you recommend then?
-
What do you mean with "only 1 player" exactly?
-
Look at my answer at you previous post.
-
Call func_235838_a_ passing a lambda expression that returns the light level. Like this: .func_235838_a_((lightLevel) -> 10) Where 10 is the light level you expect it to have.
-
[1.16.2] How to add Custom Ore to World Generation
samjviana replied to samjviana's topic in Modder Support
So, after a lot of digging around the forge/minecraft classes i managed to figure it out how the Ore Gen is working. The feature registering remains similar: public static void initGen() { Registry.register( WorldGenRegistries.field_243653_e /* Feature Registering */, ModBlocks.ADAMANTINE_ORE.getId() /* Resource Location */, Feature.field_236289_V_ /* no_surface_ore */.withConfiguration( new OreFeatureConfig( OreFeatureConfig.FillerBlockType.field_241882_a /* base_stone_overworld */, ModBlocks.ADAMANTINE_ORE.get().getDefaultState() */, 64 ) ).withPlacement(Placement.field_242910_o /* depth */ .configure( new DepthAverageConfig(12, 12) )).func_242728_a() /* spreadHorizontally */ .func_242731_b(1) /* repeat */ ); } The most trick part was adding that feature in the already configured features of an biome: public static void setupGen() { for (Map.Entry<RegistryKey<Biome>, Biome> biome : WorldGenRegistries.field_243657_i.func_239659_c_() /* Collection of Biome Entries */) { if (!biome.getValue().getCategory().equals(Biome.Category.NETHER) && !biome.getValue().getCategory().equals(Biome.Category.THEEND)) { addFeatureToBiome( biome.getValue(), GenerationStage.Decoration.UNDERGROUND_ORES, WorldGenRegistries.field_243653_e.getOrDefault(ModBlocks.ADAMANTINE_ORE.getId()) ); } } } public static void addFeatureToBiome(Biome biome, GenerationStage.Decoration decoration, ConfiguredFeature<?, ?> configuredFeature) { List<List<Supplier<ConfiguredFeature<?, ?>>>> biomeFeatures = new ArrayList<>( biome.func_242440_e().func_242498_c() /* List of Configured Features */ ); while (biomeFeatures.size() <= decoration.ordinal()) { biomeFeatures.add(Lists.newArrayList()); } List<Supplier<ConfiguredFeature<?, ?>>> features = new ArrayList<>(biomeFeatures.get(decoration.ordinal())); features.add(() -> configuredFeature); biomeFeatures.set(decoration.ordinal(), features); /* Change field_242484_f that contains the Configured Features of the Biome*/ ObfuscationReflectionHelper.setPrivateValue(BiomeGenerationSettings.class, biome.func_242440_e(), biomeFeatures, "field_242484_f"); }} Actually it seems that there's no proper way of doing this by now, since i needed to use the "setPrivateValue". It's not ideal ... but it works. Thanks a lot for the guidance. -
[1.16.2] How to add Custom Ore to World Generation
samjviana replied to samjviana's topic in Modder Support
i'll look into it, thanks. Any news i'll post here. -
[1.16.2] How to add Custom Ore to World Generation
samjviana replied to samjviana's topic in Modder Support
So at this point it isn't possible? At least not by the usual way?