Re-add Oak Gen replacement

This commit is contained in:
Mrbysco 2023-07-25 20:26:42 +02:00
parent f3e34143cf
commit 5b4a771a34

View file

@ -10,6 +10,7 @@ import de.ellpeck.naturesaura.reg.ICustomBlockState;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.data.worldgen.features.TreeFeatures;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SaplingBlock;
import net.minecraft.world.level.block.SoundType;
@ -38,11 +39,11 @@ public class BlockOakGenerator extends BlockContainerImpl implements IVisualizab
Helper.getBlockEntitiesInArea(level, pos, 10, tile -> {
if (!(tile instanceof BlockEntityOakGenerator oak))
return false;
/* var replacement = BlockOakGenerator.getReplacement(event.getFeature());
var replacement = BlockOakGenerator.getReplacement(event.getFeature());
if (replacement != null) {
oak.scheduledBigTrees.add(pos);
event.setFeature(replacement);
}*/
}
return true;
});
}
@ -68,8 +69,11 @@ public class BlockOakGenerator extends BlockContainerImpl implements IVisualizab
generator.modLoc("block/" + this.getBaseName() + "_top")));
}
// TODO oak gen replacements
/*private static Holder<? extends ConfiguredFeature<?, ?>> getReplacement(Holder<? extends ConfiguredFeature<?, ?>> feature) {
private static ResourceKey<ConfiguredFeature<?, ?>> getReplacement(Holder<ConfiguredFeature<?, ?>> holder) {
if(holder == null || !holder.unwrapKey().isPresent())
return null;
ResourceKey<ConfiguredFeature<?, ?>> feature = holder.unwrapKey().get();
if (feature == TreeFeatures.FANCY_OAK || feature == TreeFeatures.FANCY_OAK_BEES) {
return TreeFeatures.OAK;
} else if (feature == TreeFeatures.FANCY_OAK_BEES_002) {
@ -81,5 +85,5 @@ public class BlockOakGenerator extends BlockContainerImpl implements IVisualizab
} else {
return null;
}
}*/
}
}